xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Serial1Baud(unsigned long);
void SetBaudCOM(int portnum, int new_baud) {
  unsigned long baud;
  portnum;
  switch (new_baud) {
  case 0x00:
    baud = 9600;
    break;
  case 0x02:
    baud = 19200;
    break;
  case 0x04:
    baud = 57600;
    break;
  case 0x06:
    baud = 115200;
    break;
  default:
    return;
  }
  Serial1Baud(baud);
}


x86 assembly (clang, -O0):
<SetBaudCOM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x6,%rax
ja     1177 <SetBaudCOM+0x67>
mov    -0x18(%rbp),%rax
lea    0xec6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x2580,-0x10(%rbp)
jmp    117c <SetBaudCOM+0x6c>
movq   $0x4b00,-0x10(%rbp)
jmp    117c <SetBaudCOM+0x6c>
movq   $0xe100,-0x10(%rbp)
jmp    117c <SetBaudCOM+0x6c>
movq   $0x1c200,-0x10(%rbp)
jmp    117c <SetBaudCOM+0x6c>
jmp    1185 <SetBaudCOM+0x75>
mov    -0x10(%rbp),%rdi
call   1030 <Serial1Baud@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBaudCOM>:
cmp    $0x6,%esi
ja     111f <SetBaudCOM+0xf>
mov    $0x55,%eax
bt     %esi,%eax
jb     1120 <SetBaudCOM+0x10>
ret
movslq %esi,%rax
lea    0xed6(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
jmp    1030 <Serial1Baud@plt>

LLVM IR (-O0):
define void @SetBaudCOM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 0, label %8
i32 2, label %9
i32 4, label %10
i32 6, label %11
]
8: ; preds = %2
store i64 9600, i64* %5
br label %13
9: ; preds = %2
store i64 19200, i64* %5
br label %13
10: ; preds = %2
store i64 57600, i64* %5
br label %13
11: ; preds = %2
store i64 115200, i64* %5
br label %13
12: ; preds = %2
br label %16
13: ; preds = %11, %10, %9, %8
%14 = load i64, i64* %5
%15 = call i32 @Serial1Baud(i64 %14)
br label %16
16: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@switch.table.SetBaudCOM = [7 x i64] [i64 9600, i64 9600, i64 19200, i64 9600, i64 57600, i64 9600, i64 115200]
define void @SetBaudCOM(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 7
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = lshr i8 85, %5
%7 = and i8 %6, 1
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = sext i32 %1 to i64
%11 = getelementptr inbounds [7 x i64], [7 x i64]* @switch.table.SetBaudCOM, i64 0, i64 %10
%12 = load i64, i64* %11
%13 = tail call i32 @Serial1Baud(i64 %12)
br label %14
14: ; preds = %4, %2, %9
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *passwd_invalid_challenge() {
  char *challenge = "00000000";
  char *ret = (char *)malloc(sizeof(char) * 9);
  strncpy(ret, challenge, 9);
  return ret;
}


x86 assembly (clang, -O0):
<passwd_invalid_challenge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x9,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passwd_invalid_challenge>:
push   %rbx
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
mov    $0x9,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"00000000\00"
define i8* @passwd_invalid_challenge() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = call i64 @malloc(i32 9)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %1
%7 = call i32 @strncpy(i8* %5, i8* %6, i32 9)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"00000000\00"
define i8* @passwd_invalid_challenge() {
%1 = tail call i64 @malloc(i32 9)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 9)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ _write_atollic(int, int /*<<< orphan*/ *, int);
int _write(int32_t file, uint8_t *ptr, int32_t len) {
  _write_atollic(file, ptr, len);
  return len;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_write_atollic@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbx
mov    %edx,%ebx
call   1030 <_write_atollic@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_write(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @_write_atollic(i32 %7, i32* %8, i32 %9)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i32* %1, i32 returned %2) {
%4 = tail call i32 @_write_atollic(i32 %0, i32* %1, i32 %2)
ret i32 %2
}
void bxfio_drop_chars(char *str, int n) {
  char *res = str + n;
  while (*res) {
    *str = *res;
    ++str;
    ++res;
  }
  *str = '\0';
}


x86 assembly (clang, -O0):
<bxfio_drop_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <bxfio_drop_chars+0x50>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <bxfio_drop_chars+0x1a>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bxfio_drop_chars>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%cl
test   %cl,%cl
je     111f <bxfio_drop_chars+0x1f>
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <bxfio_drop_chars+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @bxfio_drop_chars(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8* %9, i8** %5
br label %10
10: ; preds = %14, %2
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
store i8 %16, i8* %17
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
br label %10
22: ; preds = %10
%23 = load i8*, i8** %3
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @bxfio_drop_chars(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %2, %7
%8 = phi i8 [ %13, %7 ], [ %5, %2 ]
%9 = phi i8* [ %12, %7 ], [ %4, %2 ]
%10 = phi i8* [ %11, %7 ], [ %0, %2 ]
store i8 %8, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = phi i8* [ %0, %2 ], [ %11, %7 ]
store i8 0, i8* %16
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, struct timezone *);
time_t time(time_t *t) {
  time_t result;
  struct timeval tv;
  if (gettimeofday(&tv, (struct timezone *)NULL)) {
    result = (time_t)-1;
  } else {
    result = (time_t)tv.tv_sec;
  }
  if (t != NULL) {
    *t = result;
  }
  return result;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     1140 <time+0x30>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
jmp    1148 <time+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <time+0x4e>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
neg    %rax
sbb    %rax,%rax
or     0x8(%rsp),%rax
test   %rbx,%rbx
je     1137 <time+0x27>
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
%struct.timezone = type { i32 }
define i64 @time(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca %struct.timeval
store i64* %0, i64** %2
%5 = call i64 @gettimeofday(%struct.timeval* %4, %struct.timezone* null)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 -1, i64* %3
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i64, i64* %9
store i64 %10, i64* %3
br label %11
11: ; preds = %8, %7
%12 = load i64*, i64** %2
%13 = icmp ne i64* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %3
%16 = load i64*, i64** %2
store i64 %15, i64* %16
br label %17
17: ; preds = %14, %11
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
%struct.timezone = type { i32 }
define i64 @time(i64* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i64 @gettimeofday(%struct.timeval* %2, %struct.timezone* null)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 -1
%9 = icmp eq i64* %0, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i64 %8, i64* %0
br label %11
11: ; preds = %10, %1
ret i64 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int stat(char *, struct stat *);
int isfile(char *filename) {
  struct stat fst;
  if (stat(filename, &fst) == -1)
    return 0;
  if (S_ISREG(fst.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <isfile+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isfile+0x53>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     116c <isfile+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <isfile+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1143 <isfile+0x23>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISREG(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isfile(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
void to_host(void) {}


x86 assembly (clang, -O0):
<to_host>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_host>:
ret

LLVM IR (-O0):
define void @to_host() {
ret void
}

LLVM IR (-O2):
define void @to_host() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ r_info;
};
typedef TYPE_1__ Elf64_Rel;

/* Variables and functions */
int /*<<< orphan*/ ELF64_R_INFO(unsigned int, unsigned int);
int /*<<< orphan*/ w8(int /*<<< orphan*/);
void fn_ELF64_R_INFO(Elf64_Rel *const rp, unsigned sym, unsigned type) {
  rp->r_info = w8(ELF64_R_INFO(sym, type));
}


x86 assembly (clang, -O0):
<fn_ELF64_R_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <ELF64_R_INFO@plt>
mov    %eax,%edi
call   1030 <w8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ELF64_R_INFO>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1040 <ELF64_R_INFO@plt>
mov    %eax,%edi
call   1030 <w8@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @fn_ELF64_R_INFO(%struct.TYPE_3__* %0, i32 %1, i32 %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32
%6 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @ELF64_R_INFO(i32 %7, i32 %8)
%10 = call i32 @w8(i32 %9)
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @fn_ELF64_R_INFO(%struct.TYPE_3__* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @ELF64_R_INFO(i32 %1, i32 %2)
%5 = tail call i32 @w8(i32 %4)
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usleep(int);
int write(int, char *, int);
int portwrite2(int fd, char data2[]) {
  int len = 2, n = 0;
  n = write(fd, data2, len);
  usleep(500000);
  if (n < 0) {
    fputs("write failed!\n", stderr);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<portwrite2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    $0x7a120,%edi
call   1050 <usleep@plt>
cmpl   $0x0,-0x18(%rbp)
jge    1194 <portwrite2+0x64>
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
lea    0xe7d(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x4(%rbp)
jmp    119b <portwrite2+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portwrite2>:
push   %rbx
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,%ebx
mov    $0x7a120,%edi
call   1050 <usleep@plt>
mov    $0x1,%eax
test   %ebx,%ebx
js     1152 <portwrite2+0x22>
pop    %rbx
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
lea    0xe9e(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"write failed!\0A\00"
@stderr = global i32 0
define i32 @portwrite2(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = call i32 @usleep(i32 500000)
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 0, i32* %3
br label %19
18: ; preds = %2
store i32 1, i32* %3
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"write failed!\0A\00"
@stderr = global i32 0
define i32 @portwrite2(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 2)
%4 = tail call i32 @usleep(i32 500000)
%5 = icmp slt i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x36() {
  Assert_real((isdigit(54)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              275, ("isdigit should be 1 for 6"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
call   1030 <isdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x113,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x36>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x113,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 6\00"
define void @t_isdigit_0x36() {
%1 = call i32 @isdigit(i32 54)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 6\00"
define void @t_isdigit_0x36() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ kr_malloc_get_rss();
float kr_malloc_used_memory();
float kr_malloc_get_fragmentation_ratio(void) {
  return (float)kr_malloc_get_rss() / kr_malloc_used_memory();
}


x86 assembly (clang, -O0):
<kr_malloc_get_fragmentation_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <kr_malloc_get_rss@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <kr_malloc_used_memory@plt>
movaps %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kr_malloc_get_fragmentation_ratio>:
push   %rax
xor    %eax,%eax
call   1040 <kr_malloc_get_rss@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <kr_malloc_used_memory@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @kr_malloc_get_fragmentation_ratio() {
%1 = call i64 (...) @kr_malloc_get_rss()
%2 = sitofp i64 %1 to float
%3 = call float (...) @kr_malloc_used_memory()
%4 = fdiv float %2, %3
ret float %4
}

LLVM IR (-O2):
define float @kr_malloc_get_fragmentation_ratio() {
%1 = tail call i64 (...) @kr_malloc_get_rss()
%2 = sitofp i64 %1 to float
%3 = tail call float (...) @kr_malloc_used_memory()
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ slr_equal();
int /*<<< orphan*/ slr_greater();
int /*<<< orphan*/ slr_less();
int main() {
  slr_equal();
  slr_less();
  slr_greater();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <slr_equal@plt>
mov    $0x0,%al
call   1050 <slr_less@plt>
mov    $0x0,%al
call   1030 <slr_greater@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <slr_equal@plt>
xor    %eax,%eax
call   1050 <slr_less@plt>
xor    %eax,%eax
call   1030 <slr_greater@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @slr_equal()
%3 = call i32 (...) @slr_less()
%4 = call i32 (...) @slr_greater()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @slr_equal()
%2 = tail call i32 (...) @slr_less()
%3 = tail call i32 (...) @slr_greater()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int remove(char *);
void deleteFile(char *filepath) {
  int status = remove(filepath);
  if (status == 0)
    printf("%s file deleted successfully.\n", filepath);
  else {
    printf("Unable to delete the file\n");
    perror("Error");
  }
}


x86 assembly (clang, -O0):
<deleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1169 <deleteFile+0x39>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1183 <deleteFile+0x53>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteFile>:
push   %rbx
mov    %rdi,%rbx
call   1030 <remove@plt>
test   %eax,%eax
jne    115f <deleteFile+0x1f>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xead(%rip),%rdi
pop    %rbx
jmp    1060 <perror@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s file deleted successfully.\0A\00"
@.str.1 = [27 x i8] c"Unable to delete the file\0A\00"
@.str.2 = [6 x i8] c"Error\00"
define void @deleteFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @remove(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %14
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s file deleted successfully.\0A\00"
@.str.2 = [6 x i8] c"Error\00"
@str = [26 x i8] c"Unable to delete the file\00"
define void @deleteFile(i8* %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int file_exists(char *fileName) {
  struct stat buf;
  int i = stat(fileName, &buf);
  if (i < 0)
    return 0;
  else {
    if (S_ISDIR(buf.st_mode)) {
      return 1;
    } else {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1152 <file_exists+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1177 <file_exists+0x57>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1170 <file_exists+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1177 <file_exists+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %eax,%eax
js     1142 <file_exists+0x22>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %18
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i64 @S_ISDIR(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %2
br label %18
17: ; preds = %11
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
char *proc_search_keyword(char *, char *);
char *proc_cpu_vendor() {
  return proc_search_keyword("/proc/cpuinfo", "vendor_id");
}


x86 assembly (clang, -O0):
<proc_cpu_vendor>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
call   1030 <proc_search_keyword@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_cpu_vendor>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <proc_search_keyword@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [10 x i8] c"vendor_id\00"
define i8* @proc_cpu_vendor() {
%1 = call i8* @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [10 x i8] c"vendor_id\00"
define i8* @proc_cpu_vendor() {
%1 = tail call i8* @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ serial_write_char(char const, unsigned short const);
void serial_write_data(const char *str, const unsigned int len,
                       const unsigned short com) {
  unsigned int i = 0;
  for (; i < len; ++i, ++str) {
    serial_write_char(*str, com);
  }
}


x86 assembly (clang, -O0):
<serial_write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1165 <serial_write_data+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
movsbl %al,%edi
movzwl -0xe(%rbp),%esi
call   1030 <serial_write_char@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112d <serial_write_data+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_data>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1145 <serial_write_data+0x35>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
movzwl %dx,%ebp
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
mov    %ebp,%esi
call   1030 <serial_write_char@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <serial_write_data+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @serial_write_data(i8* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
store i32 0, i32* %7
br label %8
8: ; preds = %17, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = load i16, i16* %6
%16 = call i32 @serial_write_char(i8 signext %14, i16 zeroext %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %7
%19 = add i32 %18, 1
store i32 %19, i32* %7
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @serial_write_data(i8* nocapture %0, i32 %1, i16 zeroext %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ 0, %3 ]
%7 = phi i8* [ %11, %5 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = tail call i32 @serial_write_char(i8 signext %8, i16 zeroext %2)
%10 = add nuw i32 %6, 1
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = icmp eq i32 %10, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
void GPIOPinIntWakeUpDisable(unsigned int baseAdd, unsigned int swakeupLine,
                             unsigned int pinNumber) {
  if ((0x0) == swakeupLine) {
    (*((volatile unsigned int *)(baseAdd + (0x44 + (0 * 4))))) &=
        ~(1 << pinNumber);
  } else {
    (*((volatile unsigned int *)(baseAdd + (0x44 + (1 * 4))))) &=
        ~(1 << pinNumber);
  }
}


x86 assembly (clang, -O0):
<GPIOPinIntWakeUpDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1138 <GPIOPinIntWakeUpDisable+0x38>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
jmp    1153 <GPIOPinIntWakeUpDisable+0x53>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x48,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntWakeUpDisable>:
mov    %edx,%ecx
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    $0xfffffffe,%edx
rol    %cl,%edx
lea    (%rdi,%rax,4),%eax
add    $0x44,%eax
and    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPIOPinIntWakeUpDisable(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 0, %7
br i1 %8, label %9, label %19
9: ; preds = %3
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %4
%14 = add i32 %13, 68
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, %12
store volatile i32 %18, i32* %16
br label %29
19: ; preds = %3
%20 = load i32, i32* %6
%21 = shl i32 1, %20
%22 = xor i32 %21, -1
%23 = load i32, i32* %4
%24 = add i32 %23, 72
%25 = zext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
%27 = load volatile i32, i32* %26
%28 = and i32 %27, %22
store volatile i32 %28, i32* %26
br label %29
29: ; preds = %19, %9
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntWakeUpDisable(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = shl nuw i32 1, %2
%6 = xor i32 %5, -1
%7 = select i1 %4, i32 68, i32 72
%8 = add i32 %7, %0
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, %6
store volatile i32 %12, i32* %10
ret void
}
/* Variables and functions */
int yyparse();
main() { return yyparse(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <yyparse@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @yyparse()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
ret i32 %1
}
void XtCvtStringToCommandArgArray() {}


x86 assembly (clang, -O0):
<XtCvtStringToCommandArgArray>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XtCvtStringToCommandArgArray>:
ret

LLVM IR (-O0):
define void @XtCvtStringToCommandArgArray() {
ret void
}

LLVM IR (-O2):
define void @XtCvtStringToCommandArgArray() {
ret void
}
void redraw_after(int time) {}


x86 assembly (clang, -O0):
<redraw_after>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw_after>:
ret

LLVM IR (-O0):
define void @redraw_after(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @redraw_after(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputc(char, int /*<<< orphan*/ *);
int file_sink(void *sink_arg, char c) {
  FILE *stream = sink_arg;
  return fputc(c, stream) == EOF ? -1 : 0;
}


x86 assembly (clang, -O0):
<file_sink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    %rax,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_sink>:
push   %rax
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
call   1030 <fputc@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @file_sink(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i8, i8* %4
%9 = load i32*, i32** %5
%10 = call i64 @fputc(i8 signext %8, i32* %9)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 0
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @file_sink(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i64 @fputc(i8 signext %1, i32* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
%7 = sext i1 %6 to i32
ret i32 %7
}
void XFreeFontSet() {}


x86 assembly (clang, -O0):
<XFreeFontSet>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XFreeFontSet>:
ret

LLVM IR (-O0):
define void @XFreeFontSet() {
ret void
}

LLVM IR (-O2):
define void @XFreeFontSet() {
ret void
}
void writeb(unsigned char b, volatile void *addr) {
  *(volatile unsigned char *)addr = b;
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @writeb(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
store volatile i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @writeb(i8 zeroext %0, i8* %1) {
store volatile i8 %0, i8* %1
ret void
}
void RTReqQueueCall(void) {}


x86 assembly (clang, -O0):
<RTReqQueueCall>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTReqQueueCall>:
ret

LLVM IR (-O0):
define void @RTReqQueueCall() {
ret void
}

LLVM IR (-O2):
define void @RTReqQueueCall() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned short);
unsigned short int getreg16(unsigned long int addr) {
  unsigned short int res = *((volatile unsigned short int *)addr);
  printf("Read half word at 0x%08lx = 0x%04x.\n", addr, res);
  return res;
}


x86 assembly (clang, -O0):
<getreg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
movzwl -0xa(%rbp),%edx
call   1030 <printf@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getreg16>:
push   %rbx
mov    %rdi,%rsi
movzwl (%rdi),%eax
movzwl %ax,%ebx
lea    0xedf(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Read half word at 0x%08lx = 0x%04x.\0A\00"
define zeroext i16 @getreg16(i64 %0) {
%2 = alloca i64
%3 = alloca i16
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
store i16 %6, i16* %3
%7 = load i64, i64* %2
%8 = load i16, i16* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %7, i16 zeroext %8)
%10 = load i16, i16* %3
ret i16 %10
}

LLVM IR (-O2):
@.str = [37 x i8] c"Read half word at 0x%08lx = 0x%04x.\0A\00"
define zeroext i16 @getreg16(i64 %0) {
%2 = inttoptr i64 %0 to i16*
%3 = load volatile i16, i16* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %0, i16 zeroext %3)
ret i16 %3
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t gt_int16_t(int16_t a, int16_t b) { return a > b; }


x86 assembly (clang, -O0):
<gt_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_int16_t>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @gt_int16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gt_int16_t(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void Sys_Mkdir(char *path) {}


x86 assembly (clang, -O0):
<Sys_Mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_Mkdir>:
ret

LLVM IR (-O0):
define void @Sys_Mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @Sys_Mkdir(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "Usage: nacl [-v?] target.so\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: nacl [-v?] target.so\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: nacl [-v?] target.so\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  int i = 1337;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x539,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1337, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned long sqrt(unsigned long);
int is_prime(unsigned long int n) {
  unsigned long int d = 2;
  unsigned long int rootval = sqrt(n);
  while (d <= rootval) {
    if (n % d == 0)
      return 0;
    d++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqrt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     1172 <is_prime+0x62>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    1161 <is_prime+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1179 <is_prime+0x69>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1131 <is_prime+0x21>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sqrt@plt>
mov    $0x1,%ecx
cmp    $0x2,%rax
jb     1168 <is_prime+0x58>
mov    %rax,%rsi
mov    $0x2,%edi
nopl   0x0(%rax)
mov    %rbx,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1150 <is_prime+0x40>
mov    %rbx,%rax
xor    %edx,%edx
div    %rdi
test   %rdx,%rdx
jne    115b <is_prime+0x4b>
jmp    1166 <is_prime+0x56>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
test   %rdx,%rdx
je     1166 <is_prime+0x56>
add    $0x1,%rdi
cmp    %rsi,%rdi
jbe    1130 <is_prime+0x20>
jmp    1168 <is_prime+0x58>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_prime(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 2, i64* %4
%6 = load i64, i64* %3
%7 = call i64 @sqrt(i64 %6)
store i64 %7, i64* %5
br label %8
8: ; preds = %18, %1
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = icmp ule i64 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = urem i64 %13, %14
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %2
br label %22
18: ; preds = %12
%19 = load i64, i64* %4
%20 = add i64 %19, 1
store i64 %20, i64* %4
br label %8
21: ; preds = %8
store i32 1, i32* %2
br label %22
22: ; preds = %21, %17
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_prime(i64 %0) {
%2 = tail call i64 @sqrt(i64 %0)
%3 = icmp ult i64 %2, 2
br i1 %3, label %11, label %6
4: ; preds = %6
%5 = icmp ugt i64 %10, %2
br i1 %5, label %11, label %6
6: ; preds = %1, %4
%7 = phi i64 [ %10, %4 ], [ 2, %1 ]
%8 = urem i64 %0, %7
%9 = icmp eq i64 %8, 0
%10 = add i64 %7, 1
br i1 %9, label %11, label %4
11: ; preds = %6, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
int test_imm_95uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x95 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_95uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x95,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_95uint64_lowword_mem>:
testb  $0x95,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_95uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 149
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_95uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 149
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void INT_Excep_TMR2_CMI2A(void) {}


x86 assembly (clang, -O0):
<INT_Excep_TMR2_CMI2A>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_Excep_TMR2_CMI2A>:
ret

LLVM IR (-O0):
define void @INT_Excep_TMR2_CMI2A() {
ret void
}

LLVM IR (-O2):
define void @INT_Excep_TMR2_CMI2A() {
ret void
}
/* Variables and functions */
float M_LN10;
float logf(float);
float log10f(float x) { return (logf(x) / M_LN10); }


x86 assembly (clang, -O0):
<log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
mov    0x2eb2(%rip),%rax
divss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10f>:
push   %rax
call   1030 <logf@plt>
mov    0x2ec3(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN10 = global float 0.000000e+00
define float @log10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
%5 = load float, float* @M_LN10
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
@M_LN10 = global float 0.000000e+00
define float @log10f(float %0) {
%2 = tail call float @logf(float %0)
%3 = load float, float* @M_LN10
%4 = fdiv float %2, %3
ret float %4
}
/* Type definitions */
typedef int uid_t;
typedef int gid_t;

/* Variables and functions */
int getegid();
int geteuid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  uid_t uid = geteuid();
  gid_t gid = getegid();
  printf("uid=%d gid=%d\n", uid, gid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getegid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"uid=%d gid=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @geteuid()
store i32 %4, i32* %2
%5 = call i32 (...) @getegid()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"uid=%d gid=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 (...) @getegid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}