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

/* Variables and functions */
int O_NDELAY;
int O_NOCTTY;
int O_RDWR;
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char const *, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int main(int argc, char *argv[]) {
  int fd, r = 0, i = 0;
  const char *adc = "/dev/adc";
  char buffer[512];
  int len = 0;
  printf("1\n");
  memset(buffer, 0, sizeof(buffer));
  printf("2\n");
  printf("sizeof(buffer) = %d\n", sizeof(buffer));
  printf("3\n");
  if ((fd = open(adc, O_RDWR | O_NOCTTY | O_NDELAY)) < 0) {
    printf("4\n");
    printf("open %s failed\n", adc);
    exit(1);
  } else {
    printf("5\n");
    len = read(fd, buffer, 10);
    printf("6\n");
    for (i = 0; i < 10; i++) {
      printf("7\n");
      printf("buffer[%d] = %c\n", i, buffer[i]);
      printf("8\n");
    }
    if (len == 0) {
      printf("9\n");
      printf("read error\n");
    } else {
      printf("10\n");
      r = atoi(buffer);
      printf("11\n");
      printf("r raw =%d\n", r);
      printf("12\n");
      r = (int)(r * 10000 / 0xfff);
      printf("13\n");
      printf("r=%d\n", r);
      printf("14\n");
    }
    printf("15\n");
  }
  printf("16\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe72(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x234(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe37(%rip),%rdi
mov    $0x200,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    0x2df1(%rip),%rax
mov    (%rax),%esi
mov    0x2dd8(%rip),%rax
or     (%rax),%esi
mov    0x2dc7(%rip),%rax
or     (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1246 <main+0xe6>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x230(%rbp),%rsi
mov    $0xa,%edx
call   1050 <read@plt>
mov    %eax,-0x234(%rbp)
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    12d4 <main+0x174>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
movslq -0x1c(%rbp),%rax
movsbl -0x230(%rbp,%rax,1),%edx
ff
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1283 <main+0x123>
cmpl   $0x0,-0x234(%rbp)
jne    1302 <main+0x1a2>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    138b <main+0x22b>
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x230(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x2710,-0x18(%rbp),%eax
mov    $0xfff,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
lea    0xd06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcdd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x208,%rsp
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5e(%rip),%rdi
mov    $0x200,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e1e(%rip),%rax
mov    0x2e07(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2df4(%rip),%rax
or     (%rax),%esi
lea    0xe1b(%rip),%rdi
call   1070 <open@plt>
test   %eax,%eax
js     1466 <main+0x2f6>
mov    %eax,%ebx
lea    0xe65(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0xa,%edx
call   1060 <read@plt>
mov    %eax,%r14d
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4d(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl (%rsp),%edx
lea    0xdf6(%rip),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe29(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x1(%rsp),%edx
mov    %rbp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x2(%rsp),%edx
mov    %rbp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x3(%rsp),%edx
mov    %rbp,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x4(%rsp),%edx
mov    %rbp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x5(%rsp),%edx
mov    %rbp,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x6(%rsp),%edx
mov    %rbp,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x7(%rsp),%edx
mov    %rbp,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x8(%rsp),%edx
mov    %rbp,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsbl 0x9(%rsp),%edx
mov    %rbp,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
je     1423 <main+0x2b3>
lea    0xca9(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebx
lea    0xc96(%rip),%rdi
call   1030 <puts@plt>
lea    0xc76(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc7d(%rip),%rdi
call   1030 <puts@plt>
imul   $0x2710,%ebx,%eax
movslq %eax,%rbx
imul   $0xffffffff80080081,%rbx,%rax
shr    $0x20,%rax
add    %eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0xb,%ebx
add    %eax,%ebx
lea    0xc54(%rip),%rdi
call   1030 <puts@plt>
lea    0xc39(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc3b(%rip),%rdi
jmp    1436 <main+0x2c6>
lea    0xc3b(%rip),%rdi
call   1030 <puts@plt>
lea    0xc31(%rip),%rdi
call   1030 <puts@plt>
lea    0xc1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xc14(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbf0(%rip),%rdi
call   1030 <puts@plt>
lea    0xba5(%rip),%rdi
lea    0xb80(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/adc\00"
@.str.1 = [3 x i8] c"1\0A\00"
@.str.2 = [3 x i8] c"2\0A\00"
@.str.3 = [21 x i8] c"sizeof(buffer) = %d\0A\00"
@.str.4 = [3 x i8] c"3\0A\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@.str.5 = [3 x i8] c"4\0A\00"
@.str.6 = [16 x i8] c"open %s failed\0A\00"
@.str.7 = [3 x i8] c"5\0A\00"
@.str.8 = [3 x i8] c"6\0A\00"
@.str.9 = [3 x i8] c"7\0A\00"
@.str.10 = [17 x i8] c"buffer[%d] = %c\0A\00"
@.str.11 = [3 x i8] c"8\0A\00"
@.str.12 = [3 x i8] c"9\0A\00"
@.str.13 = [12 x i8] c"read error\0A\00"
@.str.14 = [4 x i8] c"10\0A\00"
@.str.15 = [4 x i8] c"11\0A\00"
@.str.16 = [11 x i8] c"r raw =%d\0A\00"
@.str.17 = [4 x i8] c"12\0A\00"
@.str.18 = [4 x i8] c"13\0A\00"
@.str.19 = [6 x i8] c"r=%d\0A\00"
@.str.20 = [4 x i8] c"14\0A\00"
@.str.21 = [4 x i8] c"15\0A\00"
@.str.22 = [4 x i8] c"16\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca [512 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %9
store i32 0, i32* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%14 = call i32 @memset(i8* %13, i32 0, i32 512)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i64 512)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%18 = load i8*, i8** %9
%19 = load i32, i32* @O_RDWR
%20 = load i32, i32* @O_NOCTTY
%21 = or i32 %19, %20
%22 = load i32, i32* @O_NDELAY
%23 = or i32 %21, %22
%24 = call i32 @open(i8* %18, i32 %23)
store i32 %24, i32* %6
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%28 = load i8*, i8** %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%33 = load i32, i32* %6
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%35 = call i32 @read(i32 %33, i8* %34, i32 10)
store i32 %35, i32* %11
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %8
br label %37
37: ; preds = %50, %31
%38 = load i32, i32* %8
%39 = icmp slt i32 %38, 10
br i1 %39, label %40, label %53
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%42 = load i32, i32* %8
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %42, i32 %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %50
50: ; preds = %40
%51 = load i32, i32* %8
%52 = add nsw i32 %51, 1
store i32 %52, i32* %8
br label %37
53: ; preds = %37
%54 = load i32, i32* %11
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %74
59: ; preds = %53
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%61 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%62 = call i32 @atoi(i8* %61)
store i32 %62, i32* %7
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%64 = load i32, i32* %7
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%67 = load i32, i32* %7
%68 = mul nsw i32 %67, 10000
%69 = sdiv i32 %68, 4095
store i32 %69, i32* %7
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%71 = load i32, i32* %7
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
br label %74
74: ; preds = %59, %56
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
br label %76
76: ; preds = %74
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/adc\00"
@.str.3 = [21 x i8] c"sizeof(buffer) = %d\0A\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@.str.6 = [16 x i8] c"open %s failed\0A\00"
@.str.10 = [17 x i8] c"buffer[%d] = %c\0A\00"
@.str.16 = [11 x i8] c"r raw =%d\0A\00"
@.str.19 = [6 x i8] c"r=%d\0A\00"
@str = [2 x i8] c"1\00"
@str.23 = [2 x i8] c"2\00"
@str.24 = [2 x i8] c"3\00"
@str.25 = [2 x i8] c"5\00"
@str.26 = [2 x i8] c"6\00"
@str.27 = [3 x i8] c"10\00"
@str.28 = [3 x i8] c"11\00"
@str.29 = [3 x i8] c"12\00"
@str.30 = [3 x i8] c"13\00"
@str.31 = [3 x i8] c"14\00"
@str.32 = [3 x i8] c"15\00"
@str.33 = [3 x i8] c"16\00"
@str.34 = [2 x i8] c"9\00"
@str.35 = [11 x i8] c"read error\00"
@str.36 = [2 x i8] c"7\00"
@str.37 = [2 x i8] c"8\00"
@str.38 = [2 x i8] c"4\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%6 = call i32 @memset(i8* %4, i32 0, i32 512)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.23, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i64 512)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.24, i64 0, i64 0))
%10 = load i32, i32* @O_RDWR
%11 = load i32, i32* @O_NOCTTY
%12 = or i32 %11, %10
%13 = load i32, i32* @O_NDELAY
%14 = or i32 %12, %13
%15 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.38, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.25, i64 0, i64 0))
%23 = call i32 @read(i32 %15, i8* %4, i32 10)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.26, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 0, i32 %27)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%31 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 1, i32 %33)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%37 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 2
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 2, i32 %39)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 3
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 3, i32 %45)
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 4
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 4, i32 %51)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%55 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 5
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 5, i32 %57)
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%61 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 6
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 6, i32 %63)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%67 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 7
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 7, i32 %69)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%73 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 8
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 8, i32 %75)
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.36, i64 0, i64 0))
%79 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 9
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 9, i32 %81)
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.37, i64 0, i64 0))
%84 = icmp eq i32 %23, 0
br i1 %84, label %85, label %87
85: ; preds = %21
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.34, i64 0, i64 0))
br label %97
87: ; preds = %21
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.27, i64 0, i64 0))
%89 = call i32 @atoi(i8* %4)
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.28, i64 0, i64 0))
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 %89)
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.29, i64 0, i64 0))
%93 = mul nsw i32 %89, 10000
%94 = sdiv i32 %93, 4095
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.30, i64 0, i64 0))
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i32 %94)
br label %97
97: ; preds = %87, %85
%98 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.31, i64 0, i64 0), %87 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.35, i64 0, i64 0), %85 ]
%99 = call i32 @puts(i8* dereferenceable(1) %98)
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.32, i64 0, i64 0))
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.33, i64 0, i64 0))
ret i32 1
}