xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_8() { pic_send_EOI_normal(8); }


x86 assembly (clang, -O0):
<isr_irq_8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <pic_send_EOI_normal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr_irq_8>:
mov    $0x8,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_8() {
%1 = call i32 @pic_send_EOI_normal(i32 8)
ret void
}

LLVM IR (-O2):
define void @isr_irq_8() {
%1 = tail call i32 @pic_send_EOI_normal(i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ body();
void f_nonempty_goto_loop() {
f_nonempty_goto_loop_label:
  body();
  goto f_nonempty_goto_loop_label;
}


x86 assembly (clang, -O0):
<f_nonempty_goto_loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <f_nonempty_goto_loop+0x9>
mov    $0x0,%al
call   1030 <body@plt>
jmp    1119 <f_nonempty_goto_loop+0x9>

x86 assembly (clang, -O2):
<f_nonempty_goto_loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <body@plt>
jmp    1120 <f_nonempty_goto_loop+0x10>

LLVM IR (-O0):
define void @f_nonempty_goto_loop() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @body()
br label %1
}

LLVM IR (-O2):
define void @f_nonempty_goto_loop() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @body()
br label %1
}
/* Variables and functions */
int getarray(int *);
int /*<<< orphan*/ putarray(int *, int);
int /*<<< orphan*/ sortarray(int *, int);
int main() {
  int array[110], size;
  size = getarray(array);
  sortarray(array, size);
  putarray(array, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1c0(%rbp),%rdi
call   1050 <getarray@plt>
mov    %eax,-0x1c4(%rbp)
lea    -0x1c0(%rbp),%rdi
mov    -0x1c4(%rbp),%esi
call   1030 <sortarray@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0x1c4(%rbp),%esi
call   1040 <putarray@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x1b8,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <getarray@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <sortarray@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <putarray@plt>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [110 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [110 x i32], [110 x i32]* %2, i64 0, i64 0
%5 = call i32 @getarray(i32* %4)
store i32 %5, i32* %3
%6 = getelementptr inbounds [110 x i32], [110 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @sortarray(i32* %6, i32 %7)
%9 = getelementptr inbounds [110 x i32], [110 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @putarray(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [110 x i32]
%2 = bitcast [110 x i32]* %1 to i8*
%3 = getelementptr inbounds [110 x i32], [110 x i32]* %1, i64 0, i64 0
%4 = call i32 @getarray(i32* %3)
%5 = call i32 @sortarray(i32* %3, i32 %4)
%6 = call i32 @putarray(i32* %3, i32 %4)
ret i32 0
}
int test_imm_65uint32_mem(unsigned int *val) {
  return ((*val) & (0x65 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_65uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 101
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_setstacksize(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_gettime(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return clock_gettime(CLOCK_MONOTONIC, 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 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <clock_gettime@plt>

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

LLVM IR (-O2):
@CLOCK_MONOTONIC = global i32 0
define i32 @main() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = tail call i32 @clock_gettime(i32 %1, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ nl_fini();
int /*<<< orphan*/ v_fini_cb();
void sig_handler(int signo) {
  if (signo == SIGINT) {
    v_fini_cb();
    nl_fini();
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    1169 <sig_handler+0x39>
mov    $0x0,%al
call   1030 <v_fini_cb@plt>
mov    $0x0,%al
call   1040 <nl_fini@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
je     113e <sig_handler+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1030 <v_fini_cb@plt>
xor    %eax,%eax
call   1040 <nl_fini@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 (...) @v_fini_cb()
%8 = call i32 (...) @nl_fini()
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 (...) @v_fini_cb()
%6 = tail call i32 (...) @nl_fini()
%7 = load i32, i32* @EXIT_SUCCESS
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
int isoperator(char c) {
  if (c != '^' && c != '*' && c != '/' && c != '+' && c != '-')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<isoperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
je     1157 <isoperator+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1157 <isoperator+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1157 <isoperator+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1157 <isoperator+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     1157 <isoperator+0x57>
movl   $0x0,-0x4(%rbp)
jmp    115e <isoperator+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoperator>:
xor    %eax,%eax
add    $0xd6,%dil
cmp    $0x34,%dil
ja     1125 <isoperator+0x25>
movzbl %dil,%ecx
movabs $0x1000000000002b,%rdx
bt     %rcx,%rdx
jae    1125 <isoperator+0x25>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isoperator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 94
br i1 %6, label %7, label %24
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 42
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 47
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 43
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 45
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 0, i32* %2
br label %25
24: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @isoperator(i8 signext %0) {
switch i8 %0, label %3 [
i8 94, label %2
i8 47, label %2
i8 45, label %2
i8 43, label %2
i8 42, label %2
]
2: ; preds = %1, %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ]
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_epel_h64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h64_12_sse4() {
ret void
}
int f(const int farg[const 5]) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __stpcpy(char *, char const *);
char *strcpy(char *__restrict to, const char *__restrict from) {
  __stpcpy(to, from);
  return (to);
}


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

x86 assembly (clang, -O2):
<strcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__stpcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i32 @__stpcpy(i8* %0, i8* %1)
ret i8* %0
}
int test_imm_CCint32_reg(int val) { return ((val) & (0xCC << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_CCint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xcc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CCint32_reg>:
test   $0xcc,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CCint32_reg(i32 %0) {
%2 = and i32 %0, 204
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void err_close(int err) {
  fprintf(stderr, "CLOSE FAILED: %d!\n", err);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<err_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_close>:
push   %rbx
mov    %edi,%edx
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"CLOSE FAILED: %d!\0A\00"
define void @err_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"CLOSE FAILED: %d!\0A\00"
define void @err_close(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ detab(int);
int main(void) {
  int n = 4;
  detab(4);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @detab(i32 4)
ret i32 0
}
XDestroyWindow() {}


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

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

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

LLVM IR (-O2):
define i32 @XDestroyWindow() {
ret i32 undef
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
extern int psb_intel_opregion_setup(struct drm_device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define i32 @psb_intel_opregion_setup(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define i32 @psb_intel_opregion_setup(%struct.drm_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ slice(int *, int, int);
int main(void) {
  int myarray[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
  slice(myarray, 3, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <slice@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <slice@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.myarray = [10 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @slice(i32* %4, i32 3, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.myarray = [10 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @slice(i32* %3, i32 3, i32 6)
ret i32 0
}
/* Type definitions */
struct mldl_cfg {
  int dummy;
};
struct ext_slave_platform_data {
  int dummy;
};
struct ext_slave_descr {
  int dummy;
};

/* Variables and functions */
int mpu_set_slave_mpu3050(struct mldl_cfg *, void *, struct ext_slave_descr *,
                          struct ext_slave_platform_data *, int);
int mpu_set_slave(struct mldl_cfg *mldl_cfg, void *gyro_handle,
                  struct ext_slave_descr *slave,
                  struct ext_slave_platform_data *slave_pdata, int slave_id) {
  return mpu_set_slave_mpu3050(mldl_cfg, gyro_handle, slave, slave_pdata,
                               slave_id);
}


x86 assembly (clang, -O0):
<mpu_set_slave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <mpu_set_slave_mpu3050@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpu_set_slave>:
jmp    1030 <mpu_set_slave_mpu3050@plt>

LLVM IR (-O0):
%struct.mldl_cfg = type { i32 }
%struct.ext_slave_descr = type { i32 }
%struct.ext_slave_platform_data = type { i32 }
define i32 @mpu_set_slave(%struct.mldl_cfg* %0, i8* %1, %struct.ext_slave_descr* %2, %struct.ext_slave_platform_data* %3, i32 %4) {
%6 = alloca %struct.mldl_cfg*
%7 = alloca i8*
%8 = alloca %struct.ext_slave_descr*
%9 = alloca %struct.ext_slave_platform_data*
%10 = alloca i32
store %struct.mldl_cfg* %0, %struct.mldl_cfg** %6
store i8* %1, i8** %7
store %struct.ext_slave_descr* %2, %struct.ext_slave_descr** %8
store %struct.ext_slave_platform_data* %3, %struct.ext_slave_platform_data** %9
store i32 %4, i32* %10
%11 = load %struct.mldl_cfg*, %struct.mldl_cfg** %6
%12 = load i8*, i8** %7
%13 = load %struct.ext_slave_descr*, %struct.ext_slave_descr** %8
%14 = load %struct.ext_slave_platform_data*, %struct.ext_slave_platform_data** %9
%15 = load i32, i32* %10
%16 = call i32 @mpu_set_slave_mpu3050(%struct.mldl_cfg* %11, i8* %12, %struct.ext_slave_descr* %13, %struct.ext_slave_platform_data* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.mldl_cfg = type { i32 }
%struct.ext_slave_descr = type { i32 }
%struct.ext_slave_platform_data = type { i32 }
define i32 @mpu_set_slave(%struct.mldl_cfg* %0, i8* %1, %struct.ext_slave_descr* %2, %struct.ext_slave_platform_data* %3, i32 %4) {
%6 = tail call i32 @mpu_set_slave_mpu3050(%struct.mldl_cfg* %0, i8* %1, %struct.ext_slave_descr* %2, %struct.ext_slave_platform_data* %3, i32 %4)
ret i32 %6
}
struct netent *getnetbyname(const char *name) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.netent = type opaque
define %struct.netent* @getnetbyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.netent* null
}

LLVM IR (-O2):
%struct.netent = type opaque
define noalias %struct.netent* @getnetbyname(i8* nocapture readnone %0) {
ret %struct.netent* null
}
/* Variables and functions */
int /*<<< orphan*/ interpreter();
void reset(void) { interpreter(); }


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

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

LLVM IR (-O0):
define void @reset() {
%1 = call i32 (...) @interpreter()
ret void
}

LLVM IR (-O2):
define void @reset() {
%1 = tail call i32 (...) @interpreter()
ret void
}
void ps_put_char(ch, x, y) char ch;
float *x, *y;
{
  float xp = *x, yp = *y;
  char str[4];
  str[0] = ch;
  str[1] = '\0';
  ps_text2(str, xp, yp, 0);
}


x86 assembly (clang, -O0):
<ps_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x24(%rbp)
movb   $0x0,-0x23(%rbp)
lea    -0x24(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
xor    %esi,%esi
mov    $0x2,%al
call   1030 <ps_text2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_put_char>:
push   %rax
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
mov    %dil,0x4(%rsp)
movb   $0x0,0x5(%rsp)
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    $0x2,%al
call   1030 <ps_text2@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ps_put_char(i32 %0, float* %1, float* %2) {
%4 = alloca i8
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca [4 x i8]
%10 = trunc i32 %0 to i8
store i8 %10, i8* %4
store float* %1, float** %5
store float* %2, float** %6
%11 = load float*, float** %5
%12 = load float, float* %11
store float %12, float* %7
%13 = load float*, float** %6
%14 = load float, float* %13
store float %14, float* %8
%15 = load i8, i8* %4
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
store i8 %15, i8* %16
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 1
store i8 0, i8* %17
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%19 = load float, float* %7
%20 = fpext float %19 to double
%21 = load float, float* %8
%22 = fpext float %21 to double
%23 = call i32 (i8*, double, double, i32, ...) bitcast (i32 (...)* @ps_text2 to i32 (i8*, double, double, i32, ...)*)(i8* %18, double %20, double %22, i32 0)
ret void
}

LLVM IR (-O2):
define void @ps_put_char(i32 %0, float* nocapture %1, float* nocapture %2) {
%4 = alloca [4 x i8]
%5 = trunc i32 %0 to i8
%6 = load float, float* %1
%7 = load float, float* %2
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 %5, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 0, i8* %9
%10 = fpext float %6 to double
%11 = fpext float %7 to double
%12 = call i32 (i8*, double, double, i32, ...) bitcast (i32 (...)* @ps_text2 to i32 (i8*, double, double, i32, ...)*)(i8* %8, double %10, double %11, i32 0)
ret void
}
/* Variables and functions */
int cmp_vector_array_idxs_sum(void *, void const *, void const *);
int rcmp_vector_array_idxs_sum(void *qsort_thunk_vp, const void *xvp,
                               const void *yvp) {
  return -1 * cmp_vector_array_idxs_sum(qsort_thunk_vp, xvp, yvp);
}


x86 assembly (clang, -O0):
<rcmp_vector_array_idxs_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <cmp_vector_array_idxs_sum@plt>
imul   $0xffffffff,%eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcmp_vector_array_idxs_sum>:
push   %rax
call   1030 <cmp_vector_array_idxs_sum@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rcmp_vector_array_idxs_sum(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @cmp_vector_array_idxs_sum(i8* %0, i8* %1, i8* %2)
%5 = sub nsw i32 0, %4
ret i32 %5
}
int endsWith(char *s, char *end) {
  if (strlen(end) > strlen(s)) {
    return 0;
  } else {
    char *sEnd = s + strlen(s) - strlen(end);
    return (strcmp(sEnd, end) == 0);
  }
}


x86 assembly (clang, -O0):
<endsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1162 <endsWith+0x42>
movl   $0x0,-0x4(%rbp)
jmp    11b8 <endsWith+0x98>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r15
ja     1162 <endsWith+0x42>
add    %rcx,%rbx
sub    %r15,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @endsWith(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ugt i64 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %4
%8 = sub i64 0, %3
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %14
}
double __subdf3(double a1, double a2) { return ((float)a1 - (float)a2); }


x86 assembly (clang, -O0):
<__subdf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subdf3>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @__subdf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptrunc double %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = fsub float %6, %8
%10 = fpext float %9 to double
ret double %10
}

LLVM IR (-O2):
define double @__subdf3(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fsub float %3, %4
%6 = fpext float %5 to double
ret double %6
}
void shutdown() {}


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

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

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

LLVM IR (-O2):
define void @shutdown() {
ret void
}
int len(char *str) {
  char *s;
  for (s = str; *s && *s != '\n'; s++)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1135 <len+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <len+0x45>
jmp    115b <len+0x5b>
jmp    114a <len+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <len+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <len+0x23>
cmp    $0xa,%cl
je     1123 <len+0x23>
add    $0x1,%rax
jmp    1110 <len+0x10>
ret

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

LLVM IR (-O2):
define i32 @len(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_synchronous_connection_complete_get_link_type(const uint8_t *event) {
  return event[11];
}


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

x86 assembly (clang, -O2):
<hci_event_synchronous_connection_complete_get_link_type>:
mov    0x2c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_synchronous_connection_complete_get_link_type(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 11
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_synchronous_connection_complete_get_link_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 11
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ random;

/* Variables and functions */
int /*<<< orphan*/ slice(char *, int);
int main(void) {
  char random[] = "tiaZ1ojhHwgTuPmlSdzG2AWEhZrJ5PeA";
  int length;
  length = sizeof(random) - 16;
  slice(random, length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x21,%edx
call   1040 <memcpy@plt>
movl   $0x11,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <slice@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x20(%rsp)
mov    %rsp,%rdi
mov    $0x11,%esi
call   1030 <slice@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.random = [33 x i8] c"tiaZ1ojhHwgTuPmlSdzG2AWEhZrJ5PeA\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [33 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [33 x i8]* %2 to i8*
store i32 17, i32* %3
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @slice(i8* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.random = [33 x i8] c"tiaZ1ojhHwgTuPmlSdzG2AWEhZrJ5PeA\00"
define i32 @main() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @slice(i8* %2, i32 17)
ret i32 0
}
/* Variables and functions */
scalar_t__ again();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ hunt();
int /*<<< orphan*/ intro();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  intro();
  srand(time(NULL));
  do {
    hunt();
  } while (again());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <intro@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   1040 <hunt@plt>
mov    $0x0,%al
call   1030 <again@plt>
cmp    $0x0,%rax
jne    1186 <main+0x26>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <intro@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <hunt@plt>
xor    %eax,%eax
call   1030 <again@plt>
test   %rax,%rax
jne    1180 <main+0x20>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @intro()
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
br label %5
5: ; preds = %7, %0
%6 = call i32 (...) @hunt()
br label %7
7: ; preds = %5
%8 = call i64 (...) @again()
%9 = icmp ne i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %7
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @intro()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @hunt()
%6 = tail call i64 (...) @again()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printBitDepthError() {
  fprintf(stderr, "Unsupported bit depth encountered\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Unsupported bit depth encountered\0A\00"
define void @printBitDepthError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Unsupported bit depth encountered\0A\00"
define void @printBitDepthError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ reset();
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void fatalsig(int sig) {
  signal(sig, SIG_DFL);
  reset();
  raise(sig);
}


x86 assembly (clang, -O0):
<fatalsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1050 <reset@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatalsig>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %eax,%eax
call   1050 <reset@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @fatalsig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_DFL
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = call i32 (...) @reset()
%7 = load i32, i32* %2
%8 = call i32 @raise(i32 %7)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @fatalsig(i32 %0) {
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = tail call i32 (...) @reset()
%5 = tail call i32 @raise(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int readable_dir(const char *path) {
  DIR *dir = opendir(path);
  if (dir != NULL)
    closedir(dir);
  return dir != NULL;
}


x86 assembly (clang, -O0):
<readable_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <readable_dir+0x2d>
mov    -0x10(%rbp),%rdi
call   1040 <closedir@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readable_dir>:
push   %rbx
call   1030 <opendir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1136 <readable_dir+0x16>
mov    %rbx,%rdi
call   1040 <closedir@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readable_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @opendir(i8* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @closedir(i32* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32*, i32** %3
%13 = icmp ne i32* %12, null
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @readable_dir(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = zext i1 %3 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int /*<<< orphan*/ SYS_futex;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int *, int /*<<< orphan*/, int,
                           int /*<<< orphan*/ *);
void futex_wait(int *addr) { syscall(SYS_futex, addr, FUTEX_WAIT, 2, NULL); }


x86 assembly (clang, -O0):
<futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wait>:
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_WAIT = global i32 0
define void @futex_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @SYS_futex
%4 = load i32*, i32** %2
%5 = load i32, i32* @FUTEX_WAIT
%6 = call i32 @syscall(i32 %3, i32* %4, i32 %5, i32 2, i32* null)
ret void
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_WAIT = global i32 0
define void @futex_wait(i32* %0) {
%2 = load i32, i32* @SYS_futex
%3 = load i32, i32* @FUTEX_WAIT
%4 = tail call i32 @syscall(i32 %2, i32* %0, i32 %3, i32 2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int main_() {
  MAIN__();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @main_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
void caller_2_1_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_2_1_2_1() {
ret void
}
int test_u(unsigned int x) {
  return __builtin_abs(x) + __builtin_clz(x) + __builtin_ctz(x) +
         __builtin_ffs(x) + __builtin_parity(x) + __builtin_popcount(x);
}


x86 assembly (clang, -O0):
<test_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
mov    -0x4(%rbp),%ecx
bsr    %ecx,%ecx
xor    $0x1f,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
bsf    %ecx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%esi
bsf    %esi,%ecx
add    $0x1,%ecx
xor    %edx,%edx
cmp    $0x0,%esi
cmove  %edx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    %edx,%ecx
shr    %ecx
and    $0x55555555,%ecx
sub    %ecx,%edx
mov    %edx,%ecx
and    $0x33333333,%ecx
shr    $0x2,%edx
and    $0x33333333,%edx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
add    %edx,%ecx
and    $0xf0f0f0f,%ecx
imul   $0x1010101,%ecx,%ecx
shr    $0x18,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    %edx,%ecx
shr    %ecx
and    $0x55555555,%ecx
sub    %ecx,%edx
mov    %edx,%ecx
and    $0x33333333,%ecx
shr    $0x2,%edx
and    $0x33333333,%edx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
add    %edx,%ecx
and    $0xf0f0f0f,%ecx
imul   $0x1010101,%ecx,%ecx
shr    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_u>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
bsr    %edi,%eax
xor    $0x1f,%eax
add    %ecx,%eax
bsf    %edi,%edx
add    %edx,%eax
test   %edi,%edi
mov    $0xffffffff,%ecx
cmovne %edx,%ecx
mov    %edi,%edx
shr    %edx
and    $0x55555555,%edx
sub    %edx,%edi
mov    %edi,%edx
and    $0x33333333,%edx
shr    $0x2,%edi
and    $0x33333333,%edi
add    %edx,%edi
mov    %edi,%edx
shr    $0x4,%edx
add    %edi,%edx
and    $0xf0f0f0f,%edx
imul   $0x1010101,%edx,%edx
shr    $0x18,%edx
add    %edx,%eax
and    $0x1,%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = icmp slt i32 %3, 0
%6 = select i1 %5, i32 %4, i32 %3
%7 = load i32, i32* %2
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
%9 = add nsw i32 %6, %8
%10 = load i32, i32* %2
%11 = call i32 @llvm.cttz.i32(i32 %10, i1 true)
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %2
%14 = call i32 @llvm.cttz.i32(i32 %13, i1 true)
%15 = add i32 %14, 1
%16 = icmp eq i32 %13, 0
%17 = select i1 %16, i32 0, i32 %15
%18 = add nsw i32 %12, %17
%19 = load i32, i32* %2
%20 = call i32 @llvm.ctpop.i32(i32 %19)
%21 = and i32 %20, 1
%22 = add nsw i32 %18, %21
%23 = load i32, i32* %2
%24 = call i32 @llvm.ctpop.i32(i32 %23)
%25 = add nsw i32 %22, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_u(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%4 = add nuw nsw i32 %2, %3
%5 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%6 = add nuw nsw i32 %4, %5
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32 0, i32 %7
%10 = tail call i32 @llvm.ctpop.i32(i32 %0)
%11 = and i32 %10, 1
%12 = add nuw i32 %6, %10
%13 = add nuw i32 %12, %11
%14 = add nuw i32 %13, %9
ret i32 %14
}
foo(int *p) { *p = 10; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0) {
store i32 10, i32* %0
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) size_t
softboundcets_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return fread(ptr, size, nmemb, stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_fread>:
jmp    1030 <fread@plt>

LLVM IR (-O0):
define weak i64 @softboundcets_fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define weak i64 @softboundcets_fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_mutex_unlock(int /*<<< orphan*/ *);
void spin_unlock(pthread_mutex_t *lp) {
  if (pthread_mutex_unlock(lp) != 0) {
    perror("pthread_mutex_unlock");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<spin_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
cmp    $0x0,%rax
je     1165 <spin_unlock+0x35>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_unlock>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
test   %rax,%rax
jne    113d <spin_unlock+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @spin_unlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_unlock(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @spin_unlock(i32* %0) {
%2 = tail call i64 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}