xunge/DecIR huggingface dataset:
int dec(int *ptr) {
  int i;
  i = -1;
  asm volatile("lock xaddl %0, %1" : "+r"(i), "+m"(*ptr) : : "memory");
  return i;
}


x86 assembly (clang, -O0):
<dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
lock xadd %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @dec(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 -1, i32* %3
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = call i32 asm sideeffect "lock xaddl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32 %4, i32* elementtype(i32) %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @dec(i32* %0) {
%2 = tail call i32 asm sideeffect "lock xaddl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 -1, i32* elementtype(i32) %0)
ret i32 %2
}
void gtk_tree_drag_source_row_draggable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_drag_source_row_draggable() {
ret void
}
double rosenbrockFunctionUpperRangeBound(int dimension) { return (1e+308); }


x86 assembly (clang, -O0):
<rosenbrockFunctionUpperRangeBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rosenbrockFunctionUpperRangeBound>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rosenbrockFunctionUpperRangeBound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret double 1.000000e+308
}

LLVM IR (-O2):
define double @rosenbrockFunctionUpperRangeBound(i32 %0) {
ret double 1.000000e+308
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int maius(char ka) {
  if (strchr("ABCDEFGHIJKLMN\321OPQRSTUVWXYZ", ka) != NULL)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<maius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1144 <maius+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <maius+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maius>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"ABCDEFGHIJKLMN\D1OPQRSTUVWXYZ\00"
define i32 @maius(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32* @strchr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [28 x i8] c"ABCDEFGHIJKLMN\D1OPQRSTUVWXYZ\00"
define i32 @maius(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
int let_strategy(float expr_result) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @let_strategy(float %0) {
ret i32 0
}
/* Type definitions */
struct chat_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chat_printf(char *, char *);
int /*<<< orphan*/ file_cleanup(struct chat_data *);
void file_denied(struct chat_data *buddy, char *txt) {
  chat_printf("%s", txt);
  file_cleanup(buddy);
}


x86 assembly (clang, -O0):
<file_denied>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <chat_printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <file_cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_denied>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <chat_printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <file_cleanup@plt>

LLVM IR (-O0):
%struct.chat_data = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @file_denied(%struct.chat_data* %0, i8* %1) {
%3 = alloca %struct.chat_data*
%4 = alloca i8*
store %struct.chat_data* %0, %struct.chat_data** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @chat_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load %struct.chat_data*, %struct.chat_data** %3
%8 = call i32 @file_cleanup(%struct.chat_data* %7)
ret void
}

LLVM IR (-O2):
%struct.chat_data = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @file_denied(%struct.chat_data* %0, i8* %1) {
%3 = tail call i32 @chat_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @file_cleanup(%struct.chat_data* %0)
ret void
}
/* Variables and functions */
double sqrt(double);
double cbuiltin_sqrt(double x) { return sqrt(x); }


x86 assembly (clang, -O0):
<cbuiltin_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuiltin_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <cbuiltin_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @cbuiltin_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int FUTEX_PRIVATE_FLAG;
int FUTEX_WAKE;
int futex(int *, int, int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
          int /*<<< orphan*/);
int futex_wake(int *uaddr, int to_wake) {
  return futex(uaddr, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, to_wake, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_wake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <futex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wake>:
mov    0x2eb9(%rip),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    %eax,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <futex@plt>

LLVM IR (-O0):
@FUTEX_WAKE = global i32 0
@FUTEX_PRIVATE_FLAG = global i32 0
define i32 @futex_wake(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @FUTEX_WAKE
%7 = load i32, i32* @FUTEX_PRIVATE_FLAG
%8 = or i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @futex(i32* %5, i32 %8, i32 %9, i32* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@FUTEX_WAKE = global i32 0
@FUTEX_PRIVATE_FLAG = global i32 0
define i32 @futex_wake(i32* %0, i32 %1) {
%3 = load i32, i32* @FUTEX_WAKE
%4 = load i32, i32* @FUTEX_PRIVATE_FLAG
%5 = or i32 %4, %3
%6 = tail call i32 @futex(i32* %0, i32 %5, i32 %1, i32* null, i32* null, i32 0)
ret i32 %6
}
int xmlUCSIsCatZp(int code) { return ((code == 0x2029)); }


x86 assembly (clang, -O0):
<xmlUCSIsCatZp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2029,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCatZp>:
xor    %eax,%eax
cmp    $0x2029,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCatZp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 8233
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @xmlUCSIsCatZp(i32 %0) {
%2 = icmp eq i32 %0, 8233
%3 = zext i1 %2 to i32
ret i32 %3
}
char encoderfn_raw(char byte) { return byte; }


x86 assembly (clang, -O0):
<encoderfn_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @encoderfn_raw(i8 returned signext %0) {
ret i8 %0
}
int PopCnt(long word) {
  long dummy, dummy2, dummy3;
  asm("          xorq    %0, %0    "
      "\n\t"
      "          testq   %1, %1    "
      "\n\t"
      "          jz      2f        "
      "\n\t"
      "1:        leaq    -1(%1),%2 "
      "\n\t"
      "          incq    %0        "
      "\n\t"
      "          andq    %2, %1    "
      "\n\t"
      "          jnz     1b        "
      "\n\t"
      "2:                          "
      "\n\t"
      : "=&r"(dummy), "=&r"(dummy2), "=&r"(dummy3)
      : "1"((long)(word))
      : "cc");
  return (dummy);
}


x86 assembly (clang, -O0):
<PopCnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %rdx,%rdx
test   %rcx,%rcx
je     1128 <PopCnt+0x28>
lea    -0x1(%rcx),%rax
inc    %rdx
and    %rax,%rcx
jne    1118 <PopCnt+0x18>
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopCnt>:
xor    %rax,%rax
test   %rdi,%rdi
je     1114 <PopCnt+0x14>
lea    -0x1(%rdi),%rcx
inc    %rax
and    %rcx,%rdi
jne    1108 <PopCnt+0x8>
ret

LLVM IR (-O0):
define i32 @PopCnt(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = call { i64, i64, i64 } asm " xorq $0, $0 \0A\09 testq $1, $1 \0A\09 jz 2f \0A\091: leaq -1($1),$2 \0A\09 incq $0 \0A\09 andq $2, $1 \0A\09 jnz 1b \0A\092: \0A\09", "=&r,=&r,=&r,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %6)
%8 = extractvalue { i64, i64, i64 } %7, 0
%9 = extractvalue { i64, i64, i64 } %7, 1
%10 = extractvalue { i64, i64, i64 } %7, 2
store i64 %8, i64* %3
store i64 %9, i64* %4
store i64 %10, i64* %5
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @PopCnt(i64 %0) {
%2 = tail call { i64, i64, i64 } asm " xorq $0, $0 \0A\09 testq $1, $1 \0A\09 jz 2f \0A\091: leaq -1($1),$2 \0A\09 incq $0 \0A\09 andq $2, $1 \0A\09 jnz 1b \0A\092: \0A\09", "=&r,=&r,=&r,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0)
%3 = extractvalue { i64, i64, i64 } %2, 0
%4 = trunc i64 %3 to i32
ret i32 %4
}
void update_channels(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @update_channels() {
ret void
}
/* Variables and functions */
char *dir_name(char const *);
int /*<<< orphan*/ free(char *);
char *parent_dir_name(const char *path) {
  char *dir;
  char *parent_dir;
  dir = dir_name(path);
  if (!dir)
    return NULL;
  parent_dir = dir_name(dir);
  free(dir);
  return parent_dir;
}


x86 assembly (clang, -O0):
<parent_dir_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dir_name@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <parent_dir_name+0x31>
movq   $0x0,-0x8(%rbp)
jmp    116f <parent_dir_name+0x4f>
mov    -0x18(%rbp),%rdi
call   1040 <dir_name@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_dir_name>:
push   %r14
push   %rbx
push   %rax
call   1040 <dir_name@plt>
test   %rax,%rax
je     1149 <parent_dir_name+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dir_name@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    114b <parent_dir_name+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @parent_dir_name(i8* %0) {
%2 = tail call i8* @dir_name(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8* @dir_name(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %8
}
int test_imm_14uint16_reg(unsigned short val) {
  return ((val) & (-0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffec,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14uint16_reg>:
test   $0xffec,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_14uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -20
%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_14uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -20
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int PDC_get_font() {}


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

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

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

LLVM IR (-O2):
define i32 @PDC_get_font() {
ret i32 undef
}
int scale_to_y_pixel(double y) { return (int)((480 / 2) * (1 - y)); }


x86 assembly (clang, -O0):
<scale_to_y_pixel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_to_y_pixel>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @scale_to_y_pixel(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = fmul double 2.400000e+02, %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @scale_to_y_pixel(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, 2.400000e+02
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ bar(int, int /*<<< orphan*/);
int main(void) {
  bar(1, 0);
  abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <bar@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 1, i32 0)
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_ver(void) { printf("floop version %s\n", "0.2.1"); }


x86 assembly (clang, -O0):
<show_ver>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_ver>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"floop version %s\0A\00"
@.str.1 = [6 x i8] c"0.2.1\00"
define void @show_ver() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"floop version %s\0A\00"
@.str.1 = [6 x i8] c"0.2.1\00"
define void @show_ver() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void CAN1_RX0_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @CAN1_RX0_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void darEspacos(int i) {
  while (i > 0) {
    printf("  ");
    i--;
  }
  return;
}


x86 assembly (clang, -O0):
<darEspacos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <darEspacos+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <darEspacos+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darEspacos>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <darEspacos+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <darEspacos+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @darEspacos(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ __utmpx_to_utmp(struct utmpx const *, struct utmp *);
int /*<<< orphan*/ memset(struct utmp *, char, int);
void getutmp(const struct utmpx *utmpx, struct utmp *utmp) {
  if (__utmpx_to_utmp(utmpx, utmp) < 0)
    memset(utmp, '\0', sizeof(struct utmp));
}


x86 assembly (clang, -O0):
<getutmp>:
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   1040 <__utmpx_to_utmp@plt>
cmp    $0x0,%rax
jge    1157 <getutmp+0x37>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getutmp>:
push   %rbx
mov    %rsi,%rbx
call   1040 <__utmpx_to_utmp@plt>
test   %rax,%rax
js     1130 <getutmp+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @getutmp(%struct.utmpx* %0, %struct.utmp* %1) {
%3 = alloca %struct.utmpx*
%4 = alloca %struct.utmp*
store %struct.utmpx* %0, %struct.utmpx** %3
store %struct.utmp* %1, %struct.utmp** %4
%5 = load %struct.utmpx*, %struct.utmpx** %3
%6 = load %struct.utmp*, %struct.utmp** %4
%7 = call i64 @__utmpx_to_utmp(%struct.utmpx* %5, %struct.utmp* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load %struct.utmp*, %struct.utmp** %4
%11 = call i32 @memset(%struct.utmp* %10, i8 signext 0, i32 4)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @getutmp(%struct.utmpx* %0, %struct.utmp* %1) {
%3 = tail call i64 @__utmpx_to_utmp(%struct.utmpx* %0, %struct.utmp* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @memset(%struct.utmp* %1, i8 signext 0, i32 4)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int do_make_dict(char *word, size_t word_size, char *ret_record,
                 size_t return_size, void *data) {
  assert(word_size <= return_size);
  assert(word != NULL);
  assert(ret_record != NULL);
  memcpy(ret_record, word, word_size);
  return -4;
}


x86 assembly (clang, -O0):
<do_make_dict>:
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    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    $0xfffffffc,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_make_dict>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    %rcx,%rsi
setbe  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
mov    $0xfffffffc,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @do_make_dict(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i64, i64* %7
%12 = load i64, i64* %9
%13 = icmp ule i64 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i8*, i8** %8
%21 = icmp ne i8* %20, null
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i8*, i8** %8
%25 = load i8*, i8** %6
%26 = load i64, i64* %7
%27 = call i32 @memcpy(i8* %24, i8* %25, i64 %26)
ret i32 -4
}

LLVM IR (-O2):
define i32 @do_make_dict(i8* %0, i64 %1, i8* %2, i64 %3, i8* nocapture readnone %4) {
%6 = icmp ule i64 %1, %3
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = icmp ne i8* %0, null
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = icmp ne i8* %2, null
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @memcpy(i8* %2, i8* %0, i64 %1)
ret i32 -4
}
/* Variables and functions */
int inw_p(int);
int /*<<< orphan*/ outw_p(int, int);
int from_gps(int add) {
  outw_p(add, 0x304);
  return (inw_p(0x308));
}


x86 assembly (clang, -O0):
<from_gps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x304,%esi
call   1040 <outw_p@plt>
mov    $0x308,%edi
call   1030 <inw_p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_gps>:
push   %rax
mov    $0x304,%esi
call   1040 <outw_p@plt>
mov    $0x308,%edi
pop    %rax
jmp    1030 <inw_p@plt>

LLVM IR (-O0):
define i32 @from_gps(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @outw_p(i32 %3, i32 772)
%5 = call i32 @inw_p(i32 776)
ret i32 %5
}

LLVM IR (-O2):
define i32 @from_gps(i32 %0) {
%2 = tail call i32 @outw_p(i32 %0, i32 772)
%3 = tail call i32 @inw_p(i32 776)
ret i32 %3
}
void parse_config_file(const char *filename) {}


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

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

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

LLVM IR (-O2):
define void @parse_config_file(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *path_concat(char const *, char const *, char **);
int /*<<< orphan*/ xalloc_die();
char *xpath_concat(const char *dir, const char *base, char **base_in_result) {
  char *res = path_concat(dir, base, base_in_result);
  if (res)
    return res;
  xalloc_die();
}


x86 assembly (clang, -O0):
<xpath_concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <path_concat@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1161 <xpath_concat+0x41>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <xpath_concat+0x48>
mov    $0x0,%al
call   1040 <xalloc_die@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpath_concat>:
push   %rbx
call   1030 <path_concat@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xpath_concat+0x15>
xor    %eax,%eax
call   1040 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xpath_concat(i8* %0, i8* %1, i8** %2) {
%4 = tail call i8* @path_concat(i8* %0, i8* %1, i8** %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @xalloc_die()
br label %8
8: ; preds = %3, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_type(char *type) { write("csv-task.csv", "%s,", type); }


x86 assembly (clang, -O0):
<function_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_type>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_type(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_scope();
int /*<<< orphan*/ unset_act_func();
void exit_function_scope() {
  unset_act_func();
  exit_scope();
}


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

x86 assembly (clang, -O2):
<exit_function_scope>:
push   %rax
xor    %eax,%eax
call   1030 <unset_act_func@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <exit_scope@plt>

LLVM IR (-O0):
define void @exit_function_scope() {
%1 = call i32 (...) @unset_act_func()
%2 = call i32 (...) @exit_scope()
ret void
}

LLVM IR (-O2):
define void @exit_function_scope() {
%1 = tail call i32 (...) @unset_act_func()
%2 = tail call i32 (...) @exit_scope()
ret void
}
unsigned int double_to_unsigned_int(double src) { return src; }


x86 assembly (clang, -O0):
<double_to_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_unsigned_int>:
cvttsd2si %xmm0,%rax
ret

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

LLVM IR (-O2):
define i32 @double_to_unsigned_int(double %0) {
%2 = fptoui double %0 to i32
ret i32 %2
}
void DEBUG_PutChar(char ch) { ch = ch; }


x86 assembly (clang, -O0):
<DEBUG_PutChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @DEBUG_PutChar(i8 signext %0) {
ret void
}
void ff_videodsp_init_mips() {}


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

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

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

LLVM IR (-O2):
define void @ff_videodsp_init_mips() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_autoconf_comment_entities() {
  test_parser_verify_parse(test_parser_sourcefile("autoconf", " dnl comment"),
                           "autoconf", "", "dnl comment", 0);
}


x86 assembly (clang, -O0):
<test_autoconf_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xebc(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_autoconf_comment_entities>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xeca(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"autoconf\00"
@.str.1 = [13 x i8] c" dnl comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c"dnl comment\00"
define void @test_autoconf_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"autoconf\00"
@.str.1 = [13 x i8] c" dnl comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c"dnl comment\00"
define void @test_autoconf_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int FD_CLOEXEC;
int sys_getfd(int, int *);
int sys_setfd(int, int);
int sys_cloexec(int fd) {
  int flags;
  int err;
  err = sys_getfd(fd, &flags);
  if (err)
    return err;
  return sys_setfd(fd, flags | FD_CLOEXEC);
}


x86 assembly (clang, -O0):
<sys_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <sys_getfd@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114f <sys_cloexec+0x2f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <sys_cloexec+0x46>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e84(%rip),%rax
or     (%rax),%esi
call   1040 <sys_setfd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_cloexec>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rsi
call   1030 <sys_getfd@plt>
test   %eax,%eax
jne    1149 <sys_cloexec+0x29>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
or     0xc(%rsp),%esi
mov    %ebx,%edi
call   1040 <sys_setfd@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FD_CLOEXEC = global i32 0
define i32 @sys_cloexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @sys_getfd(i32 %6, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %5
store i32 %11, i32* %2
br label %18
12: ; preds = %1
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* @FD_CLOEXEC
%16 = or i32 %14, %15
%17 = call i32 @sys_setfd(i32 %13, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@FD_CLOEXEC = global i32 0
define i32 @sys_cloexec(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sys_getfd(i32 %0, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @FD_CLOEXEC
%9 = or i32 %8, %7
%10 = call i32 @sys_setfd(i32 %0, i32 %9)
br label %11
11: ; preds = %1, %6
%12 = phi i32 [ %10, %6 ], [ %4, %1 ]
ret i32 %12
}
/* Type definitions */
struct _tuple0 {
  int dummy;
};
struct Cyc_Sexp_Parser {
  int dummy;
};

/* Variables and functions */
struct _tuple0 *Cyc_Sexp_mk_uchar(unsigned char);
unsigned char Cyc_Sexp_parse_char(struct Cyc_Sexp_Parser *);
struct _tuple0 *Cyc_Sexp_parse_uchar(struct Cyc_Sexp_Parser *p) {
  unsigned char _T0;
  struct _tuple0 *_T1;
  _T0 = Cyc_Sexp_parse_char(p);
  _T1 = Cyc_Sexp_mk_uchar(_T0);
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Sexp_parse_uchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Cyc_Sexp_parse_char@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
call   1030 <Cyc_Sexp_mk_uchar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Sexp_parse_uchar>:
push   %rax
call   1040 <Cyc_Sexp_parse_char@plt>
movzbl %al,%edi
pop    %rax
jmp    1030 <Cyc_Sexp_mk_uchar@plt>

LLVM IR (-O0):
%struct._tuple0 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple0* @Cyc_Sexp_parse_uchar(%struct.Cyc_Sexp_Parser* %0) {
%2 = alloca %struct.Cyc_Sexp_Parser*
%3 = alloca i8
%4 = alloca %struct._tuple0*
store %struct.Cyc_Sexp_Parser* %0, %struct.Cyc_Sexp_Parser** %2
%5 = load %struct.Cyc_Sexp_Parser*, %struct.Cyc_Sexp_Parser** %2
%6 = call zeroext i8 @Cyc_Sexp_parse_char(%struct.Cyc_Sexp_Parser* %5)
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = call %struct._tuple0* @Cyc_Sexp_mk_uchar(i8 zeroext %7)
store %struct._tuple0* %8, %struct._tuple0** %4
%9 = load %struct._tuple0*, %struct._tuple0** %4
ret %struct._tuple0* %9
}

LLVM IR (-O2):
%struct._tuple0 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple0* @Cyc_Sexp_parse_uchar(%struct.Cyc_Sexp_Parser* %0) {
%2 = tail call zeroext i8 @Cyc_Sexp_parse_char(%struct.Cyc_Sexp_Parser* %0)
%3 = tail call %struct._tuple0* @Cyc_Sexp_mk_uchar(i8 zeroext %2)
ret %struct._tuple0* %3
}
/* Variables and functions */
int /*<<< orphan*/ t1();
int /*<<< orphan*/ t2();
void main() {
  t1();
  t2();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <t1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <t2@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @t1()
%2 = call i32 (...) @t2()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @t1()
%2 = tail call i32 (...) @t2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getKey();
void waitForKey(void) {
  while (!getKey())
    ;
}


x86 assembly (clang, -O0):
<waitForKey>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <waitForKey+0x9>
mov    $0x0,%al
call   1030 <getKey@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <waitForKey+0x25>
jmp    113a <waitForKey+0x2a>
jmp    1119 <waitForKey+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForKey>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getKey@plt>
test   %eax,%eax
je     1120 <waitForKey+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @waitForKey() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @getKey()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @waitForKey() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getKey()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ printf(char *, int **);
void getheap(int *p) {
  printf("p = %p\n", &p);
  p = malloc(sizeof(int) * 10);
}


x86 assembly (clang, -O0):
<getheap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <printf@plt>
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getheap>:
push   %rax
mov    %rdi,(%rsp)
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    $0x28,%edi
call   1040 <malloc@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"p = %p\0A\00"
define void @getheap(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32** %2)
%4 = call i32* @malloc(i32 40)
store i32* %4, i32** %2
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"p = %p\0A\00"
define void @getheap(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32** %2)
%4 = call i32* @malloc(i32 40)
ret void
}
int test_imm_B2int8_mem(signed char *val) {
  return ((*val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ recur(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void merge_sort(uint32_t *buf, int len) {
  uint32_t *tmp = malloc(sizeof(uint32_t) * len);
  memcpy(tmp, buf, sizeof(uint32_t) * len);
  recur(buf, tmp, len);
  free(tmp);
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <recur@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x0(,%r14,4),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <recur@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @merge_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = mul i64 4, %14
%16 = trunc i64 %15 to i32
%17 = call i32 @memcpy(i32* %11, i32* %12, i32 %16)
%18 = load i32*, i32** %3
%19 = load i32*, i32** %5
%20 = load i32, i32* %4
%21 = call i32 @recur(i32* %18, i32* %19, i32 %20)
%22 = load i32*, i32** %5
%23 = call i32 @free(i32* %22)
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i32* %4, i32* %0, i32 %3)
%6 = tail call i32 @recur(i32* %0, i32* %4, i32 %1)
%7 = tail call i32 @free(i32* %4)
ret void
}
/* Variables and functions */
bool WebServer_Start() {}


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

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

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

LLVM IR (-O2):
define i32 @WebServer_Start() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void rm_rb_node() { perror(" null function"); }


x86 assembly (clang, -O0):
<rm_rb_node>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_rb_node>:
lea    0xee9(%rip),%rdi
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" null function\00"
define void @rm_rb_node() {
%1 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" null function\00"
define void @rm_rb_node() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void *aCalloc_(size_t num, size_t size, const char *file, int line,
               const char *func) {
  void *ret;
  ret = calloc(num, size);
  if (ret == NULL) {
    printf("%s:%d: in func %s: calloc error out of memory!\n", file, line,
           func);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<aCalloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1188 <aCalloc_+0x58>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aCalloc_>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <calloc@plt>
test   %rax,%rax
je     114b <aCalloc_+0x1b>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"%s:%d: in func %s: calloc error out of memory!\0A\00"
define i8* @aCalloc_(i64 %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i8* @calloc(i64 %12, i64 %13)
store i8* %14, i8** %11
%15 = load i8*, i8** %11
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %23
17: ; preds = %5
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i8*, i8** %10
%21 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19, i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %5
%24 = load i8*, i8** %11
ret i8* %24
}

LLVM IR (-O2):
@.str = [48 x i8] c"%s:%d: in func %s: calloc error out of memory!\0A\00"
define noalias i8* @aCalloc_(i64 %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @calloc(i64 %0, i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %4)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret i8* %6
}
unsigned char inb(const unsigned short port) {
  unsigned char res;
  asm volatile("inb %1, %0" : "=a"(res) : "Nd"(port));
  return res;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}