#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*/ buf;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
scalar_t__ isdigit(char);
int /*<<< orphan*/ logMessage(int, char *, ...);
int open(char *, int /*<<< orphan*/);
int read(int, char *, int);
int strerror(int /*<<< orphan*/);
scalar_t__ strncmp(char *, char *, int);
int totalMemory(void) {
  int fd;
  int bytesRead;
  char buf[4096];
  char *chptr, *start;
  int total = 0;
  fd = open("/proc/meminfo", O_RDONLY);
  if (fd < 0) {
    logMessage(40, "failed to open /proc/meminfo: %s", strerror(errno));
    return 0;
  }
  bytesRead = read(fd, buf, sizeof(buf) - 1);
  if (bytesRead < 0) {
    logMessage(40, "failed to read from /proc/meminfo: %s", strerror(errno));
    close(fd);
    return 0;
  }
  close(fd);
  buf[bytesRead] = '\0';
  chptr = buf;
  while (*chptr && !total) {
    if (strncmp(chptr, "MemTotal:", 9)) {
      chptr++;
      continue;
    }
    start = ++chptr;
    while (*chptr && *chptr != '\n')
      chptr++;
    *chptr = '\0';
    while (!isdigit(*start) && *start)
      start++;
    if (!*start) {
      logMessage(30, "no number appears after MemTotal tag");
      return 0;
    }
    chptr = start;
    while (*chptr && isdigit(*chptr)) {
      total = (total * 10) + (*chptr - '0');
      chptr++;
    }
  }
  logMessage(20, "%d kB are available", total);
  return total;
}


