xunge/DecIR huggingface dataset:
int date_validation(int *digit) {
  int correct = 0, date;
  date = digit[2] * 10 + digit[3];
  if ((date >= 1 && date <= 12) || (date >= 21 && date <= 32) ||
      (date >= 41 && date <= 52))
    correct = 1;
  return correct;
}


x86 assembly (clang, -O0):
<date_validation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xa,0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1135 <date_validation+0x35>
cmpl   $0xc,-0x10(%rbp)
jle    115d <date_validation+0x5d>
cmpl   $0x15,-0x10(%rbp)
jl     1149 <date_validation+0x49>
cmpl   $0x20,-0x10(%rbp)
jle    115d <date_validation+0x5d>
cmpl   $0x29,-0x10(%rbp)
jl     1164 <date_validation+0x64>
cmpl   $0x34,-0x10(%rbp)
jg     1164 <date_validation+0x64>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_validation>:
mov    0x8(%rdi),%eax
mov    0xc(%rdi),%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%edx
add    $0xffffffff,%edx
cmp    $0xc,%edx
setb   %dil
lea    (%rcx,%rax,2),%esi
add    $0xffffffeb,%esi
cmp    $0xc,%esi
setb   %dl
or     %dil,%dl
lea    (%rcx,%rax,2),%eax
add    $0xffffffd7,%eax
cmp    $0xc,%eax
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @date_validation(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
%8 = add i32 %7, -1
%9 = icmp ult i32 %8, 12
%10 = add i32 %7, -21
%11 = icmp ult i32 %10, 12
%12 = or i1 %9, %11
%13 = add i32 %7, -41
%14 = icmp ult i32 %13, 12
%15 = select i1 %12, i1 true, i1 %14
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int utf8_strlen_screen(char const *);
int config_check_prefix_align_more(const void *pointer, void *data,
                                   struct t_config_option *option,
                                   const char *value) {
  (void)pointer;
  (void)data;
  (void)option;
  return (utf8_strlen_screen(value) == 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<config_check_prefix_align_more>:
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    -0x20(%rbp),%rdi
call   1030 <utf8_strlen_screen@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_check_prefix_align_more>:
push   %rax
mov    %rcx,%rdi
call   1030 <utf8_strlen_screen@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define i32 @config_check_prefix_align_more(i8* %0, i8* %1, %struct.t_config_option* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.t_config_option*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.t_config_option* %2, %struct.t_config_option** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.t_config_option*, %struct.t_config_option** %7
%12 = load i8*, i8** %8
%13 = call i32 @utf8_strlen_screen(i8* %12)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
ret i32 %16
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define i32 @config_check_prefix_align_more(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @utf8_strlen_screen(i8* %3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo14_call();
void foo14(void) { foo14_call(); }


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

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

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

LLVM IR (-O2):
define void @foo14() {
%1 = tail call i32 (...) @foo14_call()
ret void
}
void gtk_text_buffer_delete_selection() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_delete_selection() {
ret void
}
void copy(char *to, char *from) {
  while ((*to++ = *from++))
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <copy+0x3b>
jmp    110c <copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t GPIO_getOutputEnableMultiDio(uint32_t dioMask) {
  ;
  return ((*((volatile unsigned long *)(0x40022000 + 0x000000D0))) & dioMask);
}


x86 assembly (clang, -O0):
<GPIO_getOutputEnableMultiDio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400220d0,%eax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_getOutputEnableMultiDio>:
mov    %rdi,-0x8(%rsp)
mov    0x400220d0,%rax
40
and    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @GPIO_getOutputEnableMultiDio(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073881296 to i64*)
%4 = load volatile i64, i64* %2
%5 = and i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @GPIO_getOutputEnableMultiDio(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073881296 to i64*)
%4 = load volatile i64, i64* %2
%5 = and i64 %4, %3
ret i64 %5
}
int test_imm_63int8_reg(signed char val) {
  return ((val) & (-0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_63int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -99
%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_63int8_reg(i8 signext %0) {
%2 = and i8 %0, -99
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ued_ctrl_loop();
int /*<<< orphan*/ ued_draw_screen();
scalar_t__ ued_set_sig_hand();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  if (ued_set_sig_hand() != 0) {
  }
  ued_draw_screen();
  ued_ctrl_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ued_set_sig_hand@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
jmp    115c <main+0x2c>
mov    $0x0,%al
call   1030 <ued_draw_screen@plt>
mov    $0x0,%al
call   1050 <ued_ctrl_loop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @ued_set_sig_hand()
%4 = tail call i32 (...) @ued_draw_screen()
%5 = tail call i32 (...) @ued_ctrl_loop()
ret i32 0
}
void XUngrabButton() {}


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

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

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

LLVM IR (-O2):
define void @XUngrabButton() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int i, n;
  scanf("%d", &n);
  int a[n];
  init(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%esi
call   1030 <init@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
lea    0xed3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    -0xc(%rbp),%eax
mov    %rsp,%rdi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    -0xc(%rbp),%esi
call   1030 <init@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %8
%14 = alloca i32, i64 %12
store i64 %12, i64* %9
%15 = load i32, i32* %7
%16 = call i32 @init(i32* %14, i32 %15)
store i32 0, i32* %3
%17 = load i8*, i8** %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i32, i64 %7
%10 = load i32, i32* %3
%11 = call i32 @init(i32* %9, i32 %10)
ret i32 0
}
int gcd(int a, int b) {
  if (b)
    return gcd(b, a % b);
  else
    return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <gcd+0x31>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = call i32 @gcd(i32 %9, i32 %12)
store i32 %13, i32* %3
br label %16
14: ; preds = %2
%15 = load i32, i32* %4
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int write(int, unsigned char *, int);
void MYwrite_char(int sock, unsigned char c) {
  if (write(sock, &c, 1) < 1)
    perror("write");
}


x86 assembly (clang, -O0):
<MYwrite_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
jge    1157 <MYwrite_char+0x37>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MYwrite_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
test   %eax,%eax
jle    113b <MYwrite_char+0x1b>
pop    %rax
ret
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define void @MYwrite_char(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void bcopy(const void *src, void *dst, size_t count) {
  memmove(dst, src, count);
}


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %1, i8* %0, i64 %2)
ret void
}
int ipc(unsigned ACTION, unsigned id) {
  int type = 3;
  int v = 0;
  __asm__("movl %1,%%ebx;						"
          "	 movl %2,%%ecx;						"
          "	 movl %3,%%eax;						"
          "	 int $0x64		;				"
          "			 movl	%%eax,%0;		"
          : "=r"(v)
          : "r"(ACTION), "r"(id), "r"(type)
          : "%eax", "%ebx", "%ecx");
}


x86 assembly (clang, -O0):
<ipc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edi
mov    %edx,%ebx
mov    %esi,%ecx
mov    %edi,%eax
int    $0x64
mov    %eax,%edx
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ipc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 3, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 asm "movl $1,%ebx;\09\09\09\09\09\09\09 movl $2,%ecx;\09\09\09\09\09\09\09 movl $3,%eax;\09\09\09\09\09\09\09 int $$0x64\09\09;\09\09\09\09\09\09\09 movl\09%eax,$0;\09\09", "=r,r,r,r,~{eax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @ipc(i32 %0, i32 %1) {
%3 = tail call i32 asm "movl $1,%ebx;\09\09\09\09\09\09\09 movl $2,%ecx;\09\09\09\09\09\09\09 movl $3,%eax;\09\09\09\09\09\09\09 int $$0x64\09\09;\09\09\09\09\09\09\09 movl\09%eax,$0;\09\09", "=r,r,r,r,~{eax},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i32 3)
ret i32 undef
}
__attribute__((__no__)) void
do_nothing_small_hole_none(struct test_small_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_small_hole_none>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_small_hole_none+0x1b>
jmp    1120 <do_nothing_small_hole_none+0x20>
jmp    1120 <do_nothing_small_hole_none+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_none(%struct.test_small_hole* %0) {
%2 = alloca %struct.test_small_hole*
store %struct.test_small_hole* %0, %struct.test_small_hole** %2
%3 = load %struct.test_small_hole*, %struct.test_small_hole** %2
%4 = ptrtoint %struct.test_small_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_none(%struct.test_small_hole* nocapture %0) {
ret void
}
float derivative_logstic(float y) { return 1.0 * y * (1 - y); }


x86 assembly (clang, -O0):
<derivative_logstic>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  0xeda(%rip),%xmm1
subss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<derivative_logstic>:
movss  0xef8(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @derivative_logstic(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 1.000000e+00, %4
%6 = load float, float* %2
%7 = fsub float 1.000000e+00, %6
%8 = fpext float %7 to double
%9 = fmul double %5, %8
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @derivative_logstic(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fmul float %2, %0
ret float %3
}
int mblen(const char *s, int n) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @mblen(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void uart_print(const char *str) {
  while (*str)
    putchar(*str++);
}


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

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

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

LLVM IR (-O2):
define void @uart_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void SimpleMessage(void) {}


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

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

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

LLVM IR (-O2):
define void @SimpleMessage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ CS8;
scalar_t__ logitech_command(int, char *);
int /*<<< orphan*/ setline(int, int /*<<< orphan*/, int /*<<< orphan*/);
int warrior_init(int fd, long *id, long *extra) {
  if (logitech_command(fd, "*S"))
    return -1;
  setline(fd, CS8, B4800);
  return 0;
}


x86 assembly (clang, -O0):
<warrior_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    0xec3(%rip),%rsi
call   1030 <logitech_command@plt>
cmp    $0x0,%rax
je     1158 <warrior_init+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <warrior_init+0x59>
mov    -0x8(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
call   1040 <setline@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warrior_init>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
call   1030 <logitech_command@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     113e <warrior_init+0x1e>
pop    %rbx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1040 <setline@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"*S\00"
@CS8 = global i32 0
@B4800 = global i32 0
define i32 @warrior_init(i32 %0, i64* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i64*
store i32 %0, i32* %5
store i64* %1, i64** %6
store i64* %2, i64** %7
%8 = load i32, i32* %5
%9 = call i64 @logitech_command(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 -1, i32* %4
br label %17
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* @CS8
%15 = load i32, i32* @B4800
%16 = call i32 @setline(i32 %13, i32 %14, i32 %15)
store i32 0, i32* %4
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"*S\00"
@CS8 = global i32 0
@B4800 = global i32 0
define i32 @warrior_init(i32 %0, i64* nocapture readnone %1, i64* nocapture readnone %2) {
%4 = tail call i64 @logitech_command(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @CS8
%8 = load i32, i32* @B4800
%9 = tail call i32 @setline(i32 %0, i32 %7, i32 %8)
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %11
}
ymain(int y) { return y; }


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

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

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

LLVM IR (-O2):
define i32 @ymain(i32 returned %0) {
ret i32 %0
}
getvie_(left, right, bottom, top) short *left, *right, *bottom, *top;
{ getviewport(left, right, bottom, top); }


x86 assembly (clang, -O0):
<getvie_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1030 <getviewport@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getvie_(i16* %0, i16* %1, i16* %2, i16* %3) {
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i16*
%8 = alloca i16*
%9 = alloca i16*
store i16* %0, i16** %6
store i16* %1, i16** %7
store i16* %2, i16** %8
store i16* %3, i16** %9
%10 = load i16*, i16** %6
%11 = load i16*, i16** %7
%12 = load i16*, i16** %8
%13 = load i16*, i16** %9
%14 = call i32 (i16*, i16*, i16*, i16*, ...) bitcast (i32 (...)* @getviewport to i32 (i16*, i16*, i16*, i16*, ...)*)(i16* %10, i16* %11, i16* %12, i16* %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @getvie_(i16* %0, i16* %1, i16* %2, i16* %3) {
%5 = tail call i32 (i16*, i16*, i16*, i16*, ...) bitcast (i32 (...)* @getviewport to i32 (i16*, i16*, i16*, i16*, ...)*)(i16* %0, i16* %1, i16* %2, i16* %3)
ret i32 undef
}
void testClosureLLBLLrV(void (*closure)(long long, char, long long),
                        long long a1, char a2, long long a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureLLBLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rdx
movsbl %cl,%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLBLLrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
jmp    *%rax

LLVM IR (-O0):
define void @testClosureLLBLLrV(void (i64, i8, i64)* %0, i64 %1, i8 signext %2, i64 %3) {
%5 = alloca void (i64, i8, i64)*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i64
store void (i64, i8, i64)* %0, void (i64, i8, i64)** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i64 %3, i64* %8
%9 = load void (i64, i8, i64)*, void (i64, i8, i64)** %5
%10 = load i64, i64* %6
%11 = load i8, i8* %7
%12 = load i64, i64* %8
ret void
}

LLVM IR (-O2):
define void @testClosureLLBLLrV(void (i64, i8, i64)* nocapture %0, i64 %1, i8 signext %2, i64 %3) {
tail call void %0(i64 %1, i8 signext %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *kw_basename(char const *);
int /*<<< orphan*/ stderr;
void usage(const char *command) {
  fprintf(stderr,
          "usage %s [...] [<input-file>]\n"
          "\n"
          "  -v\n"
          "\n"
          "     verbose\n"
          "\n"
          "  -r <string>, --default-return-value <string>\n"
          "\n"
          "     Use <string> as default return value when no\n"
          "     other string matches.\n"
          "\n"
          "\n"
          "  -s <string>, --string-name <string>\n"
          "\n"
          "     Use <string> as the variable name of type `char *'.\n"
          "\n"
          "\n"
          "  -o <file>, --output-file <file>\n"
          "\n"
          "\n"
          "  <file>, --input-file <file>\n"
          "\n",
          kw_basename(command));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <kw_basename@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1030 <kw_basename@plt>
lea    0xeca(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [344 x i8] c"usage %s [...] [<input-file>]\0A\0A -v\0A\0A verbose\0A\0A -r <string>, --default-return-value <string>\0A\0A Use <string> as default return value when no\0A other string matches.\0A\0A\0A -s <string>, --string-name <string>\0A\0A Use <string> as the variable name of type `char *'.\0A\0A\0A -o <file>, --output-file <file>\0A\0A\0A <file>, --input-file <file>\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* @kw_basename(i8* %4)
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [344 x i8] c"usage %s [...] [<input-file>]\0A\0A -v\0A\0A verbose\0A\0A -r <string>, --default-return-value <string>\0A\0A Use <string> as default return value when no\0A other string matches.\0A\0A\0A -s <string>, --string-name <string>\0A\0A Use <string> as the variable name of type `char *'.\0A\0A\0A -o <file>, --output-file <file>\0A\0A\0A <file>, --input-file <file>\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @kw_basename(i8* %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dstdevpn(int /*<<< orphan*/ const, double const,
                               double const *, int /*<<< orphan*/ const);
double stdlib_strided_dstdev(const int64_t N, const double correction,
                             const double *X, const int64_t stride) {
  return stdlib_strided_dstdevpn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dstdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <stdlib_strided_dstdevpn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dstdev>:
jmp    1030 <stdlib_strided_dstdevpn@plt>

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

LLVM IR (-O2):
define double @stdlib_strided_dstdev(i32 %0, double %1, double* %2, i32 %3) {
%5 = tail call double @stdlib_strided_dstdevpn(i32 %0, double %1, double* %2, i32 %3)
ret double %5
}
void debug_truc(unsigned int val) {}


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

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

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

LLVM IR (-O2):
define void @debug_truc(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int main() {
  mkdir("chroot-breakout-dir", 0755);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"chroot-breakout-dir\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mkdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 493)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"chroot-breakout-dir\00"
define i32 @main() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 493)
ret i32 0
}
/* Variables and functions */
int errno;
int GetLastSystemError() { return errno; }


x86 assembly (clang, -O0):
<GetLastSystemError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLastSystemError>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @GetLastSystemError() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @GetLastSystemError() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t htole32(uint32_t in) {
  return ((in & 0x000000ff) << 24) | ((in & 0x0000ff00) << 8) |
         ((in & 0x00ff0000) >> 8) | ((in & 0xff000000) >> 24);
}


x86 assembly (clang, -O0):
<htole32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htole32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @htole32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @htole32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int prepouet();
int pouet() { return prepouet(); }


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

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

LLVM IR (-O0):
define i32 @pouet() {
%1 = call i32 (...) @prepouet()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pouet() {
%1 = tail call i32 (...) @prepouet()
ret i32 %1
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ time(int /*<<< orphan*/);
int surandom2(void) { srand(getpid() + time(0)); }


x86 assembly (clang, -O0):
<surandom2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <srand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<surandom2>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1050 <time@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <srand@plt>

LLVM IR (-O0):
define i32 @surandom2() {
%1 = alloca i32
%2 = call i64 (...) @getpid()
%3 = call i64 @time(i32 0)
%4 = add nsw i64 %2, %3
%5 = call i32 @srand(i64 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @surandom2() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i64 @time(i32 0)
%3 = add nsw i64 %2, %1
%4 = tail call i32 @srand(i64 %3)
ret i32 undef
}
/* Variables and functions */
int yaffs_listxattr_reldir(int /*<<< orphan*/, char const *, char *, int);
int yaffs_listxattr(const char *path, char *data, int size) {
  return yaffs_listxattr_reldir((0), path, data, size);
}


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

x86 assembly (clang, -O2):
<yaffs_listxattr>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_listxattr_reldir@plt>

LLVM IR (-O0):
define i32 @yaffs_listxattr(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 @yaffs_listxattr_reldir(i32 0, i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yaffs_listxattr(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @yaffs_listxattr_reldir(i32 0, i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct ohash {
  int dummy;
};

/* Variables and functions */
void *ohash_next(struct ohash *, unsigned int *);
void *ohash_first(struct ohash *h, unsigned int *pos) {
  *pos = 0;
  return ohash_next(h, pos);
}


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

x86 assembly (clang, -O2):
<ohash_first>:
movl   $0x0,(%rsi)
jmp    1030 <ohash_next@plt>

LLVM IR (-O0):
%struct.ohash = type { i32 }
define i8* @ohash_first(%struct.ohash* %0, i32* %1) {
%3 = alloca %struct.ohash*
%4 = alloca i32*
store %struct.ohash* %0, %struct.ohash** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 0, i32* %5
%6 = load %struct.ohash*, %struct.ohash** %3
%7 = load i32*, i32** %4
%8 = call i8* @ohash_next(%struct.ohash* %6, i32* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.ohash = type { i32 }
define i8* @ohash_first(%struct.ohash* %0, i32* %1) {
store i32 0, i32* %1
%3 = tail call i8* @ohash_next(%struct.ohash* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncat(char *dst, const char *src, size_t len) {
  size_t dst_len = strlen(dst);
  strncpy(dst + dst_len, src, len);
  return dst;
}


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

x86 assembly (clang, -O2):
<strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    (%rax,%rbx,1),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %7
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @strncpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strncpy(i8* %5, i8* %1, i64 %2)
ret i8* %0
}
/* Type definitions */
struct RNAeval_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAeval_args_info *);
int /*<<< orphan*/ clear_given(struct RNAeval_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAeval_args_info *);
void RNAeval_cmdline_parser_init(struct RNAeval_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAeval_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAeval_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAeval_args_info = type { i32 }
define void @RNAeval_cmdline_parser_init(%struct.RNAeval_args_info* %0) {
%2 = alloca %struct.RNAeval_args_info*
store %struct.RNAeval_args_info* %0, %struct.RNAeval_args_info** %2
%3 = load %struct.RNAeval_args_info*, %struct.RNAeval_args_info** %2
%4 = call i32 @clear_given(%struct.RNAeval_args_info* %3)
%5 = load %struct.RNAeval_args_info*, %struct.RNAeval_args_info** %2
%6 = call i32 @clear_args(%struct.RNAeval_args_info* %5)
%7 = load %struct.RNAeval_args_info*, %struct.RNAeval_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAeval_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAeval_args_info = type { i32 }
define void @RNAeval_cmdline_parser_init(%struct.RNAeval_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAeval_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAeval_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAeval_args_info* %0)
ret void
}
/* Variables and functions */
int dlink_delete(int /*<<< orphan*/);
int dlink_delete_first() { return dlink_delete(0); }


x86 assembly (clang, -O0):
<dlink_delete_first>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <dlink_delete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlink_delete_first>:
xor    %edi,%edi
jmp    1030 <dlink_delete@plt>

LLVM IR (-O0):
define i32 @dlink_delete_first() {
%1 = call i32 @dlink_delete(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @dlink_delete_first() {
%1 = tail call i32 @dlink_delete(i32 0)
ret i32 %1
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int nodeCapacity(int nodeSize) {
  static const int8_t capacity[27] = {1,  1,  2,  4,  4,  8,  8,  8,  8,
                                      16, 16, 16, 16, 16, 16, 16, 16, 26,
                                      26, 26, 26, 26, 26, 26, 26, 26, 26};
  assert(nodeSize >= 0 && nodeSize <= 26);
  return capacity[nodeSize];
}


x86 assembly (clang, -O0):
<nodeCapacity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <nodeCapacity+0x24>
cmpl   $0x1a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x4(%rbp),%rcx
lea    0xeb4(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nodeCapacity>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1b,%ebx
setb   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
lea    0xed5(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
@nodeCapacity.capacity = internal constant [27 x i32] [i32 1, i32 1, i32 2, i32 4, i32 4, i32 8, i32 8, i32 8, i32 8, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26]
define i32 @nodeCapacity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 26
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [27 x i32], [27 x i32]* @nodeCapacity.capacity, i64 0, i64 %13
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
@nodeCapacity.capacity = internal unnamed_addr constant [27 x i32] [i32 1, i32 1, i32 2, i32 4, i32 4, i32 8, i32 8, i32 8, i32 8, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26, i32 26]
define i32 @nodeCapacity(i32 %0) {
%2 = icmp ult i32 %0, 27
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [27 x i32], [27 x i32]* @nodeCapacity.capacity, i64 0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}