#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 */
struct timeval {
  int dummy;
};

/* Variables and functions */
int char_to_val(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ show_performance(struct timeval *, struct timeval *, int);
int /*<<< orphan*/ str_to_char(char *, unsigned char *, int);
char *strstr(char *, char *);
int s_record_to_bin(char *file_buffer, unsigned char *flash_buffer,
                    int file_size, int flash_size) {
  unsigned char *flash = flash_buffer;
  char *sline = file_buffer;
  struct timeval start, end;
  int left_to_convert = file_size;
  int bin_size = 0;
  int newline = 0;
  char *is_dos;
  is_dos = strstr(sline + 2, "S") - 2;
  if (*is_dos == 0x0d)
    newline = 2;
  else
    newline = 1;
  printf("Convert %u bytes of S-record data to binary flash format\n",
         file_size);
  gettimeofday(&start, NULL);
  while (left_to_convert) {
    unsigned short stype = (sline[0] << 8) | sline[1];
    unsigned char num_of_char = 2 + char_to_val(&sline[2]);
    int sline_length = 2 * num_of_char + newline;
    int payload_size;
    char *next = sline + sline_length;
    char *data;
    unsigned int offset;
    switch (stype) {
    case 0x5330:
      data = sline + 8;
      payload_size = sline_length - 11;
      goto next_line;
    case 0x5333:
      data = sline + 12;
      payload_size = sline_length - 14 - newline;
      offset = (char_to_val(sline + 4) << 24 | char_to_val(sline + 6) << 16 |
                char_to_val(sline + 8) << 8 | char_to_val(sline + 10));
      break;
    default:
      printf("%c%c line is not supported\n", char_to_val(&sline[0]),
             char_to_val(&sline[2]));
      return -1;
    }
    if (offset + payload_size > flash_size) {
      printf("S-record try to write outside flash area!\n");
      return -1;
    }
    str_to_char(data, &flash[offset], payload_size);
  next_line:
    bin_size += payload_size / 2;
    sline = next;
    left_to_convert -= sline_length;
  }
  gettimeofday(&end, NULL);
  show_performance(&start, &end, file_size);
  return bin_size;
}


x86 assembly (clang, -O0):
<s_record_to_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x2,%rdi
lea    0xe54(%rip),%rsi
call   1080 <strstr@plt>
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    11d5 <s_record_to_bin+0x75>
movl   $0x2,-0x4c(%rbp)
jmp    11dc <s_record_to_bin+0x7c>
movl   $0x1,-0x4c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
cmpl   $0x0,-0x44(%rbp)
je     13c1 <s_record_to_bin+0x261>
mov    -0x30(%rbp),%rcx
movzbl (%rcx),%eax
shl    $0x8,%eax
movsbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %ax,-0x5a(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x2,%rdi
call   1030 <char_to_val@plt>
add    $0x2,%al
mov    %al,-0x5b(%rbp)
movzbl -0x5b(%rbp),%eax
mov    -0x4c(%rbp),%edx
mov    %eax,%ecx
mov    %edx,%eax
lea    (%rax,%rcx,2),%eax
mov    %eax,-0x60(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x60(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
movzwl -0x5a(%rbp),%eax
mov    %eax,-0x80(%rbp)
sub    $0x5330,%eax
je     1274 <s_record_to_bin+0x114>
jmp    1261 <s_record_to_bin+0x101>
mov    -0x80(%rbp),%eax
sub    $0x5333,%eax
je     128e <s_record_to_bin+0x12e>
jmp    131b <s_record_to_bin+0x1bb>
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x78(%rbp)
mov    -0x60(%rbp),%eax
sub    $0xb,%eax
mov    %eax,-0x64(%rbp)
jmp    1398 <s_record_to_bin+0x238>
mov    -0x30(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x78(%rbp)
mov    -0x60(%rbp),%eax
sub    $0xe,%eax
sub    -0x4c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x4,%rdi
call   1030 <char_to_val@plt>
shl    $0x18,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x6,%rdi
call   1030 <char_to_val@plt>
mov    %eax,%ecx
mov    -0x8c(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x88(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x8,%rdi
call   1030 <char_to_val@plt>
mov    %eax,%ecx
mov    -0x88(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x84(%rbp)
mov    -0x30(%rbp),%rdi
add    $0xa,%rdi
call   1030 <char_to_val@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x7c(%rbp)
jmp    1359 <s_record_to_bin+0x1f9>
mov    -0x30(%rbp),%rdi
call   1030 <char_to_val@plt>
mov    %eax,-0x90(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x2,%rdi
call   1030 <char_to_val@plt>
mov    -0x90(%rbp),%esi
mov    %eax,%edx
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e4 <s_record_to_bin+0x284>
mov    -0x7c(%rbp),%eax
add    -0x64(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    1382 <s_record_to_bin+0x222>
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e4 <s_record_to_bin+0x284>
mov    -0x78(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x7c(%rbp),%eax
add    %rax,%rsi
mov    -0x64(%rbp),%edx
call   1060 <str_to_char@plt>
mov    -0x64(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x60(%rbp),%ecx
mov    -0x44(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x44(%rbp)
jmp    11fa <s_record_to_bin+0x9a>
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x1c(%rbp),%edx
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <show_performance@plt>
mov    -0x48(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_record_to_bin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,0xc(%rsp)
mov    %edx,%ebp
mov    %rsi,0x20(%rsp)
mov    %rdi,%r12
add    $0x2,%rdi
mov    $0x53,%esi
call   1050 <strchr@plt>
mov    -0x2(%rax),%r15b
cmp    $0xd,%r15b
sete   %r14b
lea    0xe53(%rip),%rdi
xor    %ebx,%ebx
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
mov    %ebp,0x4(%rsp)
test   %ebp,%ebp
je     12e7 <s_record_to_bin+0x177>
xor    %eax,%eax
mov    %r14b,%al
add    $0x1,%eax
mov    %eax,0x14(%rsp)
xor    %eax,%eax
cmp    $0xd,%r15b
sete   %al
xor    $0xfffffff1,%eax
mov    %rax,0x18(%rsp)
xor    %ebx,%ebx
mov    0x4(%rsp),%r15d
jmp    121c <s_record_to_bin+0xac>
cs nopw 0x0(%rax,%rax,1)
add    %r13,%r12
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
mov    0x28(%rsp),%rbx
add    %eax,%ebx
sub    %r13d,%r15d
je     12e7 <s_record_to_bin+0x177>
movzbl (%r12),%eax
shl    $0x8,%eax
movsbl 0x1(%r12),%ebp
or     %eax,%ebp
lea    0x2(%r12),%r14
mov    %r14,%rdi
call   1030 <char_to_val@plt>
lea    (%rax,%rax,1),%r13d
add    $0x4,%r13d
and    $0x1fe,%r13d
add    0x14(%rsp),%r13d
movzwl %bp,%eax
cmp    $0x5333,%eax
mov    %rbx,0x28(%rsp)
je     1270 <s_record_to_bin+0x100>
cmp    $0x5330,%eax
jne    1309 <s_record_to_bin+0x199>
lea    -0xb(%r13),%ebx
jmp    1200 <s_record_to_bin+0x90>
nopl   (%rax)
mov    %r15d,0x10(%rsp)
mov    0x18(%rsp),%rax
lea    (%rax,%r13,1),%ebx
lea    0x4(%r12),%rdi
call   1030 <char_to_val@plt>
mov    %eax,%r14d
shl    $0x18,%r14d
lea    0x6(%r12),%rdi
call   1030 <char_to_val@plt>
mov    %eax,%r15d
shl    $0x10,%r15d
or     %r14d,%r15d
lea    0x8(%r12),%rdi
call   1030 <char_to_val@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
lea    0xa(%r12),%rdi
call   1030 <char_to_val@plt>
or     %ebp,%eax
or     %r15d,%eax
lea    (%rax,%rbx,1),%ecx
cmp    0xc(%rsp),%ecx
ja     132f <s_record_to_bin+0x1bf>
lea    0xc(%r12),%rdi
mov    %eax,%esi
add    0x20(%rsp),%rsi
mov    %ebx,%edx
call   1080 <str_to_char@plt>
mov    0x10(%rsp),%r15d
jmp    1200 <s_record_to_bin+0x90>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
lea    0x8(%rsp),%rdi
mov    %rbp,%rsi
mov    0x4(%rsp),%edx
call   1090 <show_performance@plt>
jmp    1340 <s_record_to_bin+0x1d0>
mov    %r12,%rdi
call   1030 <char_to_val@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <char_to_val@plt>
lea    0xd18(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    133b <s_record_to_bin+0x1cb>
lea    0xd20(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [2 x i8] c"S\00"
@.str.1 = [58 x i8] c"Convert %u bytes of S-record data to binary flash format\0A\00"
@.str.2 = [28 x i8] c"%c%c line is not supported\0A\00"
@.str.3 = [43 x i8] c"S-record try to write outside flash area!\0A\00"
define i32 @s_record_to_bin(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca %struct.timeval
%13 = alloca %struct.timeval
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i16
%19 = alloca i8
%20 = alloca i32
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%25 = load i8*, i8** %7
store i8* %25, i8** %10
%26 = load i8*, i8** %6
store i8* %26, i8** %11
%27 = load i32, i32* %8
store i32 %27, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
%28 = load i8*, i8** %11
%29 = getelementptr inbounds i8, i8* %28, i64 2
%30 = call i8* @strstr(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%31 = getelementptr inbounds i8, i8* %30, i64 -2
store i8* %31, i8** %17
%32 = load i8*, i8** %17
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 13
br i1 %35, label %36, label %37
36: ; preds = %4
store i32 2, i32* %16
br label %38
37: ; preds = %4
store i32 1, i32* %16
br label %38
38: ; preds = %37, %36
%39 = load i32, i32* %8
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
br label %42
42: ; preds = %127, %38
%43 = load i32, i32* %14
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %136
45: ; preds = %42
%46 = load i8*, i8** %11
%47 = getelementptr inbounds i8, i8* %46, i64 0
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = shl i32 %49, 8
%51 = load i8*, i8** %11
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = or i32 %50, %54
%56 = trunc i32 %55 to i16
store i16 %56, i16* %18
%57 = load i8*, i8** %11
%58 = getelementptr inbounds i8, i8* %57, i64 2
%59 = call i32 @char_to_val(i8* %58)
%60 = add nsw i32 2, %59
%61 = trunc i32 %60 to i8
store i8 %61, i8* %19
%62 = load i8, i8* %19
%63 = zext i8 %62 to i32
%64 = mul nsw i32 2, %63
%65 = load i32, i32* %16
%66 = add nsw i32 %64, %65
store i32 %66, i32* %20
%67 = load i8*, i8** %11
%68 = load i32, i32* %20
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %67, i64 %69
store i8* %70, i8** %22
%71 = load i16, i16* %18
%72 = zext i16 %71 to i32
switch i32 %72, label %103 [
i32 21296, label %73
i32 21299, label %78
]
73: ; preds = %45
%74 = load i8*, i8** %11
%75 = getelementptr inbounds i8, i8* %74, i64 8
store i8* %75, i8** %23
%76 = load i32, i32* %20
%77 = sub nsw i32 %76, 11
store i32 %77, i32* %21
br label %127
78: ; preds = %45
%79 = load i8*, i8** %11
%80 = getelementptr inbounds i8, i8* %79, i64 12
store i8* %80, i8** %23
%81 = load i32, i32* %20
%82 = sub nsw i32 %81, 14
%83 = load i32, i32* %16
%84 = sub nsw i32 %82, %83
store i32 %84, i32* %21
%85 = load i8*, i8** %11
%86 = getelementptr inbounds i8, i8* %85, i64 4
%87 = call i32 @char_to_val(i8* %86)
%88 = shl i32 %87, 24
%89 = load i8*, i8** %11
%90 = getelementptr inbounds i8, i8* %89, i64 6
%91 = call i32 @char_to_val(i8* %90)
%92 = shl i32 %91, 16
%93 = or i32 %88, %92
%94 = load i8*, i8** %11
%95 = getelementptr inbounds i8, i8* %94, i64 8
%96 = call i32 @char_to_val(i8* %95)
%97 = shl i32 %96, 8
%98 = or i32 %93, %97
%99 = load i8*, i8** %11
%100 = getelementptr inbounds i8, i8* %99, i64 10
%101 = call i32 @char_to_val(i8* %100)
%102 = or i32 %98, %101
store i32 %102, i32* %24
br label %111
103: ; preds = %45
%104 = load i8*, i8** %11
%105 = getelementptr inbounds i8, i8* %104, i64 0
%106 = call i32 @char_to_val(i8* %105)
%107 = load i8*, i8** %11
%108 = getelementptr inbounds i8, i8* %107, i64 2
%109 = call i32 @char_to_val(i8* %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %106, i32 %109)
store i32 -1, i32* %5
br label %141
111: ; preds = %78
%112 = load i32, i32* %24
%113 = load i32, i32* %21
%114 = add i32 %112, %113
%115 = load i32, i32* %9
%116 = icmp ugt i32 %114, %115
br i1 %116, label %117, label %119
117: ; preds = %111
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %5
br label %141
119: ; preds = %111
%120 = load i8*, i8** %23
%121 = load i8*, i8** %10
%122 = load i32, i32* %24
%123 = zext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %121, i64 %123
%125 = load i32, i32* %21
%126 = call i32 @str_to_char(i8* %120, i8* %124, i32 %125)
br label %127
127: ; preds = %119, %73
%128 = load i32, i32* %21
%129 = sdiv i32 %128, 2
%130 = load i32, i32* %15
%131 = add nsw i32 %130, %129
store i32 %131, i32* %15
%132 = load i8*, i8** %22
store i8* %132, i8** %11
%133 = load i32, i32* %20
%134 = load i32, i32* %14
%135 = sub nsw i32 %134, %133
store i32 %135, i32* %14
br label %42
136: ; preds = %42
%137 = call i32 @gettimeofday(%struct.timeval* %13, i32* null)
%138 = load i32, i32* %8
%139 = call i32 @show_performance(%struct.timeval* %12, %struct.timeval* %13, i32 %138)
%140 = load i32, i32* %15
store i32 %140, i32* %5
br label %141
141: ; preds = %136, %117, %103
%142 = load i32, i32* %5
ret i32 %142
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str.1 = [58 x i8] c"Convert %u bytes of S-record data to binary flash format\0A\00"
@.str.2 = [28 x i8] c"%c%c line is not supported\0A\00"
@str = [42 x i8] c"S-record try to write outside flash area!\00"
define i32 @s_record_to_bin(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to i8*
%8 = bitcast %struct.timeval* %6 to i8*
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i8* @strchr(i8* %9, i32 83)
%11 = getelementptr inbounds i8, i8* %10, i64 -2
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 13
%14 = select i1 %13, i32 2, i32 1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%16 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%17 = icmp eq i32 %2, 0
br i1 %17, label %76, label %18
18: ; preds = %4
%19 = select i1 %13, i32 -16, i32 -15
br label %20
20: ; preds = %18, %70
%21 = phi i8* [ %0, %18 ], [ %37, %70 ]
%22 = phi i32 [ %2, %18 ], [ %74, %70 ]
%23 = phi i32 [ 0, %18 ], [ %73, %70 ]
%24 = load i8, i8* %21
%25 = zext i8 %24 to i16
%26 = shl nuw i16 %25, 8
%27 = getelementptr inbounds i8, i8* %21, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i16
%30 = getelementptr inbounds i8, i8* %21, i64 2
%31 = tail call i32 @char_to_val(i8* %30)
%32 = shl i32 %31, 1
%33 = add i32 %32, 4
%34 = and i32 %33, 510
%35 = add nuw nsw i32 %34, %14
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %21, i64 %36
%38 = or i16 %26, %29
switch i16 %38, label %59 [
i16 21296, label %39
i16 21299, label %41
]
39: ; preds = %20
%40 = add nsw i32 %35, -11
br label %70
41: ; preds = %20
%42 = add nsw i32 %19, %35
%43 = getelementptr inbounds i8, i8* %21, i64 4
%44 = tail call i32 @char_to_val(i8* %43)
%45 = shl i32 %44, 24
%46 = getelementptr inbounds i8, i8* %21, i64 6
%47 = tail call i32 @char_to_val(i8* %46)
%48 = shl i32 %47, 16
%49 = or i32 %48, %45
%50 = getelementptr inbounds i8, i8* %21, i64 8
%51 = tail call i32 @char_to_val(i8* %50)
%52 = shl i32 %51, 8
%53 = or i32 %49, %52
%54 = getelementptr inbounds i8, i8* %21, i64 10
%55 = tail call i32 @char_to_val(i8* %54)
%56 = or i32 %53, %55
%57 = add i32 %56, %42
%58 = icmp ugt i32 %57, %3
br i1 %58, label %63, label %65
59: ; preds = %20
%60 = tail call i32 @char_to_val(i8* %21)
%61 = tail call i32 @char_to_val(i8* %30)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %60, i32 %61)
br label %80
63: ; preds = %41
%64 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
br label %80
65: ; preds = %41
%66 = getelementptr inbounds i8, i8* %21, i64 12
%67 = zext i32 %56 to i64
%68 = getelementptr inbounds i8, i8* %1, i64 %67
%69 = tail call i32 @str_to_char(i8* %66, i8* %68, i32 %42)
br label %70
70: ; preds = %39, %65
%71 = phi i32 [ %42, %65 ], [ %40, %39 ]
%72 = sdiv i32 %71, 2
%73 = add nsw i32 %72, %23
%74 = sub nsw i32 %22, %35
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %20
76: ; preds = %70, %4
%77 = phi i32 [ 0, %4 ], [ %73, %70 ]
%78 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%79 = call i32 @show_performance(%struct.timeval* %5, %struct.timeval* %6, i32 %2)
br label %80
80: ; preds = %63, %59, %76
%81 = phi i32 [ %77, %76 ], [ -1, %59 ], [ -1, %63 ]
ret i32 %81
}