I'd breakdown the sample code into specific operations: start, stop, write data, write command, read status etc. Then break each op into its' sequence of steps. Now see how to do the same ops/sequences on yours.
I2C can be handled directly by controlling the 2 lines. In assembler, it's a lot of bit-set & bit-clear according to the protocols' timing diagram, using shifts of a register to sequence the byte to bit conversions. I had to write one on a Freescale 908 that didn't have a module for it. A tedious process, but satisfying once working. Good Hunting... <<<)))
Also, high level code (C, VisualBasic etc) is complied, resulting in assembler code. Assembler code is assembled, resulting in machine code. Machine code is a binary number string, and absolutely unreadable by people. Assembler is the lowest level readable and machine code must be disassembled to get there. Otherwise you need the source code in assembler. Small distinctions, but can be important in debugging.