#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ xvalues1;

/* Variables and functions */
scalar_t__ assert(int, char *, ...);
int bool_flip_flop();
int convert_and_sum(int *, int, int, int);
int fix_bad_code(char *);
char *get_pointer_at_position(char *, int);
scalar_t__ memcmp(int *, int *, int);
int /*<<< orphan*/ printf(char *, ...);
int same_array(int *, int *);
scalar_t__ strcmp(char *, char *);
int test() {
  int passcount = 0;
  int failcount = 0;
  char *test1 = "findfinstring";
  int xvalues1[] = {0, 5, 2};
  int yvalues1[] = {-1, 9, 3};
  char bad_code_string[] = "badcode";
  char updated_bad_code_string[] = "badcodZ";
  printf("\nTests for get_pointer_at_position...................\n");
  assert(get_pointer_at_position(test1, 0) == test1,
         "Expected pointer to the beginning of the string")
      ? passcount++
      : failcount++;
  assert(get_pointer_at_position(test1, 4) == test1 + 4,
         "Expected pointer at position 4")
      ? passcount++
      : failcount++;
  assert(get_pointer_at_position(test1, 12) == test1 + 12,
         "Expected pointer to last character")
      ? passcount++
      : failcount++;
  assert(get_pointer_at_position(test1, 13) == NULL, "Expected NULL pointer")
      ? passcount++
      : failcount++;
  printf("\nTests for convert_and_sum...........................\n");
  assert(convert_and_sum(xvalues1, 2, -1, 3) == 11,
         "Sum of y values must be 11")
      ? passcount++
      : failcount++;
  assert(memcmp(xvalues1, yvalues1, sizeof(xvalues1)) == 0,
         "Must match expected y values")
      ? passcount++
      : failcount++;
  printf("\nTests for same_array................................\n");
  assert(same_array(xvalues1, xvalues1) == 1,
         "Expect 1 since it is the same array")
      ? passcount++
      : failcount++;
  assert(same_array(xvalues1, &xvalues1[1]) == 0,
         "Expect 0 since a different position in the array")
      ? passcount++
      : failcount++;
  assert(same_array(NULL, xvalues1) == 0, "Expect 0 since one is NULL")
      ? passcount++
      : failcount++;
  assert(same_array(xvalues1, NULL) == 0, "Expect 0 since 2nd is NULL")
      ? passcount++
      : failcount++;
  printf("\nTests for bool_flip_flop............................\n");
  assert(bool_flip_flop() == 1, "Expect 1 this is the first time it is called")
      ? passcount++
      : failcount++;
  assert(bool_flip_flop() == 0, "Expect 0 this is the second time it is called")
      ? passcount++
      : failcount++;
  assert(bool_flip_flop() == 1, "Expect 1 this is the third time it is called")
      ? passcount++
      : failcount++;
  assert(bool_flip_flop() == 0, "Expect 0 this is the fourth time it is called")
      ? passcount++
      : failcount++;
  printf("\nTests for fix_bad_code..............................\n");
  assert(fix_bad_code(bad_code_string) == 1,
         "Expect 1 since it is not any empty string")
      ? passcount++
      : failcount++;
  assert(strcmp(bad_code_string, updated_bad_code_string) == 0,
         "Expect Z in last position of bad_code_string but got this string %s",
         bad_code_string)
      ? passcount++
      : failcount++;
  printf("\nSummary of unit tests:\n%d tests passed\n%d tests failed\n\n",
         passcount, failcount);
  return failcount;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe53(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x1224(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0x1222(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0x121c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x121a(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xe2e(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe2b(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1090 <get_pointer_at_position@plt>
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     123a <test+0xaa>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1243 <test+0xb3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1090 <get_pointer_at_position@plt>
mov    -0x10(%rbp),%rcx
add    $0x4,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     128a <test+0xfa>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <test+0x103>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
call   1090 <get_pointer_at_position@plt>
mov    -0x10(%rbp),%rcx
add    $0xc,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xde9(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     12da <test+0x14a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12e3 <test+0x153>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1090 <get_pointer_at_position@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1323 <test+0x193>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    132c <test+0x19c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x2,%esi
mov    $0xffffffff,%edx
mov    $0x3,%ecx
call   10b0 <convert_and_sum@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdb0(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1383 <test+0x1f3>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    138c <test+0x1fc>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd7e(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     13d0 <test+0x240>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    13d9 <test+0x249>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <same_array@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1425 <test+0x295>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    142e <test+0x29e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
add    $0x4,%rsi
call   1030 <same_array@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1470 <test+0x2e0>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1479 <test+0x2e9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <same_array@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     14b7 <test+0x327>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    14c0 <test+0x330>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <same_array@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd14(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     14fe <test+0x36e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1507 <test+0x377>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <bool_flip_flop@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd17(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     154d <test+0x3bd>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1556 <test+0x3c6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   10a0 <bool_flip_flop@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd03(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     158e <test+0x3fe>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1597 <test+0x407>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   10a0 <bool_flip_flop@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xcf0(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     15cf <test+0x43f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    15d8 <test+0x448>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   10a0 <bool_flip_flop@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xcdc(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1610 <test+0x480>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1619 <test+0x489>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xcdb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <fix_bad_code@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xcf0(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     1661 <test+0x4d1>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    166a <test+0x4da>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    -0x30(%rbp),%rdx
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1080 <assert@plt>
cmp    $0x0,%rax
je     16ad <test+0x51d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    16b6 <test+0x526>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xcdd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    0x121c(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0x1209(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0x1212(%rip),%eax
mov    %eax,0x30(%rsp)
mov    0x11ff(%rip),%rax
mov    %rax,0x28(%rsp)
movabs $0x65646f63646162,%rax
mov    %rax,0x20(%rsp)
movabs $0x5a646f63646162,%rax
mov    %rax,0x18(%rsp)
lea    0x10b8(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf5(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <get_pointer_at_position@plt>
xor    %edi,%edi
cmp    %r14,%rax
sete   %dil
lea    0xde9(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r15d,%r15d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r15b
sete   %bpl
mov    %r14,%rdi
mov    $0x4,%esi
call   10a0 <get_pointer_at_position@plt>
lea    0xdb4(%rip),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
lea    0xdde(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
mov    $0x2,%ebx
sub    %ebp,%ebx
lea    0x1(%rbp),%r13d
test   %rax,%rax
cmovne %ebp,%r13d
cmove  %r15d,%ebx
mov    %r14,%rdi
mov    $0xc,%esi
call   10a0 <get_pointer_at_position@plt>
lea    0xd7b(%rip),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
lea    0xdbc(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r12b
sete   %bpl
add    %r13d,%ebp
add    %ebx,%r12d
mov    %r14,%rdi
mov    $0xd,%esi
call   10a0 <get_pointer_at_position@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xda5(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r15d,%r15d
xor    %ebx,%ebx
test   %rax,%rax
setne  %r15b
sete   %bl
add    %ebp,%ebx
add    %r12d,%r15d
lea    0xff0(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0xffffffff,%edx
mov    $0x3,%ecx
call   10c0 <convert_and_sum@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xd68(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r12b
sete   %bpl
add    %ebx,%ebp
add    %r15d,%r12d
lea    0x28(%rsp),%rsi
mov    %r14,%rdi
mov    $0xc,%edx
call   1070 <memcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xd45(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r15d,%r15d
xor    %ebx,%ebx
test   %rax,%rax
setne  %r15b
sete   %bl
add    %ebp,%ebx
add    %r12d,%r15d
lea    0xf95(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %r14,%rsi
call   1030 <same_array@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xd20(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r12b
sete   %bpl
add    %ebx,%ebp
add    %r15d,%r12d
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1030 <same_array@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xd0c(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r15d,%r15d
xor    %ebx,%ebx
test   %rax,%rax
setne  %r15b
sete   %bl
add    %ebp,%ebx
add    %r12d,%r15d
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <same_array@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xd09(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r12b
sete   %bpl
add    %ebx,%ebp
add    %r15d,%r12d
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <same_array@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xcef(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r14d,%r14d
xor    %r15d,%r15d
test   %rax,%rax
setne  %r14b
sete   %r15b
add    %ebp,%r15d
add    %r12d,%r14d
lea    0xee5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <bool_flip_flop@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xcc9(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebx,%ebx
test   %rax,%rax
setne  %r12b
sete   %bl
add    %r15d,%ebx
add    %r14d,%r12d
xor    %eax,%eax
call   10b0 <bool_flip_flop@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xcc4(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r14d,%r14d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r14b
sete   %bpl
add    %ebx,%ebp
add    %r12d,%r14d
xor    %eax,%eax
call   10b0 <bool_flip_flop@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xcbf(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebx,%ebx
test   %rax,%rax
setne  %r12b
sete   %bl
add    %ebp,%ebx
add    %r14d,%r12d
xor    %eax,%eax
call   10b0 <bool_flip_flop@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xcbb(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r15d,%r15d
xor    %r13d,%r13d
test   %rax,%rax
setne  %r15b
sete   %r13b
add    %ebx,%r13d
add    %r12d,%r15d
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1050 <fix_bad_code@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xca2(%rip),%rsi
xor    %eax,%eax
call   1090 <assert@plt>
xor    %r12d,%r12d
xor    %ebp,%ebp
test   %rax,%rax
setne  %r12b
sete   %bpl
add    %r13d,%ebp
add    %r15d,%r12d
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xc92(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <assert@plt>
xor    %esi,%esi
xor    %ebx,%ebx
test   %rax,%rax
setne  %sil
sete   %bl
add    %ebp,%ebx
add    %r12d,%esi
lea    0xcb2(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"findfinstring\00"
@__const.test.xvalues1 = [3 x i32] [i32 0, i32 5, i32 2]
@__const.test.yvalues1 = [3 x i32] [i32 -1, i32 9, i32 3]
@__const.test.bad_code_string = [8 x i8] c"badcode\00"
@__const.test.updated_bad_code_string = [8 x i8] c"badcodZ\00"
@.str.1 = [55 x i8] c"\0ATests for get_pointer_at_position...................\0A\00"
@.str.2 = [48 x i8] c"Expected pointer to the beginning of the string\00"
@.str.3 = [31 x i8] c"Expected pointer at position 4\00"
@.str.4 = [35 x i8] c"Expected pointer to last character\00"
@.str.5 = [22 x i8] c"Expected NULL pointer\00"
@.str.6 = [55 x i8] c"\0ATests for convert_and_sum...........................\0A\00"
@.str.7 = [27 x i8] c"Sum of y values must be 11\00"
@.str.8 = [29 x i8] c"Must match expected y values\00"
@.str.9 = [55 x i8] c"\0ATests for same_array................................\0A\00"
@.str.10 = [36 x i8] c"Expect 1 since it is the same array\00"
@.str.11 = [49 x i8] c"Expect 0 since a different position in the array\00"
@.str.12 = [27 x i8] c"Expect 0 since one is NULL\00"
@.str.13 = [27 x i8] c"Expect 0 since 2nd is NULL\00"
@.str.14 = [55 x i8] c"\0ATests for bool_flip_flop............................\0A\00"
@.str.15 = [45 x i8] c"Expect 1 this is the first time it is called\00"
@.str.16 = [46 x i8] c"Expect 0 this is the second time it is called\00"
@.str.17 = [45 x i8] c"Expect 1 this is the third time it is called\00"
@.str.18 = [46 x i8] c"Expect 0 this is the fourth time it is called\00"
@.str.19 = [55 x i8] c"\0ATests for fix_bad_code..............................\0A\00"
@.str.20 = [42 x i8] c"Expect 1 since it is not any empty string\00"
@.str.21 = [68 x i8] c"Expect Z in last position of bad_code_string but got this string %s\00"
@.str.22 = [58 x i8] c"\0ASummary of unit tests:\0A%d tests passed\0A%d tests failed\0A\0A\00"
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = alloca [8 x i8]
%7 = alloca [8 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
%8 = bitcast [3 x i32]* %4 to i8*
%9 = bitcast [3 x i32]* %5 to i8*
%10 = bitcast [8 x i8]* %6 to i8*
%11 = bitcast [8 x i8]* %7 to i8*
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %3
%14 = call i8* @get_pointer_at_position(i8* %13, i32 0)
%15 = load i8*, i8** %3
%16 = icmp eq i8* %14, %15
%17 = zext i1 %16 to i32
%18 = call i64 (i32, i8*, ...) @assert(i32 %17, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %0
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
br label %26
23: ; preds = %0
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %20
%27 = phi i32 [ %21, %20 ], [ %24, %23 ]
%28 = load i8*, i8** %3
%29 = call i8* @get_pointer_at_position(i8* %28, i32 4)
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 4
%32 = icmp eq i8* %29, %31
%33 = zext i1 %32 to i32
%34 = call i64 (i32, i8*, ...) @assert(i32 %33, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %26
%37 = load i32, i32* %1
%38 = add nsw i32 %37, 1
store i32 %38, i32* %1
br label %42
39: ; preds = %26
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %42
42: ; preds = %39, %36
%43 = phi i32 [ %37, %36 ], [ %40, %39 ]
%44 = load i8*, i8** %3
%45 = call i8* @get_pointer_at_position(i8* %44, i32 12)
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 12
%48 = icmp eq i8* %45, %47
%49 = zext i1 %48 to i32
%50 = call i64 (i32, i8*, ...) @assert(i32 %49, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %42
%53 = load i32, i32* %1
%54 = add nsw i32 %53, 1
store i32 %54, i32* %1
br label %58
55: ; preds = %42
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %58
58: ; preds = %55, %52
%59 = phi i32 [ %53, %52 ], [ %56, %55 ]
%60 = load i8*, i8** %3
%61 = call i8* @get_pointer_at_position(i8* %60, i32 13)
%62 = icmp eq i8* %61, null
%63 = zext i1 %62 to i32
%64 = call i64 (i32, i8*, ...) @assert(i32 %63, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %58
%67 = load i32, i32* %1
%68 = add nsw i32 %67, 1
store i32 %68, i32* %1
br label %72
69: ; preds = %58
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
store i32 %71, i32* %2
br label %72
72: ; preds = %69, %66
%73 = phi i32 [ %67, %66 ], [ %70, %69 ]
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%75 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%76 = call i32 @convert_and_sum(i32* %75, i32 2, i32 -1, i32 3)
%77 = icmp eq i32 %76, 11
%78 = zext i1 %77 to i32
%79 = call i64 (i32, i8*, ...) @assert(i32 %78, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %72
%82 = load i32, i32* %1
%83 = add nsw i32 %82, 1
store i32 %83, i32* %1
br label %87
84: ; preds = %72
%85 = load i32, i32* %2
%86 = add nsw i32 %85, 1
store i32 %86, i32* %2
br label %87
87: ; preds = %84, %81
%88 = phi i32 [ %82, %81 ], [ %85, %84 ]
%89 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%90 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%91 = call i64 @memcmp(i32* %89, i32* %90, i32 12)
%92 = icmp eq i64 %91, 0
%93 = zext i1 %92 to i32
%94 = call i64 (i32, i8*, ...) @assert(i32 %93, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %87
%97 = load i32, i32* %1
%98 = add nsw i32 %97, 1
store i32 %98, i32* %1
br label %102
99: ; preds = %87
%100 = load i32, i32* %2
%101 = add nsw i32 %100, 1
store i32 %101, i32* %2
br label %102
102: ; preds = %99, %96
%103 = phi i32 [ %97, %96 ], [ %100, %99 ]
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%105 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%106 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%107 = call i32 @same_array(i32* %105, i32* %106)
%108 = icmp eq i32 %107, 1
%109 = zext i1 %108 to i32
%110 = call i64 (i32, i8*, ...) @assert(i32 %109, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %102
%113 = load i32, i32* %1
%114 = add nsw i32 %113, 1
store i32 %114, i32* %1
br label %118
115: ; preds = %102
%116 = load i32, i32* %2
%117 = add nsw i32 %116, 1
store i32 %117, i32* %2
br label %118
118: ; preds = %115, %112
%119 = phi i32 [ %113, %112 ], [ %116, %115 ]
%120 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%121 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%122 = call i32 @same_array(i32* %120, i32* %121)
%123 = icmp eq i32 %122, 0
%124 = zext i1 %123 to i32
%125 = call i64 (i32, i8*, ...) @assert(i32 %124, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%126 = icmp ne i64 %125, 0
br i1 %126, label %127, label %130
127: ; preds = %118
%128 = load i32, i32* %1
%129 = add nsw i32 %128, 1
store i32 %129, i32* %1
br label %133
130: ; preds = %118
%131 = load i32, i32* %2
%132 = add nsw i32 %131, 1
store i32 %132, i32* %2
br label %133
133: ; preds = %130, %127
%134 = phi i32 [ %128, %127 ], [ %131, %130 ]
%135 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%136 = call i32 @same_array(i32* null, i32* %135)
%137 = icmp eq i32 %136, 0
%138 = zext i1 %137 to i32
%139 = call i64 (i32, i8*, ...) @assert(i32 %138, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%140 = icmp ne i64 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %133
%142 = load i32, i32* %1
%143 = add nsw i32 %142, 1
store i32 %143, i32* %1
br label %147
144: ; preds = %133
%145 = load i32, i32* %2
%146 = add nsw i32 %145, 1
store i32 %146, i32* %2
br label %147
147: ; preds = %144, %141
%148 = phi i32 [ %142, %141 ], [ %145, %144 ]
%149 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%150 = call i32 @same_array(i32* %149, i32* null)
%151 = icmp eq i32 %150, 0
%152 = zext i1 %151 to i32
%153 = call i64 (i32, i8*, ...) @assert(i32 %152, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%154 = icmp ne i64 %153, 0
br i1 %154, label %155, label %158
155: ; preds = %147
%156 = load i32, i32* %1
%157 = add nsw i32 %156, 1
store i32 %157, i32* %1
br label %161
158: ; preds = %147
%159 = load i32, i32* %2
%160 = add nsw i32 %159, 1
store i32 %160, i32* %2
br label %161
161: ; preds = %158, %155
%162 = phi i32 [ %156, %155 ], [ %159, %158 ]
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%164 = call i32 (...) @bool_flip_flop()
%165 = icmp eq i32 %164, 1
%166 = zext i1 %165 to i32
%167 = call i64 (i32, i8*, ...) @assert(i32 %166, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%168 = icmp ne i64 %167, 0
br i1 %168, label %169, label %172
169: ; preds = %161
%170 = load i32, i32* %1
%171 = add nsw i32 %170, 1
store i32 %171, i32* %1
br label %175
172: ; preds = %161
%173 = load i32, i32* %2
%174 = add nsw i32 %173, 1
store i32 %174, i32* %2
br label %175
175: ; preds = %172, %169
%176 = phi i32 [ %170, %169 ], [ %173, %172 ]
%177 = call i32 (...) @bool_flip_flop()
%178 = icmp eq i32 %177, 0
%179 = zext i1 %178 to i32
%180 = call i64 (i32, i8*, ...) @assert(i32 %179, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0))
%181 = icmp ne i64 %180, 0
br i1 %181, label %182, label %185
182: ; preds = %175
%183 = load i32, i32* %1
%184 = add nsw i32 %183, 1
store i32 %184, i32* %1
br label %188
185: ; preds = %175
%186 = load i32, i32* %2
%187 = add nsw i32 %186, 1
store i32 %187, i32* %2
br label %188
188: ; preds = %185, %182
%189 = phi i32 [ %183, %182 ], [ %186, %185 ]
%190 = call i32 (...) @bool_flip_flop()
%191 = icmp eq i32 %190, 1
%192 = zext i1 %191 to i32
%193 = call i64 (i32, i8*, ...) @assert(i32 %192, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0))
%194 = icmp ne i64 %193, 0
br i1 %194, label %195, label %198
195: ; preds = %188
%196 = load i32, i32* %1
%197 = add nsw i32 %196, 1
store i32 %197, i32* %1
br label %201
198: ; preds = %188
%199 = load i32, i32* %2
%200 = add nsw i32 %199, 1
store i32 %200, i32* %2
br label %201
201: ; preds = %198, %195
%202 = phi i32 [ %196, %195 ], [ %199, %198 ]
%203 = call i32 (...) @bool_flip_flop()
%204 = icmp eq i32 %203, 0
%205 = zext i1 %204 to i32
%206 = call i64 (i32, i8*, ...) @assert(i32 %205, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0))
%207 = icmp ne i64 %206, 0
br i1 %207, label %208, label %211
208: ; preds = %201
%209 = load i32, i32* %1
%210 = add nsw i32 %209, 1
store i32 %210, i32* %1
br label %214
211: ; preds = %201
%212 = load i32, i32* %2
%213 = add nsw i32 %212, 1
store i32 %213, i32* %2
br label %214
214: ; preds = %211, %208
%215 = phi i32 [ %209, %208 ], [ %212, %211 ]
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.19, i64 0, i64 0))
%217 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%218 = call i32 @fix_bad_code(i8* %217)
%219 = icmp eq i32 %218, 1
%220 = zext i1 %219 to i32
%221 = call i64 (i32, i8*, ...) @assert(i32 %220, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.20, i64 0, i64 0))
%222 = icmp ne i64 %221, 0
br i1 %222, label %223, label %226
223: ; preds = %214
%224 = load i32, i32* %1
%225 = add nsw i32 %224, 1
store i32 %225, i32* %1
br label %229
226: ; preds = %214
%227 = load i32, i32* %2
%228 = add nsw i32 %227, 1
store i32 %228, i32* %2
br label %229
229: ; preds = %226, %223
%230 = phi i32 [ %224, %223 ], [ %227, %226 ]
%231 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%232 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%233 = call i64 @strcmp(i8* %231, i8* %232)
%234 = icmp eq i64 %233, 0
%235 = zext i1 %234 to i32
%236 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%237 = call i64 (i32, i8*, ...) @assert(i32 %235, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.21, i64 0, i64 0), i8* %236)
%238 = icmp ne i64 %237, 0
br i1 %238, label %239, label %242
239: ; preds = %229
%240 = load i32, i32* %1
%241 = add nsw i32 %240, 1
store i32 %241, i32* %1
br label %245
242: ; preds = %229
%243 = load i32, i32* %2
%244 = add nsw i32 %243, 1
store i32 %244, i32* %2
br label %245
245: ; preds = %242, %239
%246 = phi i32 [ %240, %239 ], [ %243, %242 ]
%247 = load i32, i32* %1
%248 = load i32, i32* %2
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.22, i64 0, i64 0), i32 %247, i32 %248)
%250 = load i32, i32* %2
ret i32 %250
}

LLVM IR (-O2):
@.str = [14 x i8] c"findfinstring\00"
@__const.test.xvalues1 = [3 x i32] [i32 0, i32 5, i32 2]
@__const.test.yvalues1 = [3 x i32] [i32 -1, i32 9, i32 3]
@.str.2 = [48 x i8] c"Expected pointer to the beginning of the string\00"
@.str.3 = [31 x i8] c"Expected pointer at position 4\00"
@.str.4 = [35 x i8] c"Expected pointer to last character\00"
@.str.5 = [22 x i8] c"Expected NULL pointer\00"
@.str.7 = [27 x i8] c"Sum of y values must be 11\00"
@.str.8 = [29 x i8] c"Must match expected y values\00"
@.str.10 = [36 x i8] c"Expect 1 since it is the same array\00"
@.str.11 = [49 x i8] c"Expect 0 since a different position in the array\00"
@.str.12 = [27 x i8] c"Expect 0 since one is NULL\00"
@.str.13 = [27 x i8] c"Expect 0 since 2nd is NULL\00"
@.str.15 = [45 x i8] c"Expect 1 this is the first time it is called\00"
@.str.16 = [46 x i8] c"Expect 0 this is the second time it is called\00"
@.str.17 = [45 x i8] c"Expect 1 this is the third time it is called\00"
@.str.18 = [46 x i8] c"Expect 0 this is the fourth time it is called\00"
@.str.20 = [42 x i8] c"Expect 1 since it is not any empty string\00"
@.str.21 = [68 x i8] c"Expect Z in last position of bad_code_string but got this string %s\00"
@.str.22 = [58 x i8] c"\0ASummary of unit tests:\0A%d tests passed\0A%d tests failed\0A\0A\00"
@str = [54 x i8] c"\0ATests for get_pointer_at_position...................\00"
@str.23 = [54 x i8] c"\0ATests for convert_and_sum...........................\00"
@str.24 = [54 x i8] c"\0ATests for same_array................................\00"
@str.25 = [54 x i8] c"\0ATests for bool_flip_flop............................\00"
@str.26 = [54 x i8] c"\0ATests for fix_bad_code..............................\00"
define i32 @test() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca i64
%4 = alloca i64
%5 = bitcast [3 x i32]* %1 to i8*
%6 = bitcast [3 x i32]* %2 to i8*
%7 = bitcast i64* %3 to i8*
store i64 28539402219446626, i64* %3
%8 = bitcast i64* %4 to i8*
store i64 25443177475629410, i64* %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%10 = tail call i8* @get_pointer_at_position(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%11 = icmp eq i8* %10, getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%12 = zext i1 %11 to i32
%13 = tail call i64 (i32, i8*, ...) @assert(i32 %12, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = xor i1 %14, true
%17 = zext i1 %16 to i32
%18 = tail call i8* @get_pointer_at_position(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
%19 = icmp eq i8* %18, getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 4)
%20 = zext i1 %19 to i32
%21 = tail call i64 (i32, i8*, ...) @assert(i32 %20, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = select i1 %14, i32 1, i32 2
%24 = select i1 %14, i32 2, i32 1
%25 = select i1 %22, i32 %24, i32 %15
%26 = select i1 %22, i32 %17, i32 %23
%27 = tail call i8* @get_pointer_at_position(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 12)
%28 = icmp eq i8* %27, getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 12)
%29 = zext i1 %28 to i32
%30 = tail call i64 (i32, i8*, ...) @assert(i32 %29, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
%32 = zext i1 %31 to i32
%33 = add nuw nsw i32 %25, %32
%34 = xor i1 %31, true
%35 = zext i1 %34 to i32
%36 = add nuw nsw i32 %26, %35
%37 = tail call i8* @get_pointer_at_position(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%38 = icmp eq i8* %37, null
%39 = zext i1 %38 to i32
%40 = tail call i64 (i32, i8*, ...) @assert(i32 %39, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
%42 = zext i1 %41 to i32
%43 = add nuw nsw i32 %33, %42
%44 = xor i1 %41, true
%45 = zext i1 %44 to i32
%46 = add nuw nsw i32 %36, %45
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.23, i64 0, i64 0))
%48 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%49 = call i32 @convert_and_sum(i32* %48, i32 2, i32 -1, i32 3)
%50 = icmp eq i32 %49, 11
%51 = zext i1 %50 to i32
%52 = call i64 (i32, i8*, ...) @assert(i32 %51, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
%54 = zext i1 %53 to i32
%55 = add nuw nsw i32 %43, %54
%56 = xor i1 %53, true
%57 = zext i1 %56 to i32
%58 = add nuw nsw i32 %46, %57
%59 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%60 = call i64 @memcmp(i32* %48, i32* %59, i32 12)
%61 = icmp eq i64 %60, 0
%62 = zext i1 %61 to i32
%63 = call i64 (i32, i8*, ...) @assert(i32 %62, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
%65 = zext i1 %64 to i32
%66 = add nuw nsw i32 %55, %65
%67 = xor i1 %64, true
%68 = zext i1 %67 to i32
%69 = add nuw nsw i32 %58, %68
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.24, i64 0, i64 0))
%71 = call i32 @same_array(i32* %48, i32* %48)
%72 = icmp eq i32 %71, 1
%73 = zext i1 %72 to i32
%74 = call i64 (i32, i8*, ...) @assert(i32 %73, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
%76 = zext i1 %75 to i32
%77 = add nuw nsw i32 %66, %76
%78 = xor i1 %75, true
%79 = zext i1 %78 to i32
%80 = add nuw nsw i32 %69, %79
%81 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%82 = call i32 @same_array(i32* %48, i32* %81)
%83 = icmp eq i32 %82, 0
%84 = zext i1 %83 to i32
%85 = call i64 (i32, i8*, ...) @assert(i32 %84, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
%87 = zext i1 %86 to i32
%88 = add nuw nsw i32 %77, %87
%89 = xor i1 %86, true
%90 = zext i1 %89 to i32
%91 = add nuw nsw i32 %80, %90
%92 = call i32 @same_array(i32* null, i32* %48)
%93 = icmp eq i32 %92, 0
%94 = zext i1 %93 to i32
%95 = call i64 (i32, i8*, ...) @assert(i32 %94, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
%97 = zext i1 %96 to i32
%98 = add nuw nsw i32 %88, %97
%99 = xor i1 %96, true
%100 = zext i1 %99 to i32
%101 = add nuw nsw i32 %91, %100
%102 = call i32 @same_array(i32* %48, i32* null)
%103 = icmp eq i32 %102, 0
%104 = zext i1 %103 to i32
%105 = call i64 (i32, i8*, ...) @assert(i32 %104, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
%107 = zext i1 %106 to i32
%108 = add nuw nsw i32 %98, %107
%109 = xor i1 %106, true
%110 = zext i1 %109 to i32
%111 = add nuw nsw i32 %101, %110
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.25, i64 0, i64 0))
%113 = call i32 (...) @bool_flip_flop()
%114 = icmp eq i32 %113, 1
%115 = zext i1 %114 to i32
%116 = call i64 (i32, i8*, ...) @assert(i32 %115, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.15, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
%118 = zext i1 %117 to i32
%119 = add nuw nsw i32 %108, %118
%120 = xor i1 %117, true
%121 = zext i1 %120 to i32
%122 = add nuw nsw i32 %111, %121
%123 = call i32 (...) @bool_flip_flop()
%124 = icmp eq i32 %123, 0
%125 = zext i1 %124 to i32
%126 = call i64 (i32, i8*, ...) @assert(i32 %125, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0))
%127 = icmp eq i64 %126, 0
%128 = zext i1 %127 to i32
%129 = add nuw nsw i32 %119, %128
%130 = xor i1 %127, true
%131 = zext i1 %130 to i32
%132 = add nuw nsw i32 %122, %131
%133 = call i32 (...) @bool_flip_flop()
%134 = icmp eq i32 %133, 1
%135 = zext i1 %134 to i32
%136 = call i64 (i32, i8*, ...) @assert(i32 %135, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0))
%137 = icmp eq i64 %136, 0
%138 = zext i1 %137 to i32
%139 = add nuw nsw i32 %129, %138
%140 = xor i1 %137, true
%141 = zext i1 %140 to i32
%142 = add nuw nsw i32 %132, %141
%143 = call i32 (...) @bool_flip_flop()
%144 = icmp eq i32 %143, 0
%145 = zext i1 %144 to i32
%146 = call i64 (i32, i8*, ...) @assert(i32 %145, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
%148 = zext i1 %147 to i32
%149 = add nuw nsw i32 %139, %148
%150 = xor i1 %147, true
%151 = zext i1 %150 to i32
%152 = add nuw nsw i32 %142, %151
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.26, i64 0, i64 0))
%154 = call i32 @fix_bad_code(i8* %7)
%155 = icmp eq i32 %154, 1
%156 = zext i1 %155 to i32
%157 = call i64 (i32, i8*, ...) @assert(i32 %156, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.20, i64 0, i64 0))
%158 = icmp eq i64 %157, 0
%159 = zext i1 %158 to i32
%160 = add nuw nsw i32 %149, %159
%161 = xor i1 %158, true
%162 = zext i1 %161 to i32
%163 = add nuw nsw i32 %152, %162
%164 = call i64 @strcmp(i8* %7, i8* %8)
%165 = icmp eq i64 %164, 0
%166 = zext i1 %165 to i32
%167 = call i64 (i32, i8*, ...) @assert(i32 %166, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.21, i64 0, i64 0), i64* %3)
%168 = icmp eq i64 %167, 0
%169 = zext i1 %168 to i32
%170 = add nuw nsw i32 %160, %169
%171 = xor i1 %168, true
%172 = zext i1 %171 to i32
%173 = add nuw nsw i32 %163, %172
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.22, i64 0, i64 0), i32 %173, i32 %170)
ret i32 %170
}