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

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  int fd, inmem, datas, i;
  char Buff[4] = {0};
  char wrmem;
  printf("GPIO Device Driver LED test program\n Author : Sangwook Ha\n");
  fd = open("/dev/GPIO_LED", O_RDWR);
  if (fd < 0) {
    printf("device driver open error\n");
    return 1;
  }
  while (1) {
  LOOP:
    printf("which mode?\nWrite: 1\nRead: 2\nexit: 3\n");
    scanf("%d", &inmem);
    if (inmem == 1) {
      ioctl(fd, 1);
    } else if (inmem == 2) {
      ioctl(fd, 3);
    } else if (inmem == 3) {
      break;
    } else {
      printf("mode setting error\n");
      goto LOOP;
    }
    switch (inmem) {
    case 2:
      printf("now Pin read states :\n");
      read(fd, Buff, 4);
      datas = (Buff[0] << 24) | (Buff[1] << 16) | (Buff[2] << 8) | Buff[3];
      for (i = 0; i < 23; i++)
        printf("Pin %d : %d\n", i, (datas >> i) & 1);
      break;
    case 1:
      printf("which pin set do you want?\n");
      printf("0~22 or 30(all) : ");
      scanf("%d", &datas);
      if (datas == 30)
        wrmem = 'a';
      else
        wrmem = datas;
      write(fd, &wrmem, 1);
      break;
    }
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%esi
lea    0xe7e(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11e9 <main+0x69>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1380 <main+0x200>
jmp    11ee <main+0x6e>
jmp    11f3 <main+0x73>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    122d <main+0xad>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1060 <ioctl@plt>
jmp    1270 <main+0xf0>
cmpl   $0x2,-0xc(%rbp)
jne    1249 <main+0xc9>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1060 <ioctl@plt>
jmp    126b <main+0xeb>
cmpl   $0x3,-0xc(%rbp)
jne    1258 <main+0xd8>
jmp    1371 <main+0x1f1>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f3 <main+0x73>
jmp    1270 <main+0xf0>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     1316 <main+0x196>
jmp    1284 <main+0x104>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
jne    136c <main+0x1ec>
jmp    1295 <main+0x115>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1080 <read@plt>
movsbl -0x18(%rbp),%eax
shl    $0x18,%eax
movsbl -0x17(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movsbl -0x16(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movsbl -0x15(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x17,-0x14(%rbp)
jge    1311 <main+0x191>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sar    %cl,%edx
and    $0x1,%edx
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12dd <main+0x15d>
jmp    136c <main+0x1ec>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd50(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1e,-0x10(%rbp)
jne    1355 <main+0x1d5>
movb   $0x61,-0x19(%rbp)
jmp    135b <main+0x1db>
mov    -0x10(%rbp),%eax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    11ee <main+0x6e>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
lea    0xe4e(%rip),%rdi
call   10a0 <open@plt>
test   %eax,%eax
js     1525 <main+0x3a5>
mov    %eax,%ebx
lea    0xea3(%rip),%r14
lea    0xe3f(%rip),%r15
lea    0x14(%rsp),%r12
lea    0xe36(%rip),%r13
lea    0xeae(%rip),%rbp
jmp    123b <main+0xbb>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
lea    0x8(%rsp),%rsi
call   1090 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0x1e,%eax
mov    $0x61,%ecx
cmove  %ecx,%eax
mov    %al,0xf(%rsp)
mov    %ebx,%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1090 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x1,%eax
je     1280 <main+0x100>
mov    $0x3,%esi
cmp    $0x2,%eax
je     1285 <main+0x105>
cmp    $0x3,%eax
je     151a <main+0x39a>
mov    %rbp,%rdi
call   1030 <puts@plt>
jmp    123b <main+0xbb>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%esi
mov    %ebx,%edi
call   1060 <ioctl@plt>
mov    0x14(%rsp),%eax
cmp    $0x1,%eax
je     11f0 <main+0x70>
cmp    $0x2,%eax
jne    123b <main+0xbb>
lea    0xe19(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1080 <read@plt>
mov    0x10(%rsp),%eax
shl    $0x18,%eax
movsbl 0x11(%rsp),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movsbl 0x12(%rsp),%eax
shl    $0x8,%eax
movsbl 0x13(%rsp),%edx
or     %edx,%eax
or     %ecx,%eax
mov    %eax,0x8(%rsp)
and    $0x1,%edx
mov    %r13,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    %edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x2,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x3,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x4,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x5,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x6,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x7,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x8,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x9,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0xa,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0xb,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0xc,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0xd,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0xe,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0xf,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x10,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x11,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x11,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x12,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x12,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x13,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x13,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x14,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x15,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%edx
shr    $0x16,%edx
and    $0x1,%edx
mov    %r13,%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    123b <main+0xbb>
mov    %ebx,%edi
call   1070 <close@plt>
xor    %eax,%eax
jmp    1536 <main+0x3b6>
lea    0xba8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"GPIO Device Driver LED test program\0A Author : Sangwook Ha\0A\00"
@.str.1 = [14 x i8] c"/dev/GPIO_LED\00"
@O_RDWR = global i32 0
@.str.2 = [26 x i8] c"device driver open error\0A\00"
@.str.3 = [38 x i8] c"which mode?\0AWrite: 1\0ARead: 2\0Aexit: 3\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [20 x i8] c"mode setting error\0A\00"
@.str.6 = [23 x i8] c"now Pin read states :\0A\00"
@.str.7 = [13 x i8] c"Pin %d : %d\0A\00"
@.str.8 = [28 x i8] c"which pin set do you want?\0A\00"
@.str.9 = [19 x i8] c"0~22 or 30(all) : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [4 x i8]
%7 = alloca i8
store i32 0, i32* %1
%8 = bitcast [4 x i8]* %6 to i8*
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @O_RDWR
%11 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %95
16: ; preds = %0
br label %17
17: ; preds = %16, %91
br label %18
18: ; preds = %36, %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i32, i32* %2
%25 = call i32 @ioctl(i32 %24, i32 1)
br label %39
26: ; preds = %18
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* %2
%31 = call i32 @ioctl(i32 %30, i32 3)
br label %38
32: ; preds = %26
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 3
br i1 %34, label %35, label %36
35: ; preds = %32
br label %92
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %18
38: ; preds = %29
br label %39
39: ; preds = %38, %23
%40 = load i32, i32* %3
switch i32 %40, label %91 [
i32 2, label %41
i32 1, label %78
]
41: ; preds = %39
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%43 = load i32, i32* %2
%44 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%45 = call i32 @read(i32 %43, i8* %44, i32 4)
%46 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = shl i32 %48, 24
%50 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = shl i32 %52, 16
%54 = or i32 %49, %53
%55 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = shl i32 %57, 8
%59 = or i32 %54, %58
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = or i32 %59, %62
store i32 %63, i32* %4
store i32 0, i32* %5
br label %64
64: ; preds = %74, %41
%65 = load i32, i32* %5
%66 = icmp slt i32 %65, 23
br i1 %66, label %67, label %77
67: ; preds = %64
%68 = load i32, i32* %5
%69 = load i32, i32* %4
%70 = load i32, i32* %5
%71 = ashr i32 %69, %70
%72 = and i32 %71, 1
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %68, i32 %72)
br label %74
74: ; preds = %67
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %5
br label %64
77: ; preds = %64
br label %91
78: ; preds = %39
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%81 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%82 = load i32, i32* %4
%83 = icmp eq i32 %82, 30
br i1 %83, label %84, label %85
84: ; preds = %78
store i8 97, i8* %7
br label %88
85: ; preds = %78
%86 = load i32, i32* %4
%87 = trunc i32 %86 to i8
store i8 %87, i8* %7
br label %88
88: ; preds = %85, %84
%89 = load i32, i32* %2
%90 = call i32 @write(i32 %89, i8* %7, i32 1)
br label %91
91: ; preds = %39, %88, %77
br label %17
92: ; preds = %35
%93 = load i32, i32* %2
%94 = call i32 @close(i32 %93)
store i32 0, i32* %1
br label %95
95: ; preds = %92, %14
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"/dev/GPIO_LED\00"
@O_RDWR = global i32 0
@.str.4 = [3 x i8] c"%d\00"
@.str.7 = [13 x i8] c"Pin %d : %d\0A\00"
@.str.9 = [19 x i8] c"0~22 or 30(all) : \00"
@str = [58 x i8] c"GPIO Device Driver LED test program\0A Author : Sangwook Ha\00"
@str.10 = [37 x i8] c"which mode?\0AWrite: 1\0ARead: 2\0Aexit: 3\00"
@str.11 = [19 x i8] c"mode setting error\00"
@str.12 = [27 x i8] c"which pin set do you want?\00"
@str.13 = [22 x i8] c"now Pin read states :\00"
@str.14 = [25 x i8] c"device driver open error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %3 to [4 x i8]*
%5 = alloca i8
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* @O_RDWR
%11 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = icmp slt i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %0
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
br label %19
17: ; preds = %0
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.14, i64 0, i64 0))
br label %149
19: ; preds = %25, %13
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.10, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%22 = load i32, i32* %1
switch i32 %22, label %23 [
i32 1, label %26
i32 2, label %27
i32 3, label %147
]
23: ; preds = %19
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
br label %25
25: ; preds = %23, %31, %27, %138
br label %19
26: ; preds = %19
br label %27
27: ; preds = %19, %26
%28 = phi i32 [ 1, %26 ], [ 3, %19 ]
%29 = call i32 @ioctl(i32 %11, i32 %28)
%30 = load i32, i32* %1
switch i32 %30, label %25 [
i32 2, label %31
i32 1, label %138
]
31: ; preds = %27
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.13, i64 0, i64 0))
%33 = call i32 @read(i32 %11, i8* %8, i32 4)
%34 = load i8, i8* %8
%35 = zext i8 %34 to i32
%36 = shl nuw i32 %35, 24
%37 = load i8, i8* %14
%38 = sext i8 %37 to i32
%39 = shl nsw i32 %38, 16
%40 = or i32 %39, %36
%41 = load i8, i8* %15
%42 = sext i8 %41 to i32
%43 = shl nsw i32 %42, 8
%44 = or i32 %40, %43
%45 = load i8, i8* %16
%46 = sext i8 %45 to i32
%47 = or i32 %44, %46
store i32 %47, i32* %2
%48 = and i32 %46, 1
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 0, i32 %48)
%50 = load i32, i32* %2
%51 = lshr i32 %50, 1
%52 = and i32 %51, 1
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 %52)
%54 = load i32, i32* %2
%55 = lshr i32 %54, 2
%56 = and i32 %55, 1
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 2, i32 %56)
%58 = load i32, i32* %2
%59 = lshr i32 %58, 3
%60 = and i32 %59, 1
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 3, i32 %60)
%62 = load i32, i32* %2
%63 = lshr i32 %62, 4
%64 = and i32 %63, 1
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 4, i32 %64)
%66 = load i32, i32* %2
%67 = lshr i32 %66, 5
%68 = and i32 %67, 1
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 5, i32 %68)
%70 = load i32, i32* %2
%71 = lshr i32 %70, 6
%72 = and i32 %71, 1
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 6, i32 %72)
%74 = load i32, i32* %2
%75 = lshr i32 %74, 7
%76 = and i32 %75, 1
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 7, i32 %76)
%78 = load i32, i32* %2
%79 = lshr i32 %78, 8
%80 = and i32 %79, 1
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 8, i32 %80)
%82 = load i32, i32* %2
%83 = lshr i32 %82, 9
%84 = and i32 %83, 1
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 9, i32 %84)
%86 = load i32, i32* %2
%87 = lshr i32 %86, 10
%88 = and i32 %87, 1
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 10, i32 %88)
%90 = load i32, i32* %2
%91 = lshr i32 %90, 11
%92 = and i32 %91, 1
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 11, i32 %92)
%94 = load i32, i32* %2
%95 = lshr i32 %94, 12
%96 = and i32 %95, 1
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 12, i32 %96)
%98 = load i32, i32* %2
%99 = lshr i32 %98, 13
%100 = and i32 %99, 1
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 13, i32 %100)
%102 = load i32, i32* %2
%103 = lshr i32 %102, 14
%104 = and i32 %103, 1
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 14, i32 %104)
%106 = load i32, i32* %2
%107 = lshr i32 %106, 15
%108 = and i32 %107, 1
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 15, i32 %108)
%110 = load i32, i32* %2
%111 = lshr i32 %110, 16
%112 = and i32 %111, 1
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 16, i32 %112)
%114 = load i32, i32* %2
%115 = lshr i32 %114, 17
%116 = and i32 %115, 1
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 17, i32 %116)
%118 = load i32, i32* %2
%119 = lshr i32 %118, 18
%120 = and i32 %119, 1
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 18, i32 %120)
%122 = load i32, i32* %2
%123 = lshr i32 %122, 19
%124 = and i32 %123, 1
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 19, i32 %124)
%126 = load i32, i32* %2
%127 = lshr i32 %126, 20
%128 = and i32 %127, 1
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 20, i32 %128)
%130 = load i32, i32* %2
%131 = lshr i32 %130, 21
%132 = and i32 %131, 1
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 21, i32 %132)
%134 = load i32, i32* %2
%135 = lshr i32 %134, 22
%136 = and i32 %135, 1
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 22, i32 %136)
br label %25
138: ; preds = %27
%139 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%141 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%142 = load i32, i32* %2
%143 = icmp eq i32 %142, 30
%144 = trunc i32 %142 to i8
%145 = select i1 %143, i8 97, i8 %144
store i8 %145, i8* %5
%146 = call i32 @write(i32 %11, i8* %5, i32 1)
br label %25
147: ; preds = %19
%148 = call i32 @close(i32 %11)
br label %149
149: ; preds = %147, %17
%150 = phi i32 [ 1, %17 ], [ 0, %147 ]
ret i32 %150
}