xunge/DecIR huggingface dataset:
/* Variables and functions */
int find_nth_str(char *, char *, int);
int find_2nd_str(char *line, char *str) { return find_nth_str(line, str, 2); }


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

x86 assembly (clang, -O2):
<find_2nd_str>:
mov    $0x2,%edx
jmp    1030 <find_nth_str@plt>

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

LLVM IR (-O2):
define i32 @find_2nd_str(i8* %0, i8* %1) {
%3 = tail call i32 @find_nth_str(i8* %0, i8* %1, i32 2)
ret i32 %3
}
int isspace(int c) {
  return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' ||
          c == '\v');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 12
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_interval2(int);
int iyogrt_set_interval2_(int *seconds) {
  yogrt_set_interval2(*seconds);
  return *seconds;
}


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

x86 assembly (clang, -O2):
<iyogrt_set_interval2_>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <yogrt_set_interval2@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iyogrt_set_interval2_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @yogrt_set_interval2(i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iyogrt_set_interval2_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_interval2(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int RSA_null_finish(RSA *rsa) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @RSA_null_finish(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ LCD_command(int);
void LCD_auto_write_stop() { LCD_command(0xB2); }


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

x86 assembly (clang, -O2):
<LCD_auto_write_stop>:
mov    $0xb2,%edi
jmp    1030 <LCD_command@plt>

LLVM IR (-O0):
define void @LCD_auto_write_stop() {
%1 = call i32 @LCD_command(i32 178)
ret void
}

LLVM IR (-O2):
define void @LCD_auto_write_stop() {
%1 = tail call i32 @LCD_command(i32 178)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PathSummaryHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PathSummaryUpdated() { UAVObjUpdated(PathSummaryHandle()); }


x86 assembly (clang, -O0):
<PathSummaryUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathSummaryHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathSummaryUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <PathSummaryHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @PathSummaryUpdated() {
%1 = call i32 (...) @PathSummaryHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathSummaryUpdated() {
%1 = tail call i32 (...) @PathSummaryHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
WAVE_square() {}


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

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

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

LLVM IR (-O2):
define i32 @WAVE_square() {
ret i32 undef
}
int test_imm_E6int64_midword_reg(long long val) {
  return ((val >> 16) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xe6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E6int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 230
%6 = icmp ne i64 %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_E6int64_midword_reg(i64 %0) {
%2 = and i64 %0, 15073280
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
long conv_uni_to_8859_1_(uint32_t cp, uint8_t *out, const size_t out_bytes) {
  if (out_bytes == 0) {
    return -1;
  }
  if (cp <= 0xff) {
    *out = (uint8_t)cp;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<conv_uni_to_8859_1_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1127 <conv_uni_to_8859_1_+0x27>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1154 <conv_uni_to_8859_1_+0x54>
cmpl   $0xff,-0xc(%rbp)
jg     114c <conv_uni_to_8859_1_+0x4c>
movslq -0xc(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    1154 <conv_uni_to_8859_1_+0x54>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_uni_to_8859_1_>:
test   %rdx,%rdx
je     1119 <conv_uni_to_8859_1_+0x19>
cmp    $0xff,%edi
jg     1121 <conv_uni_to_8859_1_+0x21>
movslq %edi,%rax
mov    %rax,(%rsi)
mov    $0x1,%eax
ret
mov    $0xffffffffffffffff,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @conv_uni_to_8859_1_(i32 %0, i64* %1, i64 %2) {
%4 = alloca i64
%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 i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i64 -1, i64* %4
br label %19
11: ; preds = %3
%12 = load i32, i32* %5
%13 = icmp sle i32 %12, 255
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %6
store i64 %16, i64* %17
store i64 1, i64* %4
br label %19
18: ; preds = %11
store i64 0, i64* %4
br label %19
19: ; preds = %18, %14, %10
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
define i64 @conv_uni_to_8859_1_(i32 %0, i64* nocapture writeonly %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp slt i32 %0, 256
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = sext i32 %0 to i64
store i64 %8, i64* %1
br label %9
9: ; preds = %5, %3, %7
%10 = phi i64 [ 1, %7 ], [ -1, %3 ], [ 0, %5 ]
ret i64 %10
}
int FastIntLog2(int x) {
  int result;
  asm(" bsr %1,%0\n\t" : "=&abcd"(result) : "bcdSDm"(x) :);
  return result;
}


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

x86 assembly (clang, -O2):
<FastIntLog2>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @FastIntLog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm " bsr $1,$0\0A\09", "=&{ax}{bx}{cx}{dx},{bx}{cx}{dx}{si}{di}m,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @FastIntLog2(i32 %0) {
%2 = tail call i32 asm " bsr $1,$0\0A\09", "=&{ax}{bx}{cx}{dx},{bx}{cx}{dx}{si}{di}m,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
unsigned long long unsignedlonglong_ignoring_longdouble(unsigned long long x,
                                                        long double y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlonglong_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_longdouble>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlonglong_ignoring_longdouble(i64 %0, x86_fp80 %1) {
%3 = alloca i64
%4 = alloca x86_fp80
store i64 %0, i64* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ mat_array_write_dims2(int /*<<< orphan*/ *, int,
                                         int /*<<< orphan*/);
void mat_array_write_dims1(FILE *file, int32_t cols) {
  mat_array_write_dims2(file, 1, cols);
}


x86 assembly (clang, -O0):
<mat_array_write_dims1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <mat_array_write_dims2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_array_write_dims1>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <mat_array_write_dims2@plt>

LLVM IR (-O0):
define void @mat_array_write_dims1(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @mat_array_write_dims2(i32* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @mat_array_write_dims1(i32* %0, i32 %1) {
%3 = tail call i32 @mat_array_write_dims2(i32* %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int quaddobl_sample_to_new_slices(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(665, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_sample_to_new_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x299,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_sample_to_new_slices>:
mov    $0x299,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @quaddobl_sample_to_new_slices() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 665, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @quaddobl_sample_to_new_slices() {
%1 = tail call i32 @_ada_use_c2phc(i32 665, i32* undef, i32* undef, double* undef)
ret i32 %1
}
int timeout_v_api(void) { return 0x20160226; }


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

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

LLVM IR (-O0):
define i32 @timeout_v_api() {
ret i32 538313254
}

LLVM IR (-O2):
define i32 @timeout_v_api() {
ret i32 538313254
}
void proc59() {}


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

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

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

LLVM IR (-O2):
define void @proc59() {
ret void
}
int quantum_getwidth(int n) {
  int i;
  for (i = 1; 1 << i < n; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<quantum_getwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jge    1134 <quantum_getwidth+0x34>
jmp    1126 <quantum_getwidth+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <quantum_getwidth+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_getwidth>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jl     1110 <quantum_getwidth+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @quantum_getwidth(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = shl nuw i32 1, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
char *strcpy(char *dest, const char *src) {
  char *rv = dest;
  do {
    *dest++ = *src++;
  } while (*src);
  *dest++ = '\0';
  return rv;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %10, %4 ]
%6 = phi i8* [ %1, %2 ], [ %8, %4 ]
%7 = phi i8* [ %0, %2 ], [ %9, %4 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %5, i8* %7
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4
store i8 0, i8* %9
ret i8* %0
}
/* Variables and functions */
int ENODEV;
int qpnp_pon_dvdd_shutdown(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<qpnp_pon_dvdd_shutdown>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qpnp_pon_dvdd_shutdown>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @qpnp_pon_dvdd_shutdown() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @qpnp_pon_dvdd_shutdown() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
void tdefault_program_signals(struct target_ops *self, int arg1,
                              unsigned char *arg2) {}


x86 assembly (clang, -O0):
<tdefault_program_signals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define void @tdefault_program_signals(%struct.target_ops* %0, i32 %1, i8* %2) {
%4 = alloca %struct.target_ops*
%5 = alloca i32
%6 = alloca i8*
store %struct.target_ops* %0, %struct.target_ops** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_program_signals(%struct.target_ops* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int);
int /*<<< orphan*/ g(int);
scalar_t__ h(int /*<<< orphan*/);
int main() {
  if (f(65536) != h(g(65536)))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10000,%edi
call   1050 <f@plt>
mov    %rax,-0x10(%rbp)
mov    $0x10000,%edi
call   1060 <g@plt>
mov    %eax,%edi
call   1040 <h@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1195 <main+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10000,%edi
call   1050 <f@plt>
mov    %rax,%rbx
mov    $0x10000,%edi
call   1060 <g@plt>
mov    %eax,%edi
call   1040 <h@plt>
cmp    %rax,%rbx
jne    117b <main+0x2b>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 65536)
%3 = call i32 @g(i32 65536)
%4 = call i64 @h(i32 %3)
%5 = icmp ne i64 %2, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 65536)
%2 = tail call i32 @g(i32 65536)
%3 = tail call i64 @h(i32 %2)
%4 = icmp eq i64 %1, %3
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UI_DEV_DESTROY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void uinput_destroy(int fd) {
  ioctl(fd, UI_DEV_DESTROY, 0);
  close(fd);
}


x86 assembly (clang, -O0):
<uinput_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uinput_destroy>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@UI_DEV_DESTROY = global i32 0
define void @uinput_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @UI_DEV_DESTROY
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
@UI_DEV_DESTROY = global i32 0
define void @uinput_destroy(i32 %0) {
%2 = load i32, i32* @UI_DEV_DESTROY
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
%4 = tail call i32 @close(i32 %0)
ret void
}
float sum(int x, int y) { return x + y; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
add    %esi,%edi
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sitofp i32 %3 to float
ret float %4
}
void gtk_ui_manager_get_toplevels() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_get_toplevels() {
ret void
}
float foo(float x, float y) {
  volatile int i = 0;
  return i != 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1130 <foo+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113a <foo+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     1112 <foo+0x12>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @foo(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, float %1, float %0
ret float %7
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncat(char *s, const char *append, size_t count) {
  strncpy(&s[strlen(s)], append, count);
  return s;
}


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),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%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
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

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
}
void DebugDriverOverWrite() {}


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

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

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

LLVM IR (-O2):
define void @DebugDriverOverWrite() {
ret void
}
void bn_lshift(unsigned int *bn, int shift, int or_val) {
  int i;
  unsigned int v;
  for (i = 0; i < 2; i++) {
    v = bn[i];
    bn[i] = (v << shift) | or_val;
    or_val = v >> (32 - shift);
  }
}


x86 assembly (clang, -O0):
<bn_lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1161 <bn_lshift+0x61>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
mov    -0xc(%rbp),%ecx
shl    %cl,%edx
or     -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <bn_lshift+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_lshift>:
mov    %esi,%ecx
mov    (%rdi),%eax
mov    %eax,%esi
shl    %cl,%esi
or     %edx,%esi
mov    %esi,(%rdi)
shld   %cl,%eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @bn_lshift(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sub nsw i32 32, %1
%5 = load i32, i32* %0
%6 = shl i32 %5, %1
%7 = or i32 %6, %2
store i32 %7, i32* %0
%8 = lshr i32 %5, %4
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, %1
%12 = or i32 %11, %8
store i32 %12, i32* %9
ret void
}
int test_si(int a) { return (a << 5) | ((unsigned int)a >> 27); }


x86 assembly (clang, -O0):
<test_si>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1b,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_si>:
mov    %edi,%eax
rol    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @test_si(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 5
%5 = load i32, i32* %2
%6 = lshr i32 %5, 27
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_si(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 5)
ret i32 %2
}
unsigned short int readsec0(char drive, char sec, char head, char trk,
                            char *Buffer) {
  return 0;
}


x86 assembly (clang, -O0):
<readsec0>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    %r8,-0x10(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @readsec0(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8* %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8*
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8* %4, i8** %10
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @readsec0(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8* nocapture readnone %4) {
ret i16 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *make_request(char *host, char *uri) {
  char *request = malloc(sizeof(*request) * 1024 * 1024);
  sprintf(request, "GET %s HTTP/1.1\r\nHost: %s\r\n\r\n", uri, host);
  return request;
}


x86 assembly (clang, -O0):
<make_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x100000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_request>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x100000,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"GET %s HTTP/1.1\0D\0AHost: %s\0D\0A\0D\0A\00"
define i8* @make_request(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 1048576)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
@.str = [30 x i8] c"GET %s HTTP/1.1\0D\0AHost: %s\0D\0A\0D\0A\00"
define noalias i8* @make_request(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put4_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int,
                              int /*<<< orphan*/);
void MC_put_xy_16_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                         int height) {
  MC_put4_16(height, dest, ref, stride, 0);
}


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

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

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

LLVM IR (-O2):
define void @MC_put_xy_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put4_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 0)
ret void
}
int TE3D_Console_ClearScreen() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TE3D_Console_ClearScreen() {
ret i32 0
}
dlsym() {}


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

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

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

LLVM IR (-O2):
define i32 @dlsym() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_stack(int);
int main(int argc, char **argv) {
  int a = 0xccddeeff;
  print_stack(0x3);
  a = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <print_stack@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -857870593, i32* %6
%7 = call i32 @print_stack(i32 3)
store i32 0, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_stack(i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  float a = 456.23;
  int b = 100;
  b = (float)a;
  printf("%d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 456)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int write(int, char *, int);
void mywrite(int fd, char *buff, int n) {
  if (write(fd, buff, n) == -1) {
    perror(NULL);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<mywrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    116d <mywrite+0x3d>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite>:
push   %rax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     113d <mywrite+0xd>
pop    %rax
ret
xor    %edi,%edi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @mywrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @perror(i32* null)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @mywrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i32* null)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_add_direct(char *str, uint8_t direct) {
  sprintf(str,
          "ADD   A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<sprint_add_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_add_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ADD A, 0x%02X \00"
define void @sprint_add_direct(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ADD A, 0x%02X \00"
define void @sprint_add_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void rop3_103_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_103_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_103_1_0>:
or     %esi,%edx
not    %dl
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_103_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_103_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %6, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
void gtk_icon_view_set_markup_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_set_markup_column() {
ret void
}
int append_pkg() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @append_pkg() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f1(int g) { printf("g1=%d\n", g); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"g1=%d\0A\00"
define void @f1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef void passwd;

/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, char *);
void *getpwuid(int /*<<< orphan*/);
__attribute__((__weak__, __always___)) struct passwd *
softboundmpx_getpwuid(uid_t uid) {
  void *ret_ptr = getpwuid(uid);
  __softboundmpx_store_return_metadata(ret_ptr, (char *)ret_ptr + 1024 * 1024);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_getpwuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x100000,%rsi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_getpwuid>:
push   %rbx
call   1030 <getpwuid@plt>
mov    %rax,%rbx
lea    0x100000(%rax),%rsi
mov    %rax,%rdi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type opaque
define weak %struct.passwd* @softboundmpx_getpwuid(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @getpwuid(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1048576
%9 = call i32 @__softboundmpx_store_return_metadata(i8* %6, i8* %8)
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to %struct.passwd*
ret %struct.passwd* %11
}

LLVM IR (-O2):
%struct.passwd = type opaque
define weak %struct.passwd* @softboundmpx_getpwuid(i32 %0) {
%2 = tail call i8* @getpwuid(i32 %0)
%3 = getelementptr inbounds i8, i8* %2, i64 1048576
%4 = tail call i32 @__softboundmpx_store_return_metadata(i8* %2, i8* %3)
%5 = bitcast i8* %2 to %struct.passwd*
ret %struct.passwd* %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test();
int main(void) {
  test();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int _get_load(char **, int);
int rfi_load_1min(char **s) { return _get_load(s, 1); }


x86 assembly (clang, -O0):
<rfi_load_1min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <_get_load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfi_load_1min>:
mov    $0x1,%esi
jmp    1030 <_get_load@plt>

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

LLVM IR (-O2):
define i32 @rfi_load_1min(i8** %0) {
%2 = tail call i32 @_get_load(i8** %0, i32 1)
ret i32 %2
}
int lcg(int x) {
  return (((1729 * x) % ((1 << (1 << 4)) - 1)) + 17) % ((1 << (1 << 4)) - 1);
}


x86 assembly (clang, -O0):
<lcg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x6c1,-0x4(%rbp),%eax
mov    $0xffff,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x11,%eax
mov    $0xffff,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg>:
imul   $0x6c1,%edi,%eax
cltq
imul   $0xffffffff80008001,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xf,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x10,%edx
sub    %edx,%ecx
lea    (%rax,%rcx,1),%edx
add    %ecx,%eax
add    $0x11,%eax
cltq
imul   $0xffffffff80008001,%rax,%rax
shr    $0x20,%rax
add    %edx,%eax
add    $0x11,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xf,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x10,%ecx
sub    %ecx,%eax
add    %edx,%eax
add    $0x11,%eax
ret

LLVM IR (-O0):
define i32 @lcg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1729, %3
%5 = srem i32 %4, 65535
%6 = add nsw i32 %5, 17
%7 = srem i32 %6, 65535
ret i32 %7
}

LLVM IR (-O2):
define i32 @lcg(i32 %0) {
%2 = mul nsw i32 %0, 1729
%3 = srem i32 %2, 65535
%4 = add nsw i32 %3, 17
%5 = srem i32 %4, 65535
ret i32 %5
}