x86 assembly (clang, -O0):
<totalMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
movl   $0x0,-0x1024(%rbp)
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
lea    0xe6b(%rip),%rdi
call   1080 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11d6 <totalMemory+0x66>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    %eax,%edx
mov    $0x28,%edi
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1030 <logMessage@plt>
movl   $0x0,-0x4(%rbp)
jmp    148c <totalMemory+0x31c>
mov    -0x8(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    $0xfff,%edx
call   1070 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    122e <totalMemory+0xbe>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    %eax,%edx
mov    $0x28,%edi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1030 <logMessage@plt>
mov    -0x8(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x4(%rbp)
jmp    148c <totalMemory+0x31c>
mov    -0x8(%rbp),%edi
call   1060 <close@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x1010(%rbp,%rax,1)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x1018(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1025(%rbp)
je     127d <totalMemory+0x10d>
cmpl   $0x0,-0x1024(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x1025(%rbp)
mov    -0x1025(%rbp),%al
test   $0x1,%al
jne    1290 <totalMemory+0x120>
jmp    146a <totalMemory+0x2fa>
mov    -0x1018(%rbp),%rdi
lea    0xdb7(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     12c9 <totalMemory+0x159>
mov    -0x1018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1018(%rbp)
jmp    1250 <totalMemory+0xe0>
mov    -0x1018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1018(%rbp)
mov    %rax,-0x1020(%rbp)
mov    -0x1018(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1026(%rbp)
je     1313 <totalMemory+0x1a3>
mov    -0x1018(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x1026(%rbp)
mov    -0x1026(%rbp),%al
test   $0x1,%al
jne    1326 <totalMemory+0x1b6>
jmp    133d <totalMemory+0x1cd>
mov    -0x1018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1018(%rbp)
jmp    12e2 <totalMemory+0x172>
mov    -0x1018(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x1020(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1027(%rbp)
jne    1381 <totalMemory+0x211>
mov    -0x1020(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1027(%rbp)
mov    -0x1027(%rbp),%al
test   $0x1,%al
jne    1394 <totalMemory+0x224>
jmp    13ab <totalMemory+0x23b>
mov    -0x1020(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1020(%rbp)
jmp    1347 <totalMemory+0x1d7>
mov    -0x1020(%rbp),%rax
cmpb   $0x0,(%rax)
jne    13da <totalMemory+0x26a>
mov    $0x1e,%edi
lea    0xc98(%rip),%rsi
mov    $0x0,%al
call   1030 <logMessage@plt>
movl   $0x0,-0x4(%rbp)
jmp    148c <totalMemory+0x31c>
mov    -0x1020(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x1018(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1028(%rbp)
je     141f <totalMemory+0x2af>
mov    -0x1018(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1028(%rbp)
mov    -0x1028(%rbp),%al
test   $0x1,%al
jne    1432 <totalMemory+0x2c2>
jmp    1465 <totalMemory+0x2f5>
imul   $0xa,-0x1024(%rbp),%eax
mov    -0x1018(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x1024(%rbp)
mov    -0x1018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1018(%rbp)
jmp    13e8 <totalMemory+0x278>
jmp    1250 <totalMemory+0xe0>
mov    -0x1024(%rbp),%edx
mov    $0x14,%edi
lea    0xc08(%rip),%rsi
mov    $0x0,%al
call   1030 <logMessage@plt>
mov    -0x1024(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<totalMemory>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    0x2e64(%rip),%rax
mov    (%rax),%esi
lea    0xe73(%rip),%rdi
call   1080 <open@plt>
test   %eax,%eax
js     129d <totalMemory+0x12d>
mov    %eax,%ebp
mov    %rsp,%rbx
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0xfff,%edx
call   1070 <read@plt>
test   %eax,%eax
js     12be <totalMemory+0x14e>
mov    %eax,%r14d
mov    %ebp,%edi
call   1060 <close@plt>
mov    %r14d,%eax
movb   $0x0,(%rsp,%rax,1)
cmpb   $0x0,(%rsp)
je     1305 <totalMemory+0x195>
lea    0xe7d(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
add    $0x1,%rbx
xor    %r15d,%r15d
mov    %rbx,%rcx
test   %rax,%rax
je     1224 <totalMemory+0xb4>
cmpb   $0x0,(%rbx)
je     1308 <totalMemory+0x198>
test   %r15d,%r15d
je     11e0 <totalMemory+0x70>
jmp    1308 <totalMemory+0x198>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
movzbl (%rcx),%eax
test   %al,%al
je     122f <totalMemory+0xbf>
cmp    $0xa,%al
jne    1220 <totalMemory+0xb0>
movb   $0x0,(%rcx)
movsbl (%rbx),%edi
cs nopw 0x0(%rax,%rax,1)
nop
call   1050 <isdigit@plt>
test   %rax,%rax
jne    1260 <totalMemory+0xf0>
cmpb   $0x0,(%rbx)
je     12ed <totalMemory+0x17d>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1240 <totalMemory+0xd0>
nopl   (%rax)
mov    (%rbx),%al
test   %al,%al
je     12ed <totalMemory+0x17d>
xor    %r15d,%r15d
nopl   (%rax)
movsbl %al,%edi
call   1050 <isdigit@plt>
test   %rax,%rax
je     11ff <totalMemory+0x8f>
lea    (%r15,%r15,4),%eax
movsbl (%rbx),%ecx
lea    (%rcx,%rax,2),%r15d
add    $0xffffffd0,%r15d
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1270 <totalMemory+0x100>
jmp    11ff <totalMemory+0x8f>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xd5c(%rip),%rsi
xor    %r15d,%r15d
mov    $0x28,%edi
mov    %eax,%edx
jmp    1317 <totalMemory+0x1a7>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xd5c(%rip),%rsi
xor    %r15d,%r15d
mov    $0x28,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <logMessage@plt>
mov    %ebp,%edi
call   1060 <close@plt>
jmp    131e <totalMemory+0x1ae>
lea    0xd6b(%rip),%rsi
xor    %r15d,%r15d
mov    $0x1e,%edi
xor    %eax,%eax
call   1030 <logMessage@plt>
jmp    131e <totalMemory+0x1ae>
xor    %r15d,%r15d
lea    0xd75(%rip),%rsi
mov    $0x14,%edi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <logMessage@plt>
mov    %r15d,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/meminfo\00"
@O_RDONLY = global i32 0
@.str.1 = [33 x i8] c"failed to open /proc/meminfo: %s\00"
@errno = global i32 0
@.str.2 = [38 x i8] c"failed to read from /proc/meminfo: %s\00"
@.str.3 = [10 x i8] c"MemTotal:\00"
@.str.4 = [37 x i8] c"no number appears after MemTotal tag\00"
@.str.5 = [20 x i8] c"%d kB are available\00"
define i32 @totalMemory() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4096 x i8]
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %7
%8 = load i32, i32* @O_RDONLY
%9 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = load i32, i32* @errno
%14 = call i32 @strerror(i32 %13)
%15 = call i32 (i32, i8*, ...) @logMessage(i32 40, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 0, i32* %1
br label %123
16: ; preds = %0
%17 = load i32, i32* %2
%18 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%19 = call i32 @read(i32 %17, i8* %18, i32 4095)
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %16
%23 = load i32, i32* @errno
%24 = call i32 @strerror(i32 %23)
%25 = call i32 (i32, i8*, ...) @logMessage(i32 40, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = call i32 @close(i32 %26)
store i32 0, i32* %1
br label %123
28: ; preds = %16
%29 = load i32, i32* %2
%30 = call i32 @close(i32 %29)
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %32
store i8 0, i8* %33
%34 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
store i8* %34, i8** %5
br label %35
35: ; preds = %118, %50, %28
%36 = load i8*, i8** %5
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %35
%41 = load i32, i32* %7
%42 = icmp ne i32 %41, 0
%43 = xor i1 %42, true
br label %44
44: ; preds = %40, %35
%45 = phi i1 [ false, %35 ], [ %43, %40 ]
br i1 %45, label %46, label %119
46: ; preds = %44
%47 = load i8*, i8** %5
%48 = call i64 @strncmp(i8* %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 9)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i8*, i8** %5
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %5
br label %35
53: ; preds = %46
%54 = load i8*, i8** %5
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %5
store i8* %55, i8** %6
br label %56
56: ; preds = %68, %53
%57 = load i8*, i8** %5
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %66
61: ; preds = %56
%62 = load i8*, i8** %5
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp ne i32 %64, 10
br label %66
66: ; preds = %61, %56
%67 = phi i1 [ false, %56 ], [ %65, %61 ]
br i1 %67, label %68, label %71
68: ; preds = %66
%69 = load i8*, i8** %5
%70 = getelementptr inbounds i8, i8* %69, i32 1
store i8* %70, i8** %5
br label %56
71: ; preds = %66
%72 = load i8*, i8** %5
store i8 0, i8* %72
br label %73
73: ; preds = %85, %71
%74 = load i8*, i8** %6
%75 = load i8, i8* %74
%76 = call i64 @isdigit(i8 signext %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %83, label %78
78: ; preds = %73
%79 = load i8*, i8** %6
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp ne i32 %81, 0
br label %83
83: ; preds = %78, %73
%84 = phi i1 [ false, %73 ], [ %82, %78 ]
br i1 %84, label %85, label %88
85: ; preds = %83
%86 = load i8*, i8** %6
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %6
br label %73
88: ; preds = %83
%89 = load i8*, i8** %6
%90 = load i8, i8* %89
%91 = icmp ne i8 %90, 0
br i1 %91, label %94, label %92
92: ; preds = %88
%93 = call i32 (i32, i8*, ...) @logMessage(i32 30, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %123
94: ; preds = %88
%95 = load i8*, i8** %6
store i8* %95, i8** %5
br label %96
96: ; preds = %108, %94
%97 = load i8*, i8** %5
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %96
%102 = load i8*, i8** %5
%103 = load i8, i8* %102
%104 = call i64 @isdigit(i8 signext %103)
%105 = icmp ne i64 %104, 0
br label %106
106: ; preds = %101, %96
%107 = phi i1 [ false, %96 ], [ %105, %101 ]
br i1 %107, label %108, label %118
108: ; preds = %106
%109 = load i32, i32* %7
%110 = mul nsw i32 %109, 10
%111 = load i8*, i8** %5
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = sub nsw i32 %113, 48
%115 = add nsw i32 %110, %114
store i32 %115, i32* %7
%116 = load i8*, i8** %5
%117 = getelementptr inbounds i8, i8* %116, i32 1
store i8* %117, i8** %5
br label %96
118: ; preds = %106
br label %35
119: ; preds = %44
%120 = load i32, i32* %7
%121 = call i32 (i32, i8*, ...) @logMessage(i32 20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %120)
%122 = load i32, i32* %7
store i32 %122, i32* %1
br label %123
123: ; preds = %119, %92, %22, %12
%124 = load i32, i32* %1
ret i32 %124
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/meminfo\00"
@O_RDONLY = global i32 0
@.str.1 = [33 x i8] c"failed to open /proc/meminfo: %s\00"
@errno = global i32 0
@.str.2 = [38 x i8] c"failed to read from /proc/meminfo: %s\00"
@.str.3 = [10 x i8] c"MemTotal:\00"
@.str.4 = [37 x i8] c"no number appears after MemTotal tag\00"
@.str.5 = [20 x i8] c"%d kB are available\00"
define i32 @totalMemory() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 (i32, i8*, ...) @logMessage(i32 40, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %78
10: ; preds = %0
%11 = call i32 @read(i32 %4, i8* %2, i32 4095)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* @errno
%15 = tail call i32 @strerror(i32 %14)
%16 = tail call i32 (i32, i8*, ...) @logMessage(i32 40, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = tail call i32 @close(i32 %4)
br label %78
18: ; preds = %10
%19 = tail call i32 @close(i32 %4)
%20 = zext i32 %11 to i64
%21 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 %20
store i8 0, i8* %21
%22 = load i8, i8* %2
%23 = icmp eq i8 %22, 0
br i1 %23, label %75, label %24
24: ; preds = %18, %29
%25 = phi i8* [ %30, %29 ], [ %2, %18 ]
%26 = call i64 @strncmp(i8* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 9)
%27 = icmp eq i64 %26, 0
%28 = getelementptr inbounds i8, i8* %25, i64 1
br i1 %27, label %36, label %29
29: ; preds = %66, %60, %24
%30 = phi i8* [ %28, %24 ], [ %72, %66 ], [ %62, %60 ]
%31 = phi i32 [ 0, %24 ], [ %71, %66 ], [ %61, %60 ]
%32 = load i8, i8* %30
%33 = icmp ne i8 %32, 0
%34 = icmp eq i32 %31, 0
%35 = select i1 %33, i1 %34, i1 false
br i1 %35, label %24, label %75
36: ; preds = %24, %39
%37 = phi i8* [ %40, %39 ], [ %28, %24 ]
%38 = load i8, i8* %37
switch i8 %38, label %39 [
i8 0, label %41
i8 10, label %41
]
39: ; preds = %36
%40 = getelementptr inbounds i8, i8* %37, i64 1
br label %36
41: ; preds = %36, %36
store i8 0, i8* %37
%42 = load i8, i8* %28
%43 = call i64 @isdigit(i8 signext %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %54
45: ; preds = %41, %49
%46 = phi i8* [ %50, %49 ], [ %28, %41 ]
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %58, label %49
49: ; preds = %45
%50 = getelementptr inbounds i8, i8* %46, i64 1
%51 = load i8, i8* %50
%52 = call i64 @isdigit(i8 signext %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %45, label %54
54: ; preds = %49, %41
%55 = phi i8* [ %28, %41 ], [ %50, %49 ]
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %54, %45
%59 = call i32 (i32, i8*, ...) @logMessage(i32 30, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
br label %78
60: ; preds = %54, %66
%61 = phi i32 [ %71, %66 ], [ 0, %54 ]
%62 = phi i8* [ %72, %66 ], [ %55, %54 ]
%63 = phi i8 [ %73, %66 ], [ %56, %54 ]
%64 = call i64 @isdigit(i8 signext %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %29, label %66
66: ; preds = %60
%67 = mul nsw i32 %61, 10
%68 = load i8, i8* %62
%69 = sext i8 %68 to i32
%70 = add i32 %67, -48
%71 = add i32 %70, %69
%72 = getelementptr inbounds i8, i8* %62, i64 1
%73 = load i8, i8* %72
%74 = icmp eq i8 %73, 0
br i1 %74, label %29, label %60
75: ; preds = %29, %18
%76 = phi i32 [ 0, %18 ], [ %31, %29 ]
%77 = call i32 (i32, i8*, ...) @logMessage(i32 20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %75, %58, %13, %6
%79 = phi i32 [ 0, %6 ], [ 0, %13 ], [ 0, %58 ], [ %76, %75 ]
ret i32 %79
}