xunge/DecIR huggingface dataset:
/* Variables and functions */
int foo();
int main(int argc, char **argv) {
  int i, j;
  i = 0;
  j = foo();
  return i + 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit() {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit() {
%1 = call i32 (...) @endwin()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @exit(i32 0)
unreachable
}
void smartplugSet(int status) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ complain(char *, char const *);
int /*<<< orphan*/ exit(int);
scalar_t__ lseek(int, int /*<<< orphan*/, int);
void dolseek(const char *name, int fd, off_t offset, int whence) {
  if (lseek(fd, offset, whence) < 0) {
    complain("%s: lseek", name);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<dolseek>:
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    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    1177 <dolseek+0x47>
mov    -0x8(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1050 <complain@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dolseek>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <lseek@plt>
test   %rax,%rax
js     1146 <dolseek+0x16>
pop    %rbx
ret
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1050 <complain@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s: lseek\00"
define void @dolseek(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i64 @lseek(i32 %9, i32 %10, i32 %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %4
%15 = load i8*, i8** %5
%16 = call i32 @complain(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s: lseek\00"
define void @dolseek(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @lseek(i32 %1, i32 %2, i32 %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @complain(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
int sockets_exit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sockets_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sockets_exit() {
ret i32 0
}
int roadmap_alert_is_cancelable(int alertId) { return (1); }


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

x86 assembly (clang, -O2):
<roadmap_alert_is_cancelable>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @roadmap_alert_is_cancelable(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  syscall(SYS_exit, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SYS_exit = global i32 0
define i32 @main() {
%1 = load i32, i32* @SYS_exit
%2 = tail call i32 @syscall(i32 %1, i32 0)
ret i32 0
}
unsigned int test_7(unsigned int x, unsigned int y) { return x ^ (1 << y); }


x86 assembly (clang, -O0):
<test_7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_7>:
mov    %edi,%eax
btc    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_7(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_7(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t *wcpcpy(wchar_t *to, const wchar_t *from) {
  size_t n = 0;
  for (;;) {
    wchar_t wc = from[n];
    to[n] = wc;
    if (wc == L'\0')
      break;
    n++;
  }
  return to + n;
}


x86 assembly (clang, -O0):
<wcpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x0,-0x1c(%rbp)
jne    113f <wcpcpy+0x3f>
jmp    1150 <wcpcpy+0x50>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <wcpcpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcpcpy>:
mov    %rdi,%rax
add    $0xfffffffffffffffc,%rax
nopw   0x0(%rax,%rax,1)
mov    (%rsi),%ecx
mov    %ecx,0x4(%rax)
add    $0x4,%rax
add    $0x4,%rsi
test   %ecx,%ecx
jne    1110 <wcpcpy+0x10>
ret

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

LLVM IR (-O2):
define i32* @wcpcpy(i32* writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %6, i32* %7
%8 = icmp eq i32 %6, 0
%9 = add i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = getelementptr inbounds i32, i32* %0, i64 %4
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ __asm_utils_out8(int, int);
void pic_send_EOI_normal(unsigned char irq) {
  if (irq > 7) {
    __asm_utils_out8(0xA0, 0x20);
  } else {
    __asm_utils_out8(0x20, 0x20);
  }
}


x86 assembly (clang, -O0):
<pic_send_EOI_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x7,%eax
jle    113f <pic_send_EOI_normal+0x2f>
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <__asm_utils_out8@plt>
jmp    114b <pic_send_EOI_normal+0x3b>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <__asm_utils_out8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_send_EOI_normal>:
xor    %eax,%eax
cmp    $0x8,%dil
setae  %al
shl    $0x7,%eax
or     $0x20,%eax
mov    %eax,%edi
mov    $0x20,%esi
jmp    1030 <__asm_utils_out8@plt>

LLVM IR (-O0):
define void @pic_send_EOI_normal(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sgt i32 %4, 7
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @__asm_utils_out8(i32 160, i32 32)
br label %10
8: ; preds = %1
%9 = call i32 @__asm_utils_out8(i32 32, i32 32)
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @pic_send_EOI_normal(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 7
%3 = select i1 %2, i32 160, i32 32
%4 = tail call i32 @__asm_utils_out8(i32 %3, i32 32)
ret void
}
add(int a, int b) { return (int)&a[(char *)b]; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
movslq -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = inttoptr i64 %7 to i8*
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = ptrtoint i8* %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
ret i32 %8
}
void glGetBooleanv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetBooleanv() {
ret void
}
/* Variables and functions */
int zgeth1();
int zgethex() {
  int c;
  c = zgeth1();
  return c;
}


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

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

LLVM IR (-O0):
define i32 @zgethex() {
%1 = alloca i32
%2 = call i32 (...) @zgeth1()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @zgethex() {
%1 = tail call i32 (...) @zgeth1()
ret i32 %1
}
/* Variables and functions */
double ranf();
int sample_MultSym(int lo, int hi) {
  return lo + (int)(ranf() * (double)(hi - lo + 1));
}


x86 assembly (clang, -O0):
<sample_MultSym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ranf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cvtsi2sd %ecx,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_MultSym>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <ranf@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sample_MultSym(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 double (...) @ranf()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fmul double %6, %11
%13 = fptosi double %12 to i32
%14 = add nsw i32 %5, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @sample_MultSym(i32 %0, i32 %1) {
%3 = tail call double (...) @ranf()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = sitofp i32 %5 to double
%7 = fmul double %3, %6
%8 = fptosi double %7 to i32
%9 = add nsw i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
void *alloc(void *ud, void *ptr, size_t size) {
  if (!ptr) {
    return malloc(size);
  }
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <alloc+0x31>
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <alloc+0x42>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
test   %rsi,%rsi
je     1132 <alloc+0x12>
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    %rdx,%rdi
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @alloc(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i64, i64* %7
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %4
br label %16
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
store i8* null, i8** %4
br label %16
16: ; preds = %13, %10
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @alloc(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @malloc(i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @free(i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ null, %7 ], [ %6, %5 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtps_pd(int /*<<< orphan*/);
__m128d test_mm_cvtps_pd(__m128 A) { return _mm_cvtps_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtps_pd>:
jmp    1030 <_mm_cvtps_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtps_pd(i32 %0) {
%2 = tail call i32 @_mm_cvtps_pd(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_endswap_int();
int /*<<< orphan*/ test_endswap_int64_t();
int /*<<< orphan*/ test_endswap_short();
int main(void) {
  test_endswap_short();
  test_endswap_int();
  test_endswap_int64_t();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_endswap_short@plt>
xor    %eax,%eax
call   1030 <test_endswap_int@plt>
xor    %eax,%eax
call   1050 <test_endswap_int64_t@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_endswap_short()
%3 = call i32 (...) @test_endswap_int()
%4 = call i32 (...) @test_endswap_int64_t()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_endswap_short()
%2 = tail call i32 (...) @test_endswap_int()
%3 = tail call i32 (...) @test_endswap_int64_t()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int *arr, int size) {
  int ind;
  for (ind = 0; ind < size; ind++) {
    printf("%d ", arr[ind]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int sptlrpc_lproc_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sptlrpc_lproc_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sptlrpc_lproc_init() {
ret i32 0
}
void addAtRear(struct list *list, struct node *node) {}


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

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

LLVM IR (-O0):
%struct.list = type opaque
%struct.node = type opaque
define void @addAtRear(%struct.list* %0, %struct.node* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.node*
store %struct.list* %0, %struct.list** %3
store %struct.node* %1, %struct.node** %4
ret void
}

LLVM IR (-O2):
%struct.list = type opaque
%struct.node = type opaque
define void @addAtRear(%struct.list* nocapture %0, %struct.node* nocapture %1) {
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int poll(struct pollfd *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ task_yield();
int sys_poll(struct pollfd *fds, nfds_t nfds, int timeout) {
  int ret;
RETRY:
  if ((ret = poll(fds, nfds, 0)) == 0) {
    task_yield();
    goto RETRY;
  }
  return ret;
}


x86 assembly (clang, -O0):
<sys_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <poll@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    1158 <sys_poll+0x38>
mov    $0x0,%al
call   1030 <task_yield@plt>
jmp    1132 <sys_poll+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_poll>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
call   1040 <poll@plt>
test   %eax,%eax
jne    1149 <sys_poll+0x29>
xor    %eax,%eax
call   1030 <task_yield@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
jmp    1130 <sys_poll+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
define i32 @sys_poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %13, %3
%9 = load %struct.pollfd*, %struct.pollfd** %4
%10 = load i32, i32* %5
%11 = call i32 @poll(%struct.pollfd* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 (...) @task_yield()
br label %8
15: ; preds = %8
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define i32 @sys_poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = tail call i32 @poll(%struct.pollfd* %0, i32 %1, i32 0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3, %6
%7 = tail call i32 (...) @task_yield()
%8 = tail call i32 @poll(%struct.pollfd* %0, i32 %1, i32 0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %3
%11 = phi i32 [ %4, %3 ], [ %8, %6 ]
ret i32 %11
}
/* Type definitions */
struct sockaddr {
  scalar_t__ sa_family;
};

/* Variables and functions */
scalar_t__ AF_INET6;
int sfset_ipv6only(const struct sockaddr *sa, int sock) {
  int opt;
  opt = 1;
  if (sa->sa_family != AF_INET6) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<sfset_ipv6only>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ec8(%rip),%rcx
cmp    (%rcx),%rax
je     1135 <sfset_ipv6only+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <sfset_ipv6only+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfset_ipv6only>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
neg    %eax
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET6 = global i64 0
define i32 @sfset_ipv6only(%struct.sockaddr* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @AF_INET6
%6 = icmp ne i64 %4, %5
%7 = sext i1 %6 to i32
ret i32 %7
}
int Seccomp_exists() { return 1; }


x86 assembly (clang, -O0):
<Seccomp_exists>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Seccomp_exists>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Seccomp_exists() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Seccomp_exists() {
ret i32 1
}
void kset_init(struct kset *k) { return; }


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

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

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

LLVM IR (-O2):
%struct.kset = type opaque
define void @kset_init(%struct.kset* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hashable_wang_32(uint32_t a) {
  a = (a ^ 61) ^ (a >> 16);
  a = a + (a << 3);
  a = a ^ (a >> 4);
  a = a * 0x27d4eb2d;
  a = a ^ (a >> 15);
  return a;
}


x86 assembly (clang, -O0):
<hashable_wang_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x27d4eb2d,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashable_wang_32>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x27d4eb2d,%ecx,%ecx
mov    %ecx,%eax
sar    $0xf,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hashable_wang_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 61
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = xor i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = shl i32 %9, 3
%11 = add nsw i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = xor i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, 668265261
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 15
%21 = xor i32 %18, %20
store i32 %21, i32* %2
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @hashable_wang_32(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = xor i32 %3, 61
%5 = mul i32 %4, 9
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 668265261
%9 = ashr i32 %8, 15
%10 = xor i32 %9, %8
ret i32 %10
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *x = NULL;
  x = calloc(123, sizeof(char));
  printf("after calloc(): x = %p\n", x);
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x7b,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7b,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"after calloc(): x = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i8* @calloc(i32 123, i32 1)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"after calloc(): x = %p\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(123) i8* @calloc(i32 123, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
main() { return (unsigned)-3; }


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

x86 assembly (clang, -O2):
<main>:
mov    $0xfffffffd,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -3
}
/* Variables and functions */
int errno;
int sprintf(char *, char *, double);
int dtostr_(double *anum, char *field, int flen) {
  field[flen - 1] = '\0';
  char *format;
  format = "%-23.16g";
  errno = sprintf(field, format, *anum);
  return errno;
}


x86 assembly (clang, -O0):
<dtostr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0xec5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sprintf@plt>
mov    %eax,%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtostr_>:
push   %rax
mov    %rsi,%rax
movslq %edx,%rcx
movb   $0x0,-0x1(%rcx,%rsi,1)
movsd  (%rdi),%xmm0
lea    0xed9(%rip),%rsi
mov    %rax,%rdi
call   1030 <sprintf@plt>
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%-23.16g\00"
@errno = global i32 0
define i32 @dtostr_(double* %0, i8* %1, i32 %2) {
%4 = alloca double*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store double* %0, double** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 0, i8* %12
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %7
%13 = load i8*, i8** %5
%14 = load i8*, i8** %7
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = call i32 @sprintf(i8* %13, i8* %14, double %16)
store i32 %17, i32* @errno
%18 = load i32, i32* @errno
ret i32 %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"%-23.16g\00"
@errno = global i32 0
define i32 @dtostr_(double* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 0, i8* %6
%7 = load double, double* %0
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %7)
store i32 %8, i32* @errno
ret i32 %8
}
void foo(int *a) { *a = 17; }


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

x86 assembly (clang, -O2):
<foo>:
movl   $0x11,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 17, i32* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mod_sm2(uint64_t r[4], uint64_t a[8]) {
  r[0] = a[1] + a[2];
  return 0;
}


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

x86 assembly (clang, -O2):
<mp_mod_sm2>:
mov    0x10(%rsi),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mod_sm2(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 1
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mod_sm2(i64* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %1, i64 2
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
store i64 %7, i64* %0
ret i64 0
}
/* Variables and functions */
int _write_sysfs_int(char const *, char const *, int, int, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int write_sysfs_int_and_verify(const char *filename, const char *basedir,
                               int val) {
  return _write_sysfs_int(filename, basedir, val, 1, 0, 0);
}


x86 assembly (clang, -O0):
<write_sysfs_int_and_verify>:
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
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <_write_sysfs_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_int_and_verify>:
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_write_sysfs_int@plt>

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

LLVM IR (-O2):
define i32 @write_sysfs_int_and_verify(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 1, i32 0, i32 0)
ret i32 %4
}
void SysCtlGPIOAHBEnable(unsigned long ulGPIOPeripheral) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FE06C))) |= (ulGPIOPeripheral & 0x1FF);
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlGPIOAHBEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
and    $0x1ff,%rax
mov    $0x400fe06c,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fe06c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlGPIOAHBEnable>:
mov    0x400fb980,%rax
40
mov    $0xa5a5a5a5,%ecx
mov    %rcx,0x400fb980
40
and    $0x1ff,%edi
or     %rdi,0x400fe06c
40
mov    %rax,0x400fb980
40
ret

LLVM IR (-O0):
define void @SysCtlGPIOAHBEnable(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %4, i64* %3
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %5, 511
%7 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%8 = or i64 %7, %6
store volatile i64 %8, i64* inttoptr (i64 1074782316 to i64*)
%9 = load i64, i64* %3
store volatile i64 %9, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlGPIOAHBEnable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%3 = and i64 %0, 511
%4 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074782316 to i64*)
store volatile i64 %2, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
/* Variables and functions */
void pend_sv_handler(void) {
  while (true)
    ;
}


x86 assembly (clang, -O0):
<pend_sv_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <pend_sv_handler+0x9>
jmp    1109 <pend_sv_handler+0x9>

x86 assembly (clang, -O2):
<pend_sv_handler>:
jmp    1100 <pend_sv_handler>

LLVM IR (-O0):
define void @pend_sv_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @pend_sv_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ output(int);
int main(void) {
  int i;
  int sum;
  i = 1;
  sum = 0;
  while (i <= 100) {
    sum = sum + i;
    i = i + 1;
  }
  output(sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%edi
call   1030 <output@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13ba,%edi
call   1030 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = call i32 @output(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @output(i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("나의 키는\n170\n나의 몸무게\n68.600000");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"\EB\82\98\EC\9D\98 \ED\82\A4\EB\8A\94\0A170\0A\EB\82\98\EC\9D\98 \EB\AA\B8\EB\AC\B4\EA\B2\8C\0A68.600000\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"\EB\82\98\EC\9D\98 \ED\82\A4\EB\8A\94\0A170\0A\EB\82\98\EC\9D\98 \EB\AA\B8\EB\AC\B4\EA\B2\8C\0A68.600000\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct xfrm_selector {
  int dummy;
};
typedef int /*<<< orphan*/ s0;

/* Variables and functions */
scalar_t__ memcmp(struct xfrm_selector *, struct xfrm_selector *, int);
int /*<<< orphan*/ memset(struct xfrm_selector *, int /*<<< orphan*/, int);
int xfrm_selector_iszero(struct xfrm_selector *s) {
  struct xfrm_selector s0;
  memset(&s0, 0, sizeof(s0));
  return (memcmp(&s0, s, sizeof(s0)) == 0);
}


x86 assembly (clang, -O0):
<xfrm_selector_iszero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrm_selector_iszero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.xfrm_selector = type { i32 }
define i32 @xfrm_selector_iszero(%struct.xfrm_selector* %0) {
%2 = alloca %struct.xfrm_selector*
%3 = alloca %struct.xfrm_selector
store %struct.xfrm_selector* %0, %struct.xfrm_selector** %2
%4 = call i32 @memset(%struct.xfrm_selector* %3, i32 0, i32 4)
%5 = load %struct.xfrm_selector*, %struct.xfrm_selector** %2
%6 = call i64 @memcmp(%struct.xfrm_selector* %3, %struct.xfrm_selector* %5, i32 4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.xfrm_selector = type { i32 }
define i32 @xfrm_selector_iszero(%struct.xfrm_selector* %0) {
%2 = alloca %struct.xfrm_selector
%3 = bitcast %struct.xfrm_selector* %2 to i8*
%4 = call i32 @memset(%struct.xfrm_selector* %2, i32 0, i32 4)
%5 = call i64 @memcmp(%struct.xfrm_selector* %2, %struct.xfrm_selector* %0, i32 4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int MAX(int a, int b) {
  if ((a) > (b))
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <MAX+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <MAX+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MAX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @MAX(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void ipa_debugfs_remove(void) {}


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

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

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

LLVM IR (-O2):
define void @ipa_debugfs_remove() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int set_nonblock(int file_dsption) {
  int old_flg;
  old_flg = fcntl(file_dsption, F_GETFL);
  fcntl(file_dsption, F_SETFL, old_flg | O_NONBLOCK);
  return old_flg;
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    %eax,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 (i32, i32, ...) @fcntl(i32 %7, i32 %8, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %4, i32 %6)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_GetCFA() {
  char msg[] = "Aborting: "
               "_Unwind_GetCFA"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_GetCFA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x46,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x45,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_GetCFA>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa2964656c6261,%rax
mov    %rax,0x3e(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x45,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_GetCFA.msg = [70 x i8] c"Aborting: _Unwind_GetCFA called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetCFA() {
%1 = alloca [70 x i8]
%2 = bitcast [70 x i8]* %1 to i8*
%3 = getelementptr inbounds [70 x i8], [70 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 69)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_GetCFA.msg = [70 x i8] c"Aborting: _Unwind_GetCFA called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetCFA() {
%1 = alloca [70 x i8]
%2 = getelementptr inbounds [70 x i8], [70 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 69)
%4 = tail call i32 (...) @abort()
unreachable
}