#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 timespec {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ memset(char *, char, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
int write(int, char *, int);
int main(int argc, char *argv[]) {
  int fd, wr, rd, idx, val;
  char file[80];
  char msg_buff[512];
  struct timespec t = {0};
  if ((argc <= 2) || (argc > 4)) {
    printf("Invalid RPMsg communication\nThe format is: ``prumsg [channel] "
           "command data´´\ne.g. prumsg 30 s 3000\nExiting...\n");
    return -1;
  }
  sprintf(file, "/dev/rpmsg_pru%s", argv[1]);
  fd = open(file, O_RDWR);
  if (fd < 0) {
    perror(argv[1]);
    printf("Invalid RPMsg channel file\nExiting...\n");
    return -1;
  }
  memset(msg_buff, '\0', 512);
  for (idx = 0; idx < strlen(argv[2]); idx++)
    msg_buff[0] ^= argv[2][idx];
  if (argc == 4) {
    val = atoi(argv[3]);
    msg_buff[1] = val & 0x000000FF;
    msg_buff[2] = (val & 0x0000FF00) >> 0x08;
    msg_buff[3] = (val & 0x00FF0000) >> 0x10;
    msg_buff[4] = val >> 0x18;
    wr = write(fd, msg_buff, 5);
  } else {
    wr = write(fd, msg_buff, 1);
  }
  if (wr == -1) {
    printf("Writing error\nExiting...\n");
    close(fd);
    return -1;
  }
  rd = read(fd, msg_buff, 4);
  if (rd == -1) {
    printf("Reading error\nExiting...\n");
    close(fd);
    return -1;
  }
  val = (msg_buff[0] | msg_buff[1] << 0x08 | msg_buff[2] << 0x10 |
         msg_buff[3] << 0x18);
  printf("El valor de %s es: %d\n", argv[2], val);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x288(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
jle    11e0 <main+0x40>
cmpl   $0x4,-0x8(%rbp)
jle    11fa <main+0x5a>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1413 <main+0x273>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe64(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x80(%rbp),%rdi
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1258 <main+0xb8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <perror@plt>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1413 <main+0x273>
lea    -0x280(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1060 <memset@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x28c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28c(%rbp),%eax
cmp    %ecx,%eax
jge    12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x280(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x280(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1272 <main+0xd2>
cmpl   $0x4,-0x8(%rbp)
jne    1337 <main+0x197>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x27f(%rbp)
mov    -0x24(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,-0x27e(%rbp)
mov    -0x24(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %al,-0x27d(%rbp)
mov    -0x24(%rbp),%eax
sar    $0x18,%eax
mov    %al,-0x27c(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x280(%rbp),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
jmp    134e <main+0x1ae>
mov    -0x14(%rbp),%edi
lea    -0x280(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    137a <main+0x1da>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1413 <main+0x273>
mov    -0x14(%rbp),%edi
lea    -0x280(%rbp),%rsi
mov    $0x4,%edx
call   1080 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    13bd <main+0x21d>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1413 <main+0x273>
movsbl -0x280(%rbp),%eax
movsbl -0x27f(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movsbl -0x27e(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movsbl -0x27d(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x24(%rbp),%edx
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x258,%rsp
mov    %edi,%r15d
lea    -0x5(%r15),%eax
cmp    $0xfffffffd,%eax
ja     11da <main+0x2a>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
jmp    12fa <main+0x14a>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdx
lea    0xe18(%rip),%rsi
lea    0x200(%rsp),%r14
mov    %r14,%rdi
call   10d0 <sprintf@plt>
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10a0 <open@plt>
test   %eax,%eax
js     130f <main+0x15f>
mov    %eax,%r14d
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1070 <memset@plt>
mov    0x10(%rbx),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    125b <main+0xab>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x10(%rbx),%rdi
movzbl (%rdi,%rbp,1),%eax
xor    %al,(%rsp)
add    $0x1,%rbp
call   1050 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1240 <main+0x90>
mov    $0x1,%edx
cmp    $0x4,%r15d
jne    1278 <main+0xc8>
mov    0x18(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,0x1(%rsp)
mov    $0x5,%edx
mov    %rsp,%rsi
mov    %r14d,%edi
call   1040 <write@plt>
cmp    $0xffffffff,%eax
je     12dd <main+0x12d>
mov    %rsp,%rsi
mov    %r14d,%edi
mov    $0x4,%edx
call   1090 <read@plt>
cmp    $0xffffffff,%eax
je     12e6 <main+0x136>
movsbl (%rsp),%eax
movsbl 0x1(%rsp),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movsbl 0x2(%rsp),%eax
shl    $0x10,%eax
movzbl 0x3(%rsp),%edx
shl    $0x18,%edx
or     %eax,%edx
or     %ecx,%edx
mov    0x10(%rbx),%rsi
lea    0xd47(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
call   1080 <close@plt>
jmp    12ff <main+0x14f>
lea    0xd5d(%rip),%rdi
jmp    12ed <main+0x13d>
lea    0xd3b(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%edi
call   1080 <close@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x258,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rbx),%rdi
call   10b0 <perror@plt>
lea    0xd3b(%rip),%rdi
jmp    11d0 <main+0x20>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [113 x i8] c"Invalid RPMsg communication\0AThe format is: ``prumsg [channel] command data\C2\B4\C2\B4\0Ae.g. prumsg 30 s 3000\0AExiting...\0A\00"
@.str.1 = [17 x i8] c"/dev/rpmsg_pru%s\00"
@O_RDWR = global i32 0
@.str.2 = [39 x i8] c"Invalid RPMsg channel file\0AExiting...\0A\00"
@.str.3 = [26 x i8] c"Writing error\0AExiting...\0A\00"
@.str.4 = [26 x i8] c"Reading error\0AExiting...\0A\00"
@.str.5 = [23 x i8] c"El valor de %s es: %d\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 i32
%10 = alloca i32
%11 = alloca [80 x i8]
%12 = alloca [512 x i8]
%13 = alloca %struct.timespec
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast %struct.timespec* %13 to i8*
%15 = load i32, i32* %4
%16 = icmp sle i32 %15, 2
br i1 %16, label %20, label %17
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %17, %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %142
22: ; preds = %17
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%29 = load i32, i32* @O_RDWR
%30 = call i32 @open(i8* %28, i32 %29)
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %39
33: ; preds = %22
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 @perror(i8* %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %142
39: ; preds = %22
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%41 = call i32 @memset(i8* %40, i8 signext 0, i32 512)
store i32 0, i32* %9
br label %42
42: ; preds = %63, %39
%43 = load i32, i32* %9
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @strlen(i8* %46)
%48 = icmp slt i32 %43, %47
br i1 %48, label %49, label %66
49: ; preds = %42
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = load i32, i32* %9
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = xor i32 %60, %57
%62 = trunc i32 %61 to i8
store i8 %62, i8* %58
br label %63
63: ; preds = %49
%64 = load i32, i32* %9
%65 = add nsw i32 %64, 1
store i32 %65, i32* %9
br label %42
66: ; preds = %42
%67 = load i32, i32* %4
%68 = icmp eq i32 %67, 4
br i1 %68, label %69, label %95
69: ; preds = %66
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 3
%72 = load i8*, i8** %71
%73 = call i32 @atoi(i8* %72)
store i32 %73, i32* %10
%74 = load i32, i32* %10
%75 = and i32 %74, 255
%76 = trunc i32 %75 to i8
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 1
store i8 %76, i8* %77
%78 = load i32, i32* %10
%79 = and i32 %78, 65280
%80 = ashr i32 %79, 8
%81 = trunc i32 %80 to i8
%82 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 2
store i8 %81, i8* %82
%83 = load i32, i32* %10
%84 = and i32 %83, 16711680
%85 = ashr i32 %84, 16
%86 = trunc i32 %85 to i8
%87 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 3
store i8 %86, i8* %87
%88 = load i32, i32* %10
%89 = ashr i32 %88, 24
%90 = trunc i32 %89 to i8
%91 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 4
store i8 %90, i8* %91
%92 = load i32, i32* %6
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%94 = call i32 @write(i32 %92, i8* %93, i32 5)
store i32 %94, i32* %7
br label %99
95: ; preds = %66
%96 = load i32, i32* %6
%97 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%98 = call i32 @write(i32 %96, i8* %97, i32 1)
store i32 %98, i32* %7
br label %99
99: ; preds = %95, %69
%100 = load i32, i32* %7
%101 = icmp eq i32 %100, -1
br i1 %101, label %102, label %106
102: ; preds = %99
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%104 = load i32, i32* %6
%105 = call i32 @close(i32 %104)
store i32 -1, i32* %3
br label %142
106: ; preds = %99
%107 = load i32, i32* %6
%108 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%109 = call i32 @read(i32 %107, i8* %108, i32 4)
store i32 %109, i32* %8
%110 = load i32, i32* %8
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %116
112: ; preds = %106
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%114 = load i32, i32* %6
%115 = call i32 @close(i32 %114)
store i32 -1, i32* %3
br label %142
116: ; preds = %106
%117 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 1
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = shl i32 %122, 8
%124 = or i32 %119, %123
%125 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 2
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = shl i32 %127, 16
%129 = or i32 %124, %128
%130 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 3
%131 = load i8, i8* %130
%132 = sext i8 %131 to i32
%133 = shl i32 %132, 24
%134 = or i32 %129, %133
store i32 %134, i32* %10
%135 = load i8**, i8*** %5
%136 = getelementptr inbounds i8*, i8** %135, i64 2
%137 = load i8*, i8** %136
%138 = load i32, i32* %10
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %137, i32 %138)
%140 = load i32, i32* %6
%141 = call i32 @close(i32 %140)
store i32 0, i32* %3
br label %142
142: ; preds = %116, %112, %102, %33, %20
%143 = load i32, i32* %3
ret i32 %143
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"/dev/rpmsg_pru%s\00"
@O_RDWR = global i32 0
@.str.5 = [23 x i8] c"El valor de %s es: %d\0A\00"
@str = [25 x i8] c"Reading error\0AExiting...\00"
@str.6 = [25 x i8] c"Writing error\0AExiting...\00"
@str.7 = [38 x i8] c"Invalid RPMsg channel file\0AExiting...\00"
@str.8 = [112 x i8] c"Invalid RPMsg communication\0AThe format is: ``prumsg [channel] command data\C2\B4\C2\B4\0Ae.g. prumsg 30 s 3000\0AExiting...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = add i32 %0, -5
%8 = icmp ult i32 %7, -2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str.8, i64 0, i64 0))
br label %90
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @O_RDWR
%16 = call i32 @open(i8* %5, i32 %15)
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %11
%19 = load i8*, i8** %12
%20 = tail call i32 @perror(i8* %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.7, i64 0, i64 0))
br label %90
22: ; preds = %11
%23 = call i32 @memset(i8* %6, i8 signext 0, i32 512)
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @strlen(i8* %25)
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %39
28: ; preds = %22, %28
%29 = phi i64 [ %35, %28 ], [ 0, %22 ]
%30 = load i8*, i8** %24
%31 = getelementptr inbounds i8, i8* %30, i64 %29
%32 = load i8, i8* %31
%33 = load i8, i8* %6
%34 = xor i8 %33, %32
store i8 %34, i8* %6
%35 = add nuw nsw i64 %29, 1
%36 = call i32 @strlen(i8* %30)
%37 = sext i32 %36 to i64
%38 = icmp slt i64 %35, %37
br i1 %38, label %28, label %39
39: ; preds = %28, %22
%40 = icmp eq i32 %0, 4
br i1 %40, label %41, label %56
41: ; preds = %39
%42 = getelementptr inbounds i8*, i8** %1, i64 3
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
%45 = trunc i32 %44 to i8
%46 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 1
store i8 %45, i8* %46
%47 = lshr i32 %44, 8
%48 = trunc i32 %47 to i8
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 2
store i8 %48, i8* %49
%50 = lshr i32 %44, 16
%51 = trunc i32 %50 to i8
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 3
store i8 %51, i8* %52
%53 = lshr i32 %44, 24
%54 = trunc i32 %53 to i8
%55 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 4
store i8 %54, i8* %55
br label %56
56: ; preds = %39, %41
%57 = phi i32 [ 5, %41 ], [ 1, %39 ]
%58 = call i32 @write(i32 %16, i8* %6, i32 %57)
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
%62 = call i32 @close(i32 %16)
br label %90
63: ; preds = %56
%64 = call i32 @read(i32 %16, i8* %6, i32 4)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%68 = call i32 @close(i32 %16)
br label %90
69: ; preds = %63
%70 = load i8, i8* %6
%71 = sext i8 %70 to i32
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 1
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = shl nsw i32 %74, 8
%76 = or i32 %75, %71
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 2
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = shl nsw i32 %79, 16
%81 = or i32 %76, %80
%82 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 3
%83 = load i8, i8* %82
%84 = zext i8 %83 to i32
%85 = shl nuw i32 %84, 24
%86 = or i32 %81, %85
%87 = load i8*, i8** %24
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %87, i32 %86)
%89 = call i32 @close(i32 %16)
br label %90
90: ; preds = %69, %66, %60, %18, %9
%91 = phi i32 [ -1, %9 ], [ -1, %18 ], [ -1, %60 ], [ -1, %66 ], [ 0, %69 ]
ret i32 %91
}