int main(int argc, char *argv[]) {
  char targetByte = 0;
  char chipAddress = 8;
  char byte1;
  int argvIndex;
  for (argvIndex = 1; argvIndex < argc; argvIndex++) {
    char *parameter1 = argv[argvIndex];
    if (strncmp(parameter1, "-h", 2) == 0) {
      printf("Usage:\n");
      printf("-c <SDA-Port> <SCL-Port> <TIME>\n");
      printf("-i: init - set SDA/SCL to high\n");
      printf("-as <address>: send address on write mode\n");
      printf("-ar <address>: send address on read mode\n");
      printf("-s: Send i2c-Start\n");
      printf("-r <byte>: Read i2c-byte\n");
      printf("-w <byte>: Send i2c-byte\n");
      printf("-e: Send i2c-stop\n");
      printf("-t <chipAddress>: Test if address is present\n");
      continue;
    }
    if (strncmp(parameter1, "-c", 2) == 0) {
      if (argvIndex + 3 >= argc) {
        printf("usage: -c SDA SCL TIME\n");
        exit(0);
      }
      si2cMasterSetup(atoi(argv[argvIndex + 1]), atoi(argv[argvIndex + 2]),
                      atoi(argv[argvIndex + 3]));
      argvIndex = argvIndex + 3;
      continue;
    } else {
      if (!si2cMasterIsSetup()) {
        si2cMasterSetup(17, 27, 50000);
      }
    }
    if (strncmp(parameter1, "-i", 2) == 0) {
      si2cMasterInit();
      continue;
    }
    if (strncmp(parameter1, "-as", 3) == 0) {
      if (argvIndex + 1 >= argc) {
        printf("usage: -a <address>\n");
        exit(0);
      }
      chipAddress = (unsigned int)atoi(argv[argvIndex + 1]);
      si2cMasterSetAddress(&targetByte, chipAddress);
      si2cMasterSetMode(&targetByte, 0);
      si2cMasterSendByte(targetByte);
      if (si2cMasterGetACK() != 1) {
        printf("The client doesn't send ack for address\n");
        exit(-1);
      }
      continue;
    }
    if (strncmp(parameter1, "-ar", 3) == 0) {
      if (argvIndex + 1 >= argc) {
        printf("usage: -a <address>\n");
        exit(0);
      }
      chipAddress = (unsigned int)atoi(argv[argvIndex + 1]);
      si2cMasterSetAddress(&targetByte, chipAddress);
      si2cMasterSetMode(&targetByte, 1);
      si2cMasterSendByte(targetByte);
      if (si2cMasterGetACK() != 1) {
        printf("The client doesn't send ack for address\n");
        exit(-1);
      }
      continue;
    }
    if (strncmp(parameter1, "-s", 2) == 0) {
      si2cMasterSendStart();
      continue;
    }
    if (strncmp(parameter1, "-r", 2) == 0) {
      si2cMasterReadByte(&byte1);
      printf("%s 0x%1x\n", __FUNCTION__, byte1);
      si2cMasterSendBit(1);
      continue;
    }
    if (strncmp(parameter1, "-w", 2) == 0) {
      if (argvIndex + 1 >= argc) {
        printf("usage: -w <byte> - Send i2c-byte\n");
        exit(0);
      }
      byte1 = atoi(argv[argvIndex + 1]);
      si2cMasterSendByte(byte1);
      if (si2cMasterGetACK() != 1) {
        printf("The client doesn't send ack for byte\n");
        exit(-1);
      }
      continue;
    }
    if (strncmp(parameter1, "-e", 2) == 0) {
      si2cMasterSendStop();
    }
    if (strncmp(parameter1, "-t", 2) == 0) {
      if (argvIndex + 1 >= argc) {
        printf("usage: -check chipAddress\n");
        exit(0);
      }
      chipAddress = (unsigned int)atoi(argv[argvIndex + 1]);
      si2cMasterSetAddress(&targetByte, chipAddress);
      si2cMasterSetMode(&targetByte, 0);
      si2cMasterInit();
      si2cMasterSendStart();
      si2cMasterSendByte(targetByte);
      if (si2cMasterGetACK() != 1) {
        printf("The client doesn't send ack for address\n");
        si2cMasterSendStop();
        exit(-1);
      }
      exit(0);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0x8,-0x12(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1759 <main+0x569>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdc4(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12e0 <main+0xf0>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xe3f(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    138d <main+0x19d>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
cmp    -0x8(%rbp),%eax
jl     1322 <main+0x132>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    %eax,%edx
mov    $0x0,%al
call   10c0 <si2cMasterSetup@plt>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    174b <main+0x55b>
mov    $0x0,%al
call   10e0 <si2cMasterIsSetup@plt>
cmp    $0x0,%eax
jne    13b3 <main+0x1c3>
mov    $0x11,%edi
mov    $0x1b,%esi
mov    $0xc350,%edx
mov    $0x0,%al
call   10c0 <si2cMasterSetup@plt>
jmp    13b8 <main+0x1c8>
mov    -0x20(%rbp),%rdi
lea    0xd82(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    13e2 <main+0x1f2>
mov    $0x0,%al
call   1050 <si2cMasterInit@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xd5b(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1493 <main+0x2a3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jl     1424 <main+0x234>
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%esi
lea    -0x11(%rbp),%rdi
mov    $0x0,%al
call   1070 <si2cMasterSetAddress@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1110 <si2cMasterSetMode@plt>
movsbl -0x11(%rbp),%edi
mov    $0x0,%al
call   1030 <si2cMasterSendByte@plt>
mov    $0x0,%al
call   1080 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
je     148e <main+0x29e>
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xcec(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1547 <main+0x357>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jl     14d5 <main+0x2e5>
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%esi
lea    -0x11(%rbp),%rdi
mov    $0x0,%al
call   1070 <si2cMasterSetAddress@plt>
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1110 <si2cMasterSetMode@plt>
movsbl -0x11(%rbp),%edi
mov    $0x0,%al
call   1030 <si2cMasterSendByte@plt>
mov    $0x0,%al
call   1080 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
je     1542 <main+0x352>
lea    0xc30(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xc3c(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1571 <main+0x381>
mov    $0x0,%al
call   1090 <si2cMasterSendStart@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xc15(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15c4 <main+0x3d4>
lea    -0x13(%rbp),%rdi
mov    $0x0,%al
call   10d0 <si2cMasterReadByte@plt>
movsbl -0x13(%rbp),%edx
lea    0xbef(%rip),%rdi
lea    0xbf2(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   10a0 <si2cMasterSendBit@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xbd4(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1659 <main+0x469>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jl     1606 <main+0x416>
lea    0xbae(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    %al,-0x13(%rbp)
movsbl -0x13(%rbp),%edi
mov    $0x0,%al
call   1030 <si2cMasterSendByte@plt>
mov    $0x0,%al
call   1080 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
je     1654 <main+0x464>
lea    0xb85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
jmp    174b <main+0x55b>
mov    -0x20(%rbp),%rdi
lea    0xb8a(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    167e <main+0x48e>
mov    $0x0,%al
call   10b0 <si2cMasterSendStop@plt>
mov    -0x20(%rbp),%rdi
lea    0xb68(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1746 <main+0x556>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jl     16c0 <main+0x4d0>
lea    0xb42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   10f0 <atoi@plt>
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%esi
lea    -0x11(%rbp),%rdi
mov    $0x0,%al
call   1070 <si2cMasterSetAddress@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1110 <si2cMasterSetMode@plt>
mov    $0x0,%al
call   1050 <si2cMasterInit@plt>
mov    $0x0,%al
call   1090 <si2cMasterSendStart@plt>
movsbl -0x11(%rbp),%edi
mov    $0x0,%al
call   1030 <si2cMasterSendByte@plt>
mov    $0x0,%al
call   1080 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
je     173f <main+0x54f>
lea    0xa3a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <si2cMasterSendStop@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
xor    %edi,%edi
call   1100 <exit@plt>
jmp    174b <main+0x55b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1215 <main+0x25>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x0,0x6(%rsp)
cmp    $0x2,%edi
jl     157a <main+0x37a>
mov    %rsi,%r12
mov    %edi,%r13d
mov    $0x1,%r14d
lea    0xdd4(%rip),%rbp
jmp    12c5 <main+0xc5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe9b(%rip),%rdi
call   1050 <puts@plt>
lea    0xe96(%rip),%rdi
call   1050 <puts@plt>
lea    0xeaa(%rip),%rdi
call   1050 <puts@plt>
lea    0xebd(%rip),%rdi
call   1050 <puts@plt>
lea    0xedb(%rip),%rdi
call   1050 <puts@plt>
lea    0xef8(%rip),%rdi
call   1050 <puts@plt>
lea    0xeff(%rip),%rdi
call   1050 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1050 <puts@plt>
lea    0xf19(%rip),%rdi
call   1050 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1050 <puts@plt>
add    $0x1,%r14d
cmp    %r13d,%r14d
jge    157a <main+0x37a>
movslq %r14d,%rbx
mov    (%r12,%rbx,8),%r15
mov    $0x2,%edx
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     1240 <main+0x40>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xd10(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     1410 <main+0x210>
xor    %eax,%eax
call   10f0 <si2cMasterIsSetup@plt>
test   %eax,%eax
jne    1321 <main+0x121>
mov    $0x11,%edi
mov    $0x1b,%esi
mov    $0xc350,%edx
xor    %eax,%eax
call   10d0 <si2cMasterSetup@plt>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xcd6(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     145b <main+0x25b>
mov    $0x3,%edx
mov    %r15,%rdi
lea    0xcbd(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     1467 <main+0x267>
mov    $0x3,%edx
mov    %r15,%rdi
lea    0xca5(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     149a <main+0x29a>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xc8d(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     14f6 <main+0x2f6>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xc74(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     1502 <main+0x302>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xc6a(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
je     1539 <main+0x339>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xc51(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
jne    13e8 <main+0x1e8>
xor    %eax,%eax
call   10c0 <si2cMasterSendStop@plt>
mov    $0x2,%edx
mov    %r15,%rdi
lea    0xc35(%rip),%rsi
call   1040 <strncmp@plt>
test   %eax,%eax
jne    12b8 <main+0xb8>
jmp    15bd <main+0x3bd>
nopl   0x0(%rax)
add    $0x3,%r14d
cmp    %r13d,%r14d
jge    158b <main+0x38b>
mov    0x8(%r12,%rbx,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
mov    %eax,%r15d
mov    0x10(%r12,%rbx,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
mov    %eax,%ebx
movslq %r14d,%rax
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   10d0 <si2cMasterSetup@plt>
jmp    12b8 <main+0xb8>
xor    %eax,%eax
call   1060 <si2cMasterInit@plt>
jmp    12b8 <main+0xb8>
lea    0x1(%r14),%eax
cmp    %r13d,%eax
jge    1594 <main+0x394>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
movsbl %al,%esi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <si2cMasterSetAddress@plt>
mov    %rbx,%rdi
xor    %esi,%esi
jmp    14ce <main+0x2ce>
lea    0x1(%r14),%eax
cmp    %r13d,%eax
jge    1594 <main+0x394>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
movsbl %al,%esi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <si2cMasterSetAddress@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1120 <si2cMasterSetMode@plt>
movsbl 0x6(%rsp),%edi
xor    %eax,%eax
call   1030 <si2cMasterSendByte@plt>
xor    %eax,%eax
call   1090 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
je     12b8 <main+0xb8>
jmp    15a7 <main+0x3a7>
xor    %eax,%eax
call   10a0 <si2cMasterSendStart@plt>
jmp    12b8 <main+0xb8>
lea    0x7(%rsp),%rdi
xor    %eax,%eax
call   10e0 <si2cMasterReadByte@plt>
movsbl 0x7(%rsp),%edx
lea    0xafd(%rip),%rdi
lea    0xb00(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <si2cMasterSendBit@plt>
jmp    12b8 <main+0xb8>
lea    0x1(%r14),%eax
cmp    %r13d,%eax
jge    161f <main+0x41f>
cltq
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
mov    %al,0x7(%rsp)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <si2cMasterSendByte@plt>
xor    %eax,%eax
call   1090 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
je     12b8 <main+0xb8>
lea    0xad1(%rip),%rdi
jmp    15ae <main+0x3ae>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb39(%rip),%rdi
jmp    159b <main+0x39b>
lea    0xb1c(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1110 <exit@plt>
lea    0xae1(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
add    $0x1,%r14d
cmp    %r13d,%r14d
jge    162b <main+0x42b>
movslq %r14d,%rax
mov    (%r12,%rax,8),%rdi
xor    %eax,%eax
call   1100 <atoi@plt>
movsbl %al,%esi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <si2cMasterSetAddress@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1120 <si2cMasterSetMode@plt>
xor    %eax,%eax
call   1060 <si2cMasterInit@plt>
xor    %eax,%eax
call   10a0 <si2cMasterSendStart@plt>
movsbl 0x6(%rsp),%edi
xor    %eax,%eax
call   1030 <si2cMasterSendByte@plt>
xor    %eax,%eax
call   1090 <si2cMasterGetACK@plt>
cmp    $0x1,%eax
jne    1637 <main+0x437>
xor    %edi,%edi
call   1110 <exit@plt>
lea    0xa48(%rip),%rdi
jmp    159b <main+0x39b>
lea    0x9fd(%rip),%rdi
jmp    159b <main+0x39b>
lea    0xa51(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10c0 <si2cMasterSendStop@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [33 x i8] c"-c <SDA-Port> <SCL-Port> <TIME>\0A\00"
@.str.3 = [32 x i8] c"-i: init - set SDA/SCL to high\0A\00"
@.str.4 = [43 x i8] c"-as <address>: send address on write mode\0A\00"
@.str.5 = [42 x i8] c"-ar <address>: send address on read mode\0A\00"
@.str.6 = [20 x i8] c"-s: Send i2c-Start\0A\00"
@.str.7 = [26 x i8] c"-r <byte>: Read i2c-byte\0A\00"
@.str.8 = [26 x i8] c"-w <byte>: Send i2c-byte\0A\00"
@.str.9 = [19 x i8] c"-e: Send i2c-stop\0A\00"
@.str.10 = [46 x i8] c"-t <chipAddress>: Test if address is present\0A\00"
@.str.11 = [3 x i8] c"-c\00"
@.str.12 = [24 x i8] c"usage: -c SDA SCL TIME\0A\00"
@.str.13 = [3 x i8] c"-i\00"
@.str.14 = [4 x i8] c"-as\00"
@.str.15 = [21 x i8] c"usage: -a <address>\0A\00"
@.str.16 = [41 x i8] c"The client doesn't send ack for address\0A\00"
@.str.17 = [4 x i8] c"-ar\00"
@.str.18 = [3 x i8] c"-s\00"
@.str.19 = [3 x i8] c"-r\00"
@.str.20 = [10 x i8] c"%s 0x%1x\0A\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.21 = [3 x i8] c"-w\00"
@.str.22 = [34 x i8] c"usage: -w <byte> - Send i2c-byte\0A\00"
@.str.23 = [38 x i8] c"The client doesn't send ack for byte\0A\00"
@.str.24 = [3 x i8] c"-e\00"
@.str.25 = [3 x i8] c"-t\00"
@.str.26 = [27 x i8] c"usage: -check chipAddress\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %6
store i8 8, i8* %7
store i32 1, i32* %9
br label %11
11: ; preds = %233, %2
%12 = load i32, i32* %9
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %236
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
store i8* %20, i8** %10
%21 = load i8*, i8** %10
%22 = call i32 @strncmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %35
24: ; preds = %15
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
br label %233
35: ; preds = %15
%36 = load i8*, i8** %10
%37 = call i32 @strncmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 2)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %71
39: ; preds = %35
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 3
%42 = load i32, i32* %4
%43 = icmp sge i32 %41, %42
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0))
unreachable
46: ; preds = %39
%47 = load i8**, i8*** %5
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %47, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %52)
%54 = load i8**, i8*** %5
%55 = load i32, i32* %9
%56 = add nsw i32 %55, 2
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %54, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %59)
%61 = load i8**, i8*** %5
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 3
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %61, i64 %64
%66 = load i8*, i8** %65
%67 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %66)
%68 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @si2cMasterSetup to i32 (i32, i32, i32, ...)*)(i32 %53, i32 %60, i32 %67)
%69 = load i32, i32* %9
%70 = add nsw i32 %69, 3
store i32 %70, i32* %9
br label %233
71: ; preds = %35
%72 = call i32 (...) @si2cMasterIsSetup()
%73 = icmp ne i32 %72, 0
br i1 %73, label %76, label %74
74: ; preds = %71
%75 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @si2cMasterSetup to i32 (i32, i32, i32, ...)*)(i32 17, i32 27, i32 50000)
br label %76
76: ; preds = %74, %71
br label %77
77: ; preds = %76
%78 = load i8*, i8** %10
%79 = call i32 @strncmp(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2)
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 (...) @si2cMasterInit()
br label %233
83: ; preds = %77
%84 = load i8*, i8** %10
%85 = call i32 @strncmp(i8* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i64 3)
%86 = icmp eq i32 %85, 0
br i1 %86, label %87, label %115
87: ; preds = %83
%88 = load i32, i32* %9
%89 = add nsw i32 %88, 1
%90 = load i32, i32* %4
%91 = icmp sge i32 %89, %90
br i1 %91, label %92, label %94
92: ; preds = %87
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
unreachable
94: ; preds = %87
%95 = load i8**, i8*** %5
%96 = load i32, i32* %9
%97 = add nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %95, i64 %98
%100 = load i8*, i8** %99
%101 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %100)
%102 = trunc i32 %101 to i8
store i8 %102, i8* %7
%103 = load i8, i8* %7
%104 = sext i8 %103 to i32
%105 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetAddress to i32 (i8*, i32, ...)*)(i8* %6, i32 %104)
%106 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetMode to i32 (i8*, i32, ...)*)(i8* %6, i32 0)
%107 = load i8, i8* %6
%108 = sext i8 %107 to i32
%109 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %108)
%110 = call i32 (...) @si2cMasterGetACK()
%111 = icmp ne i32 %110, 1
br i1 %111, label %112, label %114
112: ; preds = %94
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0))
unreachable
114: ; preds = %94
br label %233
115: ; preds = %83
%116 = load i8*, i8** %10
%117 = call i32 @strncmp(i8* %116, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i64 3)
%118 = icmp eq i32 %117, 0
br i1 %118, label %119, label %147
119: ; preds = %115
%120 = load i32, i32* %9
%121 = add nsw i32 %120, 1
%122 = load i32, i32* %4
%123 = icmp sge i32 %121, %122
br i1 %123, label %124, label %126
124: ; preds = %119
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
unreachable
126: ; preds = %119
%127 = load i8**, i8*** %5
%128 = load i32, i32* %9
%129 = add nsw i32 %128, 1
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8*, i8** %127, i64 %130
%132 = load i8*, i8** %131
%133 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %132)
%134 = trunc i32 %133 to i8
store i8 %134, i8* %7
%135 = load i8, i8* %7
%136 = sext i8 %135 to i32
%137 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetAddress to i32 (i8*, i32, ...)*)(i8* %6, i32 %136)
%138 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetMode to i32 (i8*, i32, ...)*)(i8* %6, i32 1)
%139 = load i8, i8* %6
%140 = sext i8 %139 to i32
%141 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %140)
%142 = call i32 (...) @si2cMasterGetACK()
%143 = icmp ne i32 %142, 1
br i1 %143, label %144, label %146
144: ; preds = %126
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0))
unreachable
146: ; preds = %126
br label %233
147: ; preds = %115
%148 = load i8*, i8** %10
%149 = call i32 @strncmp(i8* %148, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i64 2)
%150 = icmp eq i32 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %147
%152 = call i32 (...) @si2cMasterSendStart()
br label %233
153: ; preds = %147
%154 = load i8*, i8** %10
%155 = call i32 @strncmp(i8* %154, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i64 2)
%156 = icmp eq i32 %155, 0
br i1 %156, label %157, label %163
157: ; preds = %153
%158 = call i32 (i8*, ...) bitcast (i32 (...)* @si2cMasterReadByte to i32 (i8*, ...)*)(i8* %8)
%159 = load i8, i8* %8
%160 = sext i8 %159 to i32
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 %160)
%162 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 1)
br label %233
163: ; preds = %153
%164 = load i8*, i8** %10
%165 = call i32 @strncmp(i8* %164, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i64 2)
%166 = icmp eq i32 %165, 0
br i1 %166, label %167, label %191
167: ; preds = %163
%168 = load i32, i32* %9
%169 = add nsw i32 %168, 1
%170 = load i32, i32* %4
%171 = icmp sge i32 %169, %170
br i1 %171, label %172, label %174
172: ; preds = %167
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.22, i64 0, i64 0))
unreachable
174: ; preds = %167
%175 = load i8**, i8*** %5
%176 = load i32, i32* %9
%177 = add nsw i32 %176, 1
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8*, i8** %175, i64 %178
%180 = load i8*, i8** %179
%181 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %180)
%182 = trunc i32 %181 to i8
store i8 %182, i8* %8
%183 = load i8, i8* %8
%184 = sext i8 %183 to i32
%185 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %184)
%186 = call i32 (...) @si2cMasterGetACK()
%187 = icmp ne i32 %186, 1
br i1 %187, label %188, label %190
188: ; preds = %174
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.23, i64 0, i64 0))
unreachable
190: ; preds = %174
br label %233
191: ; preds = %163
%192 = load i8*, i8** %10
%193 = call i32 @strncmp(i8* %192, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i64 2)
%194 = icmp eq i32 %193, 0
br i1 %194, label %195, label %197
195: ; preds = %191
%196 = call i32 (...) @si2cMasterSendStop()
br label %197
197: ; preds = %195, %191
%198 = load i8*, i8** %10
%199 = call i32 @strncmp(i8* %198, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i64 2)
%200 = icmp eq i32 %199, 0
br i1 %200, label %201, label %232
201: ; preds = %197
%202 = load i32, i32* %9
%203 = add nsw i32 %202, 1
%204 = load i32, i32* %4
%205 = icmp sge i32 %203, %204
br i1 %205, label %206, label %208
206: ; preds = %201
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.26, i64 0, i64 0))
unreachable
208: ; preds = %201
%209 = load i8**, i8*** %5
%210 = load i32, i32* %9
%211 = add nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds i8*, i8** %209, i64 %212
%214 = load i8*, i8** %213
%215 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %214)
%216 = trunc i32 %215 to i8
store i8 %216, i8* %7
%217 = load i8, i8* %7
%218 = sext i8 %217 to i32
%219 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetAddress to i32 (i8*, i32, ...)*)(i8* %6, i32 %218)
%220 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetMode to i32 (i8*, i32, ...)*)(i8* %6, i32 0)
%221 = call i32 (...) @si2cMasterInit()
%222 = call i32 (...) @si2cMasterSendStart()
%223 = load i8, i8* %6
%224 = sext i8 %223 to i32
%225 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %224)
%226 = call i32 (...) @si2cMasterGetACK()
%227 = icmp ne i32 %226, 1
br i1 %227, label %228, label %231
228: ; preds = %208
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0))
%230 = call i32 (...) @si2cMasterSendStop()
unreachable
231: ; preds = %208
unreachable
232: ; preds = %197
br label %233
233: ; preds = %232, %190, %157, %151, %146, %114, %81, %46, %24
%234 = load i32, i32* %9
%235 = add nsw i32 %234, 1
store i32 %235, i32* %9
br label %11
236: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.11 = [3 x i8] c"-c\00"
@.str.13 = [3 x i8] c"-i\00"
@.str.14 = [4 x i8] c"-as\00"
@.str.17 = [4 x i8] c"-ar\00"
@.str.18 = [3 x i8] c"-s\00"
@.str.19 = [3 x i8] c"-r\00"
@.str.20 = [10 x i8] c"%s 0x%1x\0A\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.21 = [3 x i8] c"-w\00"
@.str.24 = [3 x i8] c"-e\00"
@.str.25 = [3 x i8] c"-t\00"
@str.27 = [26 x i8] c"usage: -check chipAddress\00"
@str.28 = [37 x i8] c"The client doesn't send ack for byte\00"
@str.29 = [33 x i8] c"usage: -w <byte> - Send i2c-byte\00"
@str.32 = [40 x i8] c"The client doesn't send ack for address\00"
@str.33 = [20 x i8] c"usage: -a <address>\00"
@str.34 = [23 x i8] c"usage: -c SDA SCL TIME\00"
@str.35 = [7 x i8] c"Usage:\00"
@str.36 = [32 x i8] c"-c <SDA-Port> <SCL-Port> <TIME>\00"
@str.37 = [31 x i8] c"-i: init - set SDA/SCL to high\00"
@str.38 = [42 x i8] c"-as <address>: send address on write mode\00"
@str.39 = [41 x i8] c"-ar <address>: send address on read mode\00"
@str.40 = [19 x i8] c"-s: Send i2c-Start\00"
@str.41 = [25 x i8] c"-r <byte>: Read i2c-byte\00"
@str.42 = [25 x i8] c"-w <byte>: Send i2c-byte\00"
@str.43 = [18 x i8] c"-e: Send i2c-stop\00"
@str.44 = [45 x i8] c"-t <chipAddress>: Test if address is present\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = alloca i8
store i8 0, i8* %3
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %178
6: ; preds = %2, %174
%7 = phi i32 [ %176, %174 ], [ 1, %2 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %6
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.35, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.36, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.37, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.38, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.39, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.40, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.41, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.42, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.43, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.44, i64 0, i64 0))
br label %174
24: ; preds = %6
%25 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 2)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %48
27: ; preds = %24
%28 = add nsw i32 %7, 3
%29 = icmp slt i32 %28, %0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.34, i64 0, i64 0))
unreachable
32: ; preds = %27
%33 = add nsw i32 %7, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %1, i64 %34
%36 = load i8*, i8** %35
%37 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %36)
%38 = add nsw i32 %7, 2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %1, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %41)
%43 = sext i32 %28 to i64
%44 = getelementptr inbounds i8*, i8** %1, i64 %43
%45 = load i8*, i8** %44
%46 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %45)
%47 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @si2cMasterSetup to i32 (i32, i32, i32, ...)*)(i32 %37, i32 %42, i32 %46)
br label %174
48: ; preds = %24
%49 = call i32 (...) @si2cMasterIsSetup()
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @si2cMasterSetup to i32 (i32, i32, i32, ...)*)(i32 17, i32 27, i32 50000)
br label %53
53: ; preds = %48, %51
%54 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (...) @si2cMasterInit()
br label %174
58: ; preds = %53
%59 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i64 3)
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %82
61: ; preds = %58
%62 = add nsw i32 %7, 1
%63 = icmp slt i32 %62, %0
br i1 %63, label %66, label %64
64: ; preds = %61
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.33, i64 0, i64 0))
unreachable
66: ; preds = %61
%67 = sext i32 %62 to i64
%68 = getelementptr inbounds i8*, i8** %1, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %69)
%71 = shl i32 %70, 24
%72 = ashr exact i32 %71, 24
%73 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetAddress to i32 (i8*, i32, ...)*)(i8* %3, i32 %72)
%74 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetMode to i32 (i8*, i32, ...)*)(i8* %3, i32 0)
%75 = load i8, i8* %3
%76 = sext i8 %75 to i32
%77 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %76)
%78 = call i32 (...) @si2cMasterGetACK()
%79 = icmp eq i32 %78, 1
br i1 %79, label %174, label %80
80: ; preds = %66
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.32, i64 0, i64 0))
unreachable
82: ; preds = %58
%83 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i64 3)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %106
85: ; preds = %82
%86 = add nsw i32 %7, 1
%87 = icmp slt i32 %86, %0
br i1 %87, label %90, label %88
88: ; preds = %85
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.33, i64 0, i64 0))
unreachable
90: ; preds = %85
%91 = sext i32 %86 to i64
%92 = getelementptr inbounds i8*, i8** %1, i64 %91
%93 = load i8*, i8** %92
%94 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %93)
%95 = shl i32 %94, 24
%96 = ashr exact i32 %95, 24
%97 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetAddress to i32 (i8*, i32, ...)*)(i8* %3, i32 %96)
%98 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetMode to i32 (i8*, i32, ...)*)(i8* %3, i32 1)
%99 = load i8, i8* %3
%100 = sext i8 %99 to i32
%101 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %100)
%102 = call i32 (...) @si2cMasterGetACK()
%103 = icmp eq i32 %102, 1
br i1 %103, label %174, label %104
104: ; preds = %90
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.32, i64 0, i64 0))
unreachable
106: ; preds = %82
%107 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i64 2)
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %111
109: ; preds = %106
%110 = call i32 (...) @si2cMasterSendStart()
br label %174
111: ; preds = %106
%112 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i64 2)
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %120
114: ; preds = %111
%115 = call i32 (i8*, ...) bitcast (i32 (...)* @si2cMasterReadByte to i32 (i8*, ...)*)(i8* %4)
%116 = load i8, i8* %4
%117 = sext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 %117)
%119 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 1)
br label %174
120: ; preds = %111
%121 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0), i64 2)
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %141
123: ; preds = %120
%124 = add nsw i32 %7, 1
%125 = icmp slt i32 %124, %0
br i1 %125, label %128, label %126
126: ; preds = %123
%127 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.29, i64 0, i64 0))
unreachable
128: ; preds = %123
%129 = sext i32 %124 to i64
%130 = getelementptr inbounds i8*, i8** %1, i64 %129
%131 = load i8*, i8** %130
%132 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %131)
%133 = trunc i32 %132 to i8
store i8 %133, i8* %4
%134 = shl i32 %132, 24
%135 = ashr exact i32 %134, 24
%136 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %135)
%137 = call i32 (...) @si2cMasterGetACK()
%138 = icmp eq i32 %137, 1
br i1 %138, label %174, label %139
139: ; preds = %128
%140 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.28, i64 0, i64 0))
unreachable
141: ; preds = %120
%142 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i64 2)
%143 = icmp eq i32 %142, 0
br i1 %143, label %144, label %146
144: ; preds = %141
%145 = call i32 (...) @si2cMasterSendStop()
br label %146
146: ; preds = %144, %141
%147 = call i32 @strncmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0), i64 2)
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %174
149: ; preds = %146
%150 = add nsw i32 %7, 1
%151 = icmp slt i32 %150, %0
br i1 %151, label %154, label %152
152: ; preds = %149
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.27, i64 0, i64 0))
unreachable
154: ; preds = %149
%155 = sext i32 %150 to i64
%156 = getelementptr inbounds i8*, i8** %1, i64 %155
%157 = load i8*, i8** %156
%158 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %157)
%159 = shl i32 %158, 24
%160 = ashr exact i32 %159, 24
%161 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetAddress to i32 (i8*, i32, ...)*)(i8* %3, i32 %160)
%162 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @si2cMasterSetMode to i32 (i8*, i32, ...)*)(i8* %3, i32 0)
%163 = call i32 (...) @si2cMasterInit()
%164 = call i32 (...) @si2cMasterSendStart()
%165 = load i8, i8* %3
%166 = sext i8 %165 to i32
%167 = call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendByte to i32 (i32, ...)*)(i32 %166)
%168 = call i32 (...) @si2cMasterGetACK()
%169 = icmp eq i32 %168, 1
br i1 %169, label %173, label %170
170: ; preds = %154
%171 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.32, i64 0, i64 0))
%172 = call i32 (...) @si2cMasterSendStop()
unreachable
173: ; preds = %154
unreachable
174: ; preds = %146, %128, %90, %66, %114, %109, %56, %32, %13
%175 = phi i32 [ %7, %13 ], [ %28, %32 ], [ %7, %56 ], [ %7, %109 ], [ %7, %114 ], [ %7, %66 ], [ %7, %90 ], [ %7, %128 ], [ %7, %146 ]
%176 = add nsw i32 %175, 1
%177 = icmp slt i32 %176, %0
br i1 %177, label %6, label %178
178: ; preds = %174, %2
ret i32 0
}