xunge/DecIR huggingface dataset:
unsigned long LPCChannelPoolAddressGet(unsigned long ulBase,
                                       unsigned long ulChannel) {
  unsigned long ulAddress;
  ;
  ;
  ulAddress =
      (*((volatile unsigned long *)(ulBase + 0x00000010 + (ulChannel * 0x10))));
  ulAddress = ((ulAddress & 0x00003FE0) >> (5 - 1));
  ulAddress += (ulBase + 0x00000400);
  return (ulAddress);
}


x86 assembly (clang, -O0):
<LPCChannelPoolAddressGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x3fe0,%rax
shr    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x400,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelPoolAddressGet>:
shl    $0x4,%rsi
mov    0x10(%rdi,%rsi,1),%rax
shr    $0x4,%rax
and    $0x3fe,%eax
add    %rdi,%rax
add    $0x400,%rax
ret

LLVM IR (-O0):
define i64 @LPCChannelPoolAddressGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 16
%8 = load i64, i64* %4
%9 = mul i64 %8, 16
%10 = add i64 %7, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = and i64 %13, 16352
%15 = lshr i64 %14, 4
store i64 %15, i64* %5
%16 = load i64, i64* %3
%17 = add i64 %16, 1024
%18 = load i64, i64* %5
%19 = add i64 %18, %17
store i64 %19, i64* %5
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @LPCChannelPoolAddressGet(i64 %0, i64 %1) {
%3 = add i64 %0, 16
%4 = shl i64 %1, 4
%5 = add i64 %3, %4
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = lshr i64 %7, 4
%9 = and i64 %8, 1022
%10 = add i64 %0, 1024
%11 = add i64 %10, %9
ret i64 %11
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ kill(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char str[256];
  int pid;
  printf("Target PID: ");
  gets(str);
  pid = atoi(str);
  kill(pid);
  printf("%d was killed.\n", pid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x110(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x114(%rbp)
mov    -0x114(%rbp),%edi
call   1040 <kill@plt>
mov    -0x114(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <kill@plt>
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Target PID: \00"
@.str.1 = [16 x i8] c"%d was killed.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @kill(i32 %13)
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Target PID: \00"
@.str.1 = [16 x i8] c"%d was killed.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %4)
%7 = call i32 @atoi(i8* %4)
%8 = call i32 @kill(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ screen_putchar(int /*<<< orphan*/);
void screen_puts(const char *str) {
  while (*str)
    screen_putchar(*str++);
}


x86 assembly (clang, -O0):
<screen_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <screen_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <screen_putchar@plt>
jmp    111c <screen_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <screen_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <screen_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <screen_puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @screen_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @screen_putchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @screen_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @screen_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ file_copy(char *, char *);
int /*<<< orphan*/ file_exist(char *);
int /*<<< orphan*/ file_getlocaldatabasepath(char *, int);
void db_init(void) {
  char datapath[128];
  file_getlocaldatabasepath(datapath, 128);
  if (!file_exist(datapath))
    file_copy("db/local.db", datapath);
}


x86 assembly (clang, -O0):
<db_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
mov    $0x80,%esi
call   1030 <file_getlocaldatabasepath@plt>
lea    -0x80(%rbp),%rdi
call   1050 <file_exist@plt>
cmp    $0x0,%eax
jne    116b <db_init+0x3b>
lea    -0x80(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <file_copy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_init>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <file_getlocaldatabasepath@plt>
mov    %rbx,%rdi
call   1050 <file_exist@plt>
test   %eax,%eax
jne    1163 <db_init+0x33>
lea    0xea5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <file_copy@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"db/local.db\00"
define void @db_init() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @file_getlocaldatabasepath(i8* %2, i32 128)
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = call i32 @file_exist(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%9 = call i32 @file_copy(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"db/local.db\00"
define void @db_init() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @file_getlocaldatabasepath(i8* %2, i32 128)
%4 = call i32 @file_exist(i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @file_copy(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xd2() {
  Assert_real((isxdigit(210) == 0),
              "/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_isxdigit.c",
              1055, ("isxdigit should be 0 for 0xd2"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0xd2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd2,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x41f,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0xd2>:
push   %rax
mov    $0xd2,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x41f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd2\00"
define void @t_isxdigit_0xd2() {
%1 = call i64 @isxdigit(i32 210)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1055, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd2\00"
define void @t_isxdigit_0xd2() {
%1 = tail call i64 @isxdigit(i32 210)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1055, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void INT_Excep_SCI5_RXI5(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI5_RXI5() {
ret void
}
void I_UpdateNoVsync(void) {}


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

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

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

LLVM IR (-O2):
define void @I_UpdateNoVsync() {
ret void
}
int parse_command(char *s1, char *s2) {
  int i = 0;
  while (s1[i] != 0) {
    if (s1[i] != s2[i])
      return 0;
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<parse_command>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1162 <parse_command+0x62>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1154 <parse_command+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1169 <parse_command+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <parse_command+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_command>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <parse_command+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    (%rsi,%rdx,1),%cl
jne    1123 <parse_command+0x23>
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <parse_command+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @parse_command(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %21, %27
br i1 %28, label %29, label %30
29: ; preds = %15
store i32 0, i32* %3
br label %34
30: ; preds = %15
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %7
store i32 1, i32* %3
br label %34
34: ; preds = %33, %29
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @parse_command(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %15
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %15, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, %13
%15 = add nuw i64 %10, 1
br i1 %14, label %5, label %16
16: ; preds = %9, %5, %2
%17 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ gui_final();
int /*<<< orphan*/ gui_init();
int /*<<< orphan*/ gui_start();
int main() {
  gui_init();
  gui_start();
  gui_final();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gui_init@plt>
mov    $0x0,%al
call   1050 <gui_start@plt>
mov    $0x0,%al
call   1030 <gui_final@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gui_init@plt>
xor    %eax,%eax
call   1050 <gui_start@plt>
xor    %eax,%eax
call   1030 <gui_final@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gui_init()
%3 = call i32 (...) @gui_start()
%4 = call i32 (...) @gui_final()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @gui_init()
%2 = tail call i32 (...) @gui_start()
%3 = tail call i32 (...) @gui_final()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
struct obus_bus_event {
  int dummy;
};
struct net_interface {
  int dummy;
};
struct net_bus_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ net_interface_object(struct net_interface *);
int obus_bus_event_register_object(struct obus_bus_event *, int /*<<< orphan*/);
int net_bus_event_register_interface(struct net_bus_event *bus_event,
                                     struct net_interface *object) {
  return obus_bus_event_register_object((struct obus_bus_event *)bus_event,
                                        net_interface_object(object));
}


x86 assembly (clang, -O0):
<net_bus_event_register_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <net_interface_object@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <obus_bus_event_register_object@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_bus_event_register_interface>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <net_interface_object@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <obus_bus_event_register_object@plt>

LLVM IR (-O0):
%struct.net_bus_event = type { i32 }
%struct.net_interface = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @net_bus_event_register_interface(%struct.net_bus_event* %0, %struct.net_interface* %1) {
%3 = alloca %struct.net_bus_event*
%4 = alloca %struct.net_interface*
store %struct.net_bus_event* %0, %struct.net_bus_event** %3
store %struct.net_interface* %1, %struct.net_interface** %4
%5 = load %struct.net_bus_event*, %struct.net_bus_event** %3
%6 = bitcast %struct.net_bus_event* %5 to %struct.obus_bus_event*
%7 = load %struct.net_interface*, %struct.net_interface** %4
%8 = call i32 @net_interface_object(%struct.net_interface* %7)
%9 = call i32 @obus_bus_event_register_object(%struct.obus_bus_event* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.net_bus_event = type { i32 }
%struct.net_interface = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @net_bus_event_register_interface(%struct.net_bus_event* %0, %struct.net_interface* %1) {
%3 = bitcast %struct.net_bus_event* %0 to %struct.obus_bus_event*
%4 = tail call i32 @net_interface_object(%struct.net_interface* %1)
%5 = tail call i32 @obus_bus_event_register_object(%struct.obus_bus_event* %3, i32 %4)
ret i32 %5
}
char *strcat(char *restrict __dest, const char *restrict __src) {
  char *return_value___builtin___strcat_chk$1;
  return_value___builtin___strcat_chk$1 =
      __builtin___strcat_chk(__dest, __src, 18446744073709551615ul);
  return return_value___builtin___strcat_chk$1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <__strcat_chk@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @strcat(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @__strcat_chk(i8* %6, i8* %7, i64 -1)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @strcat(i8* noalias readnone returned %0, i8* noalias nocapture %1) {
ret i8* %0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double getMilliSeconds() {
  struct timeval now;
  gettimeofday(&now, (struct timezone *)0);
  return (double)now.tv_sec * 1000.0 + now.tv_usec / 1000.0;
}


x86 assembly (clang, -O0):
<getMilliSeconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebc(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMilliSeconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @getMilliSeconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+03
%9 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %8)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @getMilliSeconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+03
%10 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %9)
ret double %10
}
void ble_rsp_flash_write_words(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_flash_write_words(i8* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long root;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_root(void *_p, unsigned long _v) {
  ((XLeaveWindowEvent *)_p)->root = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XLeaveWindowEvent_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XLeaveWindowEvent_root>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XLeaveWindowEvent_root(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_root(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int directAddressSearch(int *T, int k) { return T[k]; }


x86 assembly (clang, -O0):
<directAddressSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<directAddressSearch>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @directAddressSearch(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @directAddressSearch(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char itoc(uint8_t x, char zero) { return x == 0 ? zero : (x + '0'); }


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    1129 <itoc+0x29>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <itoc+0x33>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
lea    0x30(%rdi),%eax
test   %dil,%dil
movzbl %al,%eax
cmove  %esi,%eax
ret

LLVM IR (-O0):
define signext i8 @itoc(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
br label %15
11: ; preds = %2
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 48
br label %15
15: ; preds = %11, %8
%16 = phi i32 [ %10, %8 ], [ %14, %11 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @itoc(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 0
%4 = add i8 %0, 48
%5 = select i1 %3, i8 %1, i8 %4
ret i8 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
unsigned int le24get(void *p, uint32_t *v) {
  uint8_t *a;
  a = p;
  *v = a[0];
  *v |= a[1] << 8;
  *v |= a[2] << 16;
  return 3;
}


x86 assembly (clang, -O0):
<le24get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x8,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
shl    $0x10,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le24get>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,(%rsi)
mov    0x8(%rdi),%eax
shl    $0x10,%eax
or     %ecx,%eax
mov    %eax,(%rsi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @le24get(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = or i32 %17, %15
store i32 %18, i32* %16
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32, i32* %20
%22 = shl i32 %21, 16
%23 = load i32*, i32** %4
%24 = load i32, i32* %23
%25 = or i32 %24, %22
store i32 %25, i32* %23
ret i32 3
}

LLVM IR (-O2):
define i32 @le24get(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
store i32 %4, i32* %1
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
store i32 %9, i32* %1
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %13, %9
store i32 %14, i32* %1
ret i32 3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("An audible or visual alert: \a");
  puts("A form feed: \f");
  puts("A carriage return: \r");
  puts("A vertical tab: \v");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"An audible or visual alert: \07\00"
@.str.1 = [15 x i8] c"A form feed: \0C\00"
@.str.2 = [21 x i8] c"A carriage return: \0D\00"
@.str.3 = [18 x i8] c"A vertical tab: \0B\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [30 x i8] c"An audible or visual alert: \07\00"
@.str.1 = [15 x i8] c"A form feed: \0C\00"
@.str.2 = [21 x i8] c"A carriage return: \0D\00"
@.str.3 = [18 x i8] c"A vertical tab: \0B\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
scalar_t__ HighByte(int);
int SgnHighByte(int i) { return (signed char)HighByte(i); }


x86 assembly (clang, -O0):
<SgnHighByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <HighByte@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SgnHighByte>:
push   %rax
call   1030 <HighByte@plt>
movsbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SgnHighByte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @HighByte(i32 %3)
%5 = trunc i64 %4 to i8
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @SgnHighByte(i32 %0) {
%2 = tail call i64 @HighByte(i32 %0)
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = ashr exact i32 %4, 24
ret i32 %5
}
void foo780(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo780(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ do_aes_ctr();
scalar_t__ do_hmac_sha256();
int main(void) {
  ;
  if (do_aes_ctr()) {
    return 1;
  }
  if (do_hmac_sha256()) {
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <do_aes_ctr@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    $0x0,%al
call   1040 <do_hmac_sha256@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <do_aes_ctr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <main+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <do_hmac_sha256@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @do_aes_ctr()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %10
5: ; preds = %0
%6 = call i64 (...) @do_hmac_sha256()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @do_aes_ctr()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @do_hmac_sha256()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_number(void *p_int) { printf("%d\n", *(int *)p_int); }


x86 assembly (clang, -O0):
<print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_number>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_number(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_number(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rec(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a;
  scanf("%d", &a);
  rec(&a, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    -0x4(%rbp),%rdi
call   1040 <rec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <rec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = call i32 @rec(i32* %1, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @rec(i32* %1, i32 %4)
ret i32 0
}
void div_const_Good() {
  int a[3];
  int x = 5 / 2;
  a[x] = 0;
}


x86 assembly (clang, -O0):
<div_const_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x10(%rbp)
movslq -0x10(%rbp),%rax
movl   $0x0,-0xc(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @div_const_Good() {
%1 = alloca [3 x i32]
%2 = alloca i32
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @div_const_Good() {
ret void
}
/* Variables and functions */
int PAPI_read(int, long long *);
void PAPIF_READ(int *EventSet, long long *values, int *check) {
  *check = PAPI_read(*EventSet, values);
}


x86 assembly (clang, -O0):
<PAPIF_READ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <PAPI_read@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_READ>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_read@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_READ(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_read(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bguard2l_(float *, int *, int *, int *, int *);
void cbguard2l(float bxy[], int nx, int ny, int nxe, int nye) {
  bguard2l_(bxy, &nx, &ny, &nxe, &nye);
  return;
}


x86 assembly (clang, -O0):
<cbguard2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <bguard2l_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbguard2l>:
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <bguard2l_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @cbguard2l(float* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float* %0, float** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float*, float** %6
%12 = call i32 @bguard2l_(float* %11, i32* %7, i32* %8, i32* %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @cbguard2l(float* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 %4, i32* %9
%10 = call i32 @bguard2l_(float* %0, i32* %6, i32* %7, i32* %8, i32* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set(unsigned char *, int);
void bitmapSet(unsigned char *bitmap, int pos) {
  set(&bitmap[pos / (8 * sizeof(unsigned char))],
      pos % (8 * sizeof(unsigned char)));
}


x86 assembly (clang, -O0):
<bitmapSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shr    $0x3,%rax
add    %rax,%rdi
movslq -0xc(%rbp),%rax
and    $0x7,%rax
mov    %eax,%esi
call   1030 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmapSet>:
movslq %esi,%rsi
mov    %rsi,%rax
shr    $0x3,%rax
add    %rax,%rdi
and    $0x7,%esi
jmp    1030 <set@plt>

LLVM IR (-O0):
define void @bitmapSet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 8
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = urem i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call i32 @set(i8* %9, i32 %13)
ret void
}

LLVM IR (-O2):
define void @bitmapSet(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = tail call i32 @set(i8* %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int, int, int);
int main() {
  test(0x1000000000000000ull, 0x1000000000000000ull, 0x1234567887654321ull, 0);
  test(0x1000000000000000ull, 0x2000000000000000ull, 0x1234567887654321ull, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
mov    $0x87654321,%edx
mov    %ecx,%edi
mov    %ecx,%esi
call   1030 <test@plt>
xor    %esi,%esi
mov    $0x87654321,%edx
mov    $0x1,%ecx
mov    %esi,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x87654321,%edx
xor    %ecx,%ecx
call   1030 <test@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x87654321,%edx
mov    $0x1,%ecx
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 0, i32 0, i32 -2023406815, i32 0)
%2 = tail call i32 @test(i32 0, i32 0, i32 -2023406815, i32 1)
ret i32 0
}
void XcmsCIEuvYToCIEXYZ() {}


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

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

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

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

/* Type definitions */
struct TYPE_2__ {
  int height;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_height(void *_p, int _v) {
  ((XSizeHints *)_p)->height = (int)_v;
}


x86 assembly (clang, -O0):
<set_XSizeHints_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XSizeHints_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSizeHints_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSizeHints_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *hydrology_library_get_output_invalid_units_error(char *datatype,
                                                       char *units,
                                                       char *units_converted) {
  static char message[128];
  sprintf(message,
          "<h3>Error: Datatype of %s (stored in %s) cannot convert to units of "
          "%s</h3>",
          datatype, units, units_converted);
  return message;
}


x86 assembly (clang, -O0):
<hydrology_library_get_output_invalid_units_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0x2f09(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef6(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hydrology_library_get_output_invalid_units_error>:
push   %rbx
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f1f(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@hydrology_library_get_output_invalid_units_error.message = internal global [128 x i8] zeroinitializer
@.str = [76 x i8] c"<h3>Error: Datatype of %s (stored in %s) cannot convert to units of %s</h3>\00"
define i8* @hydrology_library_get_output_invalid_units_error(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @hydrology_library_get_output_invalid_units_error.message, i64 0, i64 0), i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @hydrology_library_get_output_invalid_units_error.message, i64 0, i64 0)
}

LLVM IR (-O2):
@hydrology_library_get_output_invalid_units_error.message = internal global [128 x i8] zeroinitializer
@.str = [76 x i8] c"<h3>Error: Datatype of %s (stored in %s) cannot convert to units of %s</h3>\00"
define i8* @hydrology_library_get_output_invalid_units_error(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @hydrology_library_get_output_invalid_units_error.message, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @hydrology_library_get_output_invalid_units_error.message, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ multi_byte;
};
struct TYPE_4__ {
  TYPE_1__ string;
};
typedef TYPE_2__ XIMText;

/* Variables and functions */
void *get_XIMText_string_multi_byte(void *_p) {
  return (void *)((XIMText *)_p)->string.multi_byte;
}


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

x86 assembly (clang, -O2):
<get_XIMText_string_multi_byte>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XIMText_string_multi_byte(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XIMText_string_multi_byte(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void safefree(char *p) {
  if (p) {
    memset(p, 0, strlen(p));
    free(p);
  }
}


x86 assembly (clang, -O0):
<safefree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <safefree+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safefree>:
test   %rdi,%rdi
je     1153 <safefree+0x23>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @safefree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @memset(i8* %6, i32 0, i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @safefree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @memset(i8* %0, i32 0, i32 %4)
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %3, %1
ret void
}