xunge/DecIR huggingface dataset:
void swap(int array[], int left, int right) {
  if (left != right) {
    int tmp = array[left];
    array[left] = array[right];
    array[right] = tmp;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     114c <swap+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %edx,%esi
je     1116 <swap+0x16>
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
br label %12
12: ; preds = %5, %3
ret void
}
void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) {}


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

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

LLVM IR (-O0):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_key_add_default(%struct.ieee80211_sub_if_data* %0) {
%2 = alloca %struct.ieee80211_sub_if_data*
store %struct.ieee80211_sub_if_data* %0, %struct.ieee80211_sub_if_data** %2
ret void
}

LLVM IR (-O2):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_key_add_default(%struct.ieee80211_sub_if_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char);
void main() { printf("%d ,%d,%c ", 5, 10, '\n'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d ,%d,%c \00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5, i32 10, i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d ,%d,%c \00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5, i32 10, i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sem_unlink(char *);
main() {
  sem_unlink("EMPTY");
  sem_unlink("FULL");
  sem_unlink("MUTEX");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <sem_unlink@plt>
lea    0xed4(%rip),%rdi
call   1030 <sem_unlink@plt>
lea    0xecd(%rip),%rdi
call   1030 <sem_unlink@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <sem_unlink@plt>
lea    0xee2(%rip),%rdi
call   1030 <sem_unlink@plt>
lea    0xedb(%rip),%rdi
call   1030 <sem_unlink@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"EMPTY\00"
@.str.1 = [5 x i8] c"FULL\00"
@.str.2 = [6 x i8] c"MUTEX\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sem_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"EMPTY\00"
@.str.1 = [5 x i8] c"FULL\00"
@.str.2 = [6 x i8] c"MUTEX\00"
define i32 @main() {
%1 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int f2(const char *p) {
  int count;
  __asm__("repne scasb"
          : "=c"(count), "+D"(p)
          : "m"(*(const char(*)[48])p), "0"(-1), "a"(0));
  return -2 - count;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%ecx
xor    %eax,%eax
repnz scas %es:(%rdi),%al
mov    %ecx,-0xc(%rbp)
mov    %rdi,-0x8(%rbp)
mov    $0xfffffffe,%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
mov    $0xffffffff,%ecx
repnz scas %es:(%rdi),%al
mov    $0xfffffffe,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to [48 x i8]*
%7 = call { i32, i8* } asm "repne scasb", "={cx},={di},*m,0,{ax},1,~{dirflag},~{fpsr},~{flags}"([48 x i8]* elementtype([48 x i8]) %6, i32 -1, i32 0, i8* %4)
%8 = extractvalue { i32, i8* } %7, 0
%9 = extractvalue { i32, i8* } %7, 1
store i32 %8, i32* %3
store i8* %9, i8** %2
%10 = load i32, i32* %3
%11 = sub nsw i32 -2, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f2(i8* %0) {
%2 = bitcast i8* %0 to [48 x i8]*
%3 = tail call { i32, i8* } asm "repne scasb", "={cx},={di},*m,0,{ax},1,~{dirflag},~{fpsr},~{flags}"([48 x i8]* elementtype([48 x i8]) %2, i32 -1, i32 0, i8* %0)
%4 = extractvalue { i32, i8* } %3, 0
%5 = sub nsw i32 -2, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xbd() {
  Assert_real((iscntrl(189) == 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_iscntrl.c",
              950, ("iscntrl should be 0 for 0xbd"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xbd>:
push   %rax
mov    $0xbd,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b6,%edx
pop    %rax
jmp    1040 <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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbd\00"
define void @t_iscntrl_0xbd() {
%1 = call i64 @iscntrl(i32 189)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 950, i8* getelementptr inbounds ([29 x i8], [29 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbd\00"
define void @t_iscntrl_0xbd() {
%1 = tail call i64 @iscntrl(i32 189)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 950, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgstorib(void) { ngen("%s\t%%al,(%%edx)", "movb", 0); }


x86 assembly (clang, -O0):
<cgstorib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorib>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s\09%%al,(%%edx)\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s\09%%al,(%%edx)\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int findMin(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {2, 3, 1};
  printf("%d\n", findMin(x, sizeof(x) / sizeof(x[0])));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <findMin@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1040 <findMin@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [3 x i32] [i32 2, i32 3, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @findMin(i32* %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
unsigned int ntohl(unsigned int);
unsigned int my_ntohl(unsigned int x) { return ntohl(x); }


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

x86 assembly (clang, -O2):
<my_ntohl>:
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @my_ntohl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @my_ntohl(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ time_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, scalar_t__);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int64_t count = 0;
  time_t end;
  end = time(NULL) + 5;
  while (time(NULL) <= end)
    count++;
  printf("%ld\n", count);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
add    $0x5,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
cmp    -0x18(%rbp),%rax
jg     117c <main+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1158 <main+0x28>
mov    -0x10(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%r14
add    $0x5,%r14
mov    $0xffffffffffffffff,%rbx
nopl   0x0(%rax)
xor    %edi,%edi
call   1040 <time@plt>
add    $0x1,%rbx
cmp    %r14,%rax
jle    1150 <main+0x20>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%4 = call i64 @time(i32* null)
%5 = add nsw i64 %4, 5
store i64 %5, i64* %3
br label %6
6: ; preds = %10, %0
%7 = call i64 @time(i32* null)
%8 = load i64, i64* %3
%9 = icmp sle i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 1
store i64 %12, i64* %2
br label %6
13: ; preds = %6
%14 = load i64, i64* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = add nsw i64 %1, 5
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %7, %3 ]
%5 = tail call i64 @time(i32* null)
%6 = icmp sgt i64 %5, %2
%7 = add nuw nsw i64 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void __VERIFIER_assert(int cond) { assert(cond); }


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

x86 assembly (clang, -O2):
<__VERIFIER_assert>:
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @__VERIFIER_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @__VERIFIER_assert(i32 %0) {
%2 = tail call i32 @assert(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lsx_safe_rdft_f(int, int, float *);
void backward(int length, void *setup, float *H) {
  lsx_safe_rdft_f(length, -1, H);
  (void)setup;
}


x86 assembly (clang, -O0):
<backward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    $0xffffffff,%esi
call   1030 <lsx_safe_rdft_f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward>:
mov    $0xffffffff,%esi
jmp    1030 <lsx_safe_rdft_f@plt>

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

LLVM IR (-O2):
define void @backward(i32 %0, i8* nocapture readnone %1, float* %2) {
%4 = tail call i32 @lsx_safe_rdft_f(i32 %0, i32 -1, float* %2)
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void serial_putc(int ch) {
  int status;
  for (;;) {
    status = inb((0x3f8) + 0x05);
    if (status & 0x20) {
      outb((ch), ((0x3f8) + 0x00));
      break;
    }
  }
}


x86 assembly (clang, -O0):
<serial_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3fd,%edi
call   1040 <inb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1159 <serial_putc+0x39>
mov    -0x4(%rbp),%edi
mov    $0x3f8,%esi
call   1030 <outb@plt>
jmp    115e <serial_putc+0x3e>
jmp    112b <serial_putc+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3fd,%edi
call   1040 <inb@plt>
test   $0x20,%al
je     1130 <serial_putc+0x10>
mov    %ebx,%edi
mov    $0x3f8,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_putc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %12, %1
%5 = call i32 @inb(i32 1021)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %2
%11 = call i32 @outb(i32 %10, i32 1016)
br label %13
12: ; preds = %4
br label %4
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @serial_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @inb(i32 1021)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @outb(i32 %0, i32 1016)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void output(int start, int curr) {
  printf("%d", start);
  if (curr - start > 0) {
    printf("-%d", curr);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
jle    114f <output+0x3f>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed3(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebp,%ebx
jle    114b <output+0x2b>
lea    0xebe(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"-%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @output(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"-%d\00"
define void @output(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp sgt i32 %1, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @putchar(i32 10)
ret void
}
void cam_op() {}


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

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

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

LLVM IR (-O2):
define void @cam_op() {
ret void
}
int acpi_lpat_temp_to_raw(struct acpi_lpat_conversion_table *lpat_table,
                          int temp) {
  return 0;
}


x86 assembly (clang, -O0):
<acpi_lpat_temp_to_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.acpi_lpat_conversion_table = type opaque
define i32 @acpi_lpat_temp_to_raw(%struct.acpi_lpat_conversion_table* %0, i32 %1) {
%3 = alloca %struct.acpi_lpat_conversion_table*
%4 = alloca i32
store %struct.acpi_lpat_conversion_table* %0, %struct.acpi_lpat_conversion_table** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.acpi_lpat_conversion_table = type opaque
define i32 @acpi_lpat_temp_to_raw(%struct.acpi_lpat_conversion_table* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ log_message(char *);
int open(char *, int, int);
int atsha_try_lock_file() {
  int lock;
  lock = open("/var/run/libatsha204.lock", O_RDWR | O_CREAT, 0600);
  if (lock == -1) {
    log_message("api: try_lock: open lock file failed");
  }
  return lock;
}


x86 assembly (clang, -O0):
<atsha_try_lock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
or     (%rax),%esi
lea    0xebf(%rip),%rdi
mov    $0x180,%edx
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1164 <atsha_try_lock_file+0x44>
lea    0xebb(%rip),%rdi
call   1030 <log_message@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atsha_try_lock_file>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
mov    $0x180,%edx
call   1040 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1157 <atsha_try_lock_file+0x37>
lea    0xec8(%rip),%rdi
call   1030 <log_message@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/var/run/libatsha204.lock\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@.str.1 = [37 x i8] c"api: try_lock: open lock file failed\00"
define i32 @atsha_try_lock_file() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 384)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @log_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"/var/run/libatsha204.lock\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@.str.1 = [37 x i8] c"api: try_lock: open lock file failed\00"
define i32 @atsha_try_lock_file() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i32 384)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @log_message(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put_unaligned_le32(uint32_t val, uint8_t *buf) {
  buf[0] = (uint8_t)val;
  buf[1] = (uint8_t)(val >> 8);
  buf[2] = (uint8_t)(val >> 16);
  buf[3] = (uint8_t)(val >> 24);
}


x86 assembly (clang, -O0):
<put_unaligned_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_le32>:
movslq %edi,%rax
mov    %rax,(%rsi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rsi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rsi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rsi)
ret

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

LLVM IR (-O2):
define void @put_unaligned_le32(i32 %0, i64* nocapture writeonly %1) {
%3 = sext i32 %0 to i64
store i64 %3, i64* %1
%4 = ashr i32 %0, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %0, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %1, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %0, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %1, i64 3
store i64 %11, i64* %12
ret void
}
void troca(int *v1, int *v2) {
  int aux = *v2;
  *v2 = *v1;
  *v1 = aux;
}


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

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

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

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int regexp_compile_internal(int /*<<< orphan*/ *, char const *, int);
__attribute__((__warn_unused_result__)) bool
regexp_compile_basic(regex_t *re, const char *pattern, int flags) {
  return regexp_compile_internal(re, pattern, flags);
}


x86 assembly (clang, -O0):
<regexp_compile_basic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <regexp_compile_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regexp_compile_basic>:
jmp    1030 <regexp_compile_internal@plt>

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

LLVM IR (-O2):
define i32 @regexp_compile_basic(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @regexp_compile_internal(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_gppc_func_varchar(void) { return GppcFinfoV1(); }


x86 assembly (clang, -O0):
<pg_finfo_gppc_func_varchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GppcFinfoV1@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @pg_finfo_gppc_func_varchar() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_gppc_func_varchar() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
char decodeChar(int inputInt) {
  if (inputInt == 27 - 1) {
    return ' ';
  } else {
    return (char)(inputInt + (int)'A');
  }
}


x86 assembly (clang, -O0):
<decodeChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jne    111a <decodeChar+0x1a>
movb   $0x20,-0x1(%rbp)
jmp    1123 <decodeChar+0x23>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeChar>:
lea    0x41(%rdi),%eax
cmp    $0x1a,%edi
movzbl %al,%ecx
mov    $0x20,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @decodeChar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 26
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 32, i8* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 65
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @decodeChar(i32 %0) {
%2 = icmp eq i32 %0, 26
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 65
%5 = select i1 %2, i8 32, i8 %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ live();
int main() {
  live();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @live()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PLU_DriverIRQHandler();
__attribute__((weak)) void PLU_IRQHandler(void) { PLU_DriverIRQHandler(); }


x86 assembly (clang, -O0):
<PLU_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PLU_DriverIRQHandler@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define weak void @PLU_IRQHandler() {
%1 = call i32 (...) @PLU_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PLU_IRQHandler() {
%1 = tail call i32 (...) @PLU_DriverIRQHandler()
ret void
}
/* Variables and functions */
char *getcwd(char *, int);
char *svz_realloc(char *, int);
char *svz_getcwd(void) {
  char *buf, *dir;
  int len = 64;
  buf = dir = NULL;
  do {
    buf = svz_realloc(buf, len);
    dir = getcwd(buf, len);
    len *= 2;
  } while (dir == NULL);
  return dir;
}


x86 assembly (clang, -O0):
<svz_getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x40,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <svz_realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <getcwd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113f <svz_getcwd+0x1f>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_getcwd>:
push   %r14
push   %rbx
push   %rax
mov    $0x40,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <svz_realloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %ebx,%esi
call   1040 <getcwd@plt>
add    %ebx,%ebx
test   %rax,%rax
je     1130 <svz_getcwd+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @svz_getcwd() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
store i32 64, i32* %3
store i8* null, i8** %2
store i8* null, i8** %1
br label %4
4: ; preds = %13, %0
%5 = load i8*, i8** %1
%6 = load i32, i32* %3
%7 = call i8* @svz_realloc(i8* %5, i32 %6)
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = load i32, i32* %3
%10 = call i8* @getcwd(i8* %8, i32 %9)
store i8* %10, i8** %2
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %3
br label %13
13: ; preds = %4
%14 = load i8*, i8** %2
%15 = icmp eq i8* %14, null
br i1 %15, label %4, label %16
16: ; preds = %13
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @svz_getcwd() {
br label %1
1: ; preds = %1, %0
%2 = phi i8* [ null, %0 ], [ %4, %1 ]
%3 = phi i32 [ 64, %0 ], [ %6, %1 ]
%4 = tail call i8* @svz_realloc(i8* %2, i32 %3)
%5 = tail call i8* @getcwd(i8* %4, i32 %3)
%6 = shl nsw i32 %3, 1
%7 = icmp eq i8* %5, null
br i1 %7, label %1, label %8
8: ; preds = %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait_for_gdb_to_attach();
int main(void) {
  wait_for_gdb_to_attach();
  printf("Content-Type: text/plain;charset=us-ascii\n\n");
  printf("Hello!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <wait_for_gdb_to_attach@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <wait_for_gdb_to_attach@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\0A\00"
@.str.1 = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @wait_for_gdb_to_attach()
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"Hello!\00"
@str = [43 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @wait_for_gdb_to_attach()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int, int, int, int, char *);
void __attribute__((fastcall))
func(int param1, int param2, int param3, int param4) {
  char buf[8];
  gets(buf);
  printf("%d %d %d %d %s\n", param1, param2, param3, param4, buf);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    -0x18(%rbp),%r9
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x8(%rsp),%r12
mov    %r12,%rdi
call   1040 <gets@plt>
lea    0xeb6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %r12,%r9
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%d %d %d %d %s\0A\00"
define void @func(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [8 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %s\0A\00"
define void @func(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [8 x i8]
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print() {
  int x = 100;
  printf("print x in external function :%d \n", x);
  return 0;
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"print x in external function :%d \0A\00"
define i32 @print() {
%1 = alloca i32
store i32 100, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"print x in external function :%d \0A\00"
define i32 @print() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hash_free(void *);
void *hash_new();
int /*<<< orphan*/ hash_print(void *);
int main(int argc, char **argv) {
  void *data = hash_new();
  hash_print(data);
  hash_print(data);
  hash_free(data);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <hash_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <hash_print@plt>
mov    -0x18(%rbp),%rdi
call   1040 <hash_print@plt>
mov    -0x18(%rbp),%rdi
call   1030 <hash_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <hash_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <hash_print@plt>
mov    %rbx,%rdi
call   1040 <hash_print@plt>
mov    %rbx,%rdi
call   1030 <hash_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i8* (...) @hash_new()
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @hash_print(i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 @hash_print(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @hash_free(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @hash_new()
%4 = tail call i32 @hash_print(i8* %3)
%5 = tail call i32 @hash_print(i8* %3)
%6 = tail call i32 @hash_free(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g(int *);
void test_g() {
  int a[2];
  g(a + 1);
}


x86 assembly (clang, -O0):
<test_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_g>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <g@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_g() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = call i32 @g(i32* %3)
ret void
}

LLVM IR (-O2):
define void @test_g() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%4 = call i32 @g(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *stack, int *spointer, int operand) {
  printf("%u\n", *(stack + *spointer));
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
movslq (%rsi),%rax
mov    (%rdi,%rax,4),%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define void @print(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* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define void @print(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
float acosf(float);
float r_acos(float *x) { return (acosf(*x)); }


x86 assembly (clang, -O0):
<r_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <acosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_acos>:
movss  (%rdi),%xmm0
jmp    1030 <acosf@plt>

LLVM IR (-O0):
define float @r_acos(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @acosf(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_acos(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @acosf(float %2)
ret float %3
}
void vmi_account_time_restart_hz_timer(void) {}


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

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

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

LLVM IR (-O2):
define void @vmi_account_time_restart_hz_timer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int x = 10, y = 2, z;
  z = x + y;
  printf("%d\n", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
char *xtoa(n)
int n;
{
  static char buf[17];
  (void)sprintf(buf, "%X", (unsigned)n);
  return (buf);
}


x86 assembly (clang, -O0):
<xtoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@xtoa.buf = internal global [17 x i8] zeroinitializer
@.str = [3 x i8] c"%X\00"
define i8* @xtoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @xtoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @xtoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@xtoa.buf = internal global [17 x i8] zeroinitializer
@.str = [3 x i8] c"%X\00"
define i8* @xtoa(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @xtoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @xtoa.buf, i64 0, i64 0)
}