xunge/DecIR huggingface dataset:
long LACING_ADJUST(long bytes) {
  int addto = bytes / 255 + 1;
  return (bytes + addto);
}


x86 assembly (clang, -O0):
<LACING_ADJUST>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xff,%ecx
cqto
idiv   %rcx
add    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LACING_ADJUST>:
movabs $0x8080808080808081,%rcx
80 80 80
mov    %rdi,%rax
imul   %rcx
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x7,%rax
shr    $0x3f,%rdx
add    %edx,%eax
add    $0x1,%eax
cltq
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @LACING_ADJUST(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 255
%6 = add nsw i64 %5, 1
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i64, i64* %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @LACING_ADJUST(i64 %0) {
%2 = sdiv i64 %0, 255
%3 = shl i64 %2, 32
%4 = add i64 %3, 4294967296
%5 = ashr exact i64 %4, 32
%6 = add nsw i64 %5, %0
ret i64 %6
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void UARTIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000038))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<UARTIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x38(%rcx)
ret

LLVM IR (-O0):
define void @UARTIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 56
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 56
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void RLUnCompWram(void *source, void *dest) { SystemCall(20); }


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

x86 assembly (clang, -O2):
<RLUnCompWram>:
mov    $0x14,%edi
jmp    1030 <SystemCall@plt>

LLVM IR (-O0):
define void @RLUnCompWram(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @SystemCall(i32 20)
ret void
}

LLVM IR (-O2):
define void @RLUnCompWram(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @SystemCall(i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msim_printSouthWall() { printf("---"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"---\00"
define void @msim_printSouthWall() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t randombounds(int /*<<< orphan*/, int);
float op_random(float *data, int N) { return data[randombounds(0, N - 1)]; }


x86 assembly (clang, -O0):
<op_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1030 <randombounds@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movss  (%rax,%rcx,4),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_random>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffff,%esi
xor    %edi,%edi
call   1030 <randombounds@plt>
movss  (%rbx,%rax,4),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @op_random(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i64 @randombounds(i32 0, i32 %7)
%9 = getelementptr inbounds float, float* %5, i64 %8
%10 = load float, float* %9
ret float %10
}

LLVM IR (-O2):
define float @op_random(float* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i64 @randombounds(i32 0, i32 %3)
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = load float, float* %5
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ mem_copy_qword2qword_big(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ const);
uint64_t arch_mem_copy_qword2qword_big(uint64_t *qword_d,
                                       const uint64_t qword_s) {
  return mem_copy_qword2qword_big(qword_d, qword_s);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_qword2qword_big>:
jmp    1030 <mem_copy_qword2qword_big@plt>

LLVM IR (-O0):
define i32 @arch_mem_copy_qword2qword_big(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 @mem_copy_qword2qword_big(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @arch_mem_copy_qword2qword_big(i32* %0, i32 %1) {
%3 = tail call i32 @mem_copy_qword2qword_big(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gtext() { ol("text"); }


x86 assembly (clang, -O0):
<gtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"text\00"
define i32 @gtext() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"text\00"
define i32 @gtext() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int stub1();
void exec_shellcode(unsigned char *shellcode, int shellcode_size,
                    char *payload_info) {
  0;
  if (shellcode != NULL) {
    int (*funct)();
    funct = (int (*)())shellcode;
    (int)(*funct)();
  }
}


x86 assembly (clang, -O0):
<exec_shellcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112b <exec_shellcode+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   *-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_shellcode>:
test   %rdi,%rdi
je     1109 <exec_shellcode+0x9>
xor    %eax,%eax
jmp    *%rdi
ret

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

LLVM IR (-O2):
define void @exec_shellcode(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast i8* %0 to i32 (...)*
%7 = tail call i32 (...) %6()
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int i = 2147483647;
  printf("%d\n", ++i);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x80000000,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -2147483648)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stic_simple_test_result(int, char *, char const *,
                                           char const *, unsigned int);
void stic_assert_failure(int test, const char function[], const char file[],
                         unsigned int line) {
  stic_simple_test_result(test != 0, "Should have been failure (non-zero)",
                          function, file, line);
}


x86 assembly (clang, -O0):
<stic_assert_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xebb(%rip),%rsi
call   1030 <stic_simple_test_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stic_assert_failure>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    0xed9(%rip),%rsi
mov    %eax,%edi
jmp    1030 <stic_simple_test_result@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Should have been failure (non-zero)\00"
define void @stic_assert_failure(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @stic_simple_test_result(i32 %11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Should have been failure (non-zero)\00"
define void @stic_assert_failure(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp ne i32 %0, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @stic_simple_test_result(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CL_GetPing(int, char *, int, int *);
void LAN_GetPing(int n, char *buf, int buflen, int *pingtime) {
  CL_GetPing(n, buf, buflen, pingtime);
}


x86 assembly (clang, -O0):
<LAN_GetPing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <CL_GetPing@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LAN_GetPing>:
jmp    1030 <CL_GetPing@plt>

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

LLVM IR (-O2):
define void @LAN_GetPing(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = tail call i32 @CL_GetPing(i32 %0, i8* %1, i32 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Bmi(double, double);
int EXIT_SUCCESS;
double ParseDouble();
int /*<<< orphan*/ PrintOutput(int /*<<< orphan*/);
int main(int argc, char **argv) {
  double lbs, inches;
  lbs = ParseDouble();
  inches = ParseDouble();
  PrintOutput(Bmi(lbs, inches));
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1050 <ParseDouble@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <ParseDouble@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <Bmi@plt>
mov    %eax,%edi
call   1040 <PrintOutput@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <ParseDouble@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <ParseDouble@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
call   1030 <Bmi@plt>
mov    %eax,%edi
call   1040 <PrintOutput@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call double (...) @ParseDouble()
store double %8, double* %6
%9 = call double (...) @ParseDouble()
store double %9, double* %7
%10 = load double, double* %6
%11 = load double, double* %7
%12 = call i32 @Bmi(double %10, double %11)
%13 = call i32 @PrintOutput(i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (...) @ParseDouble()
%4 = tail call double (...) @ParseDouble()
%5 = tail call i32 @Bmi(double %3, double %4)
%6 = tail call i32 @PrintOutput(i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ func();
void f1() { func(); }


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

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

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

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32 (...) @func()
ret void
}
/* Variables and functions */
scalar_t__ prj_get_linkoptions();
int prj_getlistsize(void **);
int prj_get_numlinkoptions() {
  return prj_getlistsize((void **)prj_get_linkoptions());
}


x86 assembly (clang, -O0):
<prj_get_numlinkoptions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prj_get_linkoptions@plt>
mov    %rax,%rdi
call   1030 <prj_getlistsize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prj_get_numlinkoptions>:
push   %rax
xor    %eax,%eax
call   1040 <prj_get_linkoptions@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <prj_getlistsize@plt>

LLVM IR (-O0):
define i32 @prj_get_numlinkoptions() {
%1 = call i64 (...) @prj_get_linkoptions()
%2 = inttoptr i64 %1 to i8**
%3 = call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @prj_get_numlinkoptions() {
%1 = tail call i64 (...) @prj_get_linkoptions()
%2 = inttoptr i64 %1 to i8**
%3 = tail call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strcop(char *str) {
  char *ret = malloc(strlen(str) + 1);
  strcpy(ret, str);
  return ret;
}


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

x86 assembly (clang, -O2):
<strcop>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcop(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcop(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ drawScene();
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ selectObjects();
void select_display(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  drawScene();
  selectObjects();
  glFlush();
}


x86 assembly (clang, -O0):
<select_display>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    0x2e73(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <drawScene@plt>
mov    $0x0,%al
call   1040 <selectObjects@plt>
mov    $0x0,%al
call   1060 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_display>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e6f(%rip),%rax
mov    0x2e78(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <drawScene@plt>
xor    %eax,%eax
call   1040 <selectObjects@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @select_display() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%4 = or i32 %2, %3
%5 = call i32 @glClear(i32 %4)
%6 = call i32 (...) @drawScene()
%7 = call i32 (...) @selectObjects()
%8 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @select_display() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%4 = or i32 %3, %2
%5 = tail call i32 @glClear(i32 %4)
%6 = tail call i32 (...) @drawScene()
%7 = tail call i32 (...) @selectObjects()
%8 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a = 5;
  switch (a) {
  case 4:
    printf("%d\n", 4);
    break;
  case 5:
    printf("%d\n", 5);
    break;
  case 6:
    printf("%d\n", 6);
    break;
  default:
    printf("default");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     115c <main+0x4c>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     1174 <main+0x64>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     118c <main+0x7c>
jmp    11a4 <main+0x94>
lea    0xe9d(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0xa2>
lea    0xe85(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0xa2>
lea    0xe6d(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0xa2>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
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    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 4, label %4
i32 5, label %6
i32 6, label %8
]
4: ; preds = %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
br label %12
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
br label %12
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t u32_b2(uint32_t value) { return (uint8_t)((value & 0x00FF0000) >> 16); }


x86 assembly (clang, -O0):
<u32_b2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32_b2>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @u32_b2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711680
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @u32_b2(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl(uint32_t val, int bits) {
  return (val << bits) | (val >> (32 - bits));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ jmpfunction(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int setjmp(int /*<<< orphan*/);
int main() {
  int val;
  jmp_buf env_buffer;
  val = setjmp(env_buffer);
  if (val != 0) {
    printf("Returned from a longjmp() with value = %d\n", val);
    exit(0);
  }
  printf("Jump function call\n");
  jmpfunction(env_buffer);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <setjmp@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1050 <jmpfunction@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <setjmp@plt>
test   %eax,%eax
jne    116f <main+0x1f>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
call   1060 <jmpfunction@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    %eax,%esi
lea    0xe88(%rip),%rdi
xor    %ebx,%ebx
mov    %ebx,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Returned from a longjmp() with value = %d\0A\00"
@.str.1 = [20 x i8] c"Jump function call\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = call i32 @setjmp(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = call i32 @jmpfunction(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"Returned from a longjmp() with value = %d\0A\00"
@str = [19 x i8] c"Jump function call\00"
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = call i32 @jmpfunction(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_mock_and_restore_origin();
int /*<<< orphan*/ test_mock_simple_function();
int /*<<< orphan*/ test_mock_with_args();
int /*<<< orphan*/ test_mock_with_cdecl_args();
int /*<<< orphan*/ test_mock_with_returned_value();
int /*<<< orphan*/ test_try_mock_twice();
int main() {
  test_mock_simple_function();
  test_mock_with_returned_value();
  test_mock_with_args();
  test_mock_with_cdecl_args();
  test_try_mock_twice();
  test_mock_and_restore_origin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_mock_simple_function@plt>
mov    $0x0,%al
call   1080 <test_mock_with_returned_value@plt>
mov    $0x0,%al
call   1040 <test_mock_with_args@plt>
mov    $0x0,%al
call   1060 <test_mock_with_cdecl_args@plt>
mov    $0x0,%al
call   1030 <test_try_mock_twice@plt>
mov    $0x0,%al
call   1070 <test_mock_and_restore_origin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_mock_simple_function@plt>
xor    %eax,%eax
call   1080 <test_mock_with_returned_value@plt>
xor    %eax,%eax
call   1040 <test_mock_with_args@plt>
xor    %eax,%eax
call   1060 <test_mock_with_cdecl_args@plt>
xor    %eax,%eax
call   1030 <test_try_mock_twice@plt>
xor    %eax,%eax
call   1070 <test_mock_and_restore_origin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_mock_simple_function()
%3 = call i32 (...) @test_mock_with_returned_value()
%4 = call i32 (...) @test_mock_with_args()
%5 = call i32 (...) @test_mock_with_cdecl_args()
%6 = call i32 (...) @test_try_mock_twice()
%7 = call i32 (...) @test_mock_and_restore_origin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_mock_simple_function()
%2 = tail call i32 (...) @test_mock_with_returned_value()
%3 = tail call i32 (...) @test_mock_with_args()
%4 = tail call i32 (...) @test_mock_with_cdecl_args()
%5 = tail call i32 (...) @test_try_mock_twice()
%6 = tail call i32 (...) @test_mock_and_restore_origin()
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_string(const void *key1, const void *key2) {
  return strcmp((const char *)key1, (const char *)key2);
}


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

x86 assembly (clang, -O2):
<cmp_string>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp_string(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmp_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void h4(void) {}


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

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

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

LLVM IR (-O2):
define void @h4() {
ret void
}
int isEven(int num) { return num % 2 == 0; }


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
int dispatcher() {}


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

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

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

LLVM IR (-O2):
define i32 @dispatcher() {
ret i32 undef
}
unsigned xrop3_186_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = D | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_186_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_186_0_0>:
shl    $0x8,%edi
shl    $0x8,%esi
not    %edi
and    %esi,%edi
lea    0xff(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_186_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_186_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, 255
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void pexit(const char *fname) {
  perror(fname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @pexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @pexit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void cgi_error(const char *reason) {
  printf("<h1>Error</h1>\n");
  printf("%s\n", reason);
  exit(0);
}


x86 assembly (clang, -O0):
<cgi_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cgi_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"<h1>Error</h1>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @cgi_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"<h1>Error</h1>\00"
define void @cgi_error(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
double idx(double min, double max, double pixel) {
  return (max - pixel) / (max - min);
}


x86 assembly (clang, -O0):
<idx>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<idx>:
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @idx(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = fsub double %7, %8
%10 = load double, double* %5
%11 = load double, double* %4
%12 = fsub double %10, %11
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @idx(double %0, double %1, double %2) {
%4 = fsub double %1, %2
%5 = fsub double %1, %0
%6 = fdiv double %4, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mpack_store_u64(char *, int /*<<< orphan*/);
void mpack_store_i64(char *p, int64_t val) {
  mpack_store_u64(p, (uint64_t)val);
}


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

x86 assembly (clang, -O2):
<mpack_store_i64>:
jmp    1030 <mpack_store_u64@plt>

LLVM IR (-O0):
define void @mpack_store_i64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = call i32 @mpack_store_u64(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mpack_store_i64(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @mpack_store_u64(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iis_s3c2410_showbus(char const *);
void iis_showbus(const char *msg) { iis_s3c2410_showbus(msg); }


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

x86 assembly (clang, -O2):
<iis_showbus>:
jmp    1030 <iis_s3c2410_showbus@plt>

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

LLVM IR (-O2):
define void @iis_showbus(i8* %0) {
%2 = tail call i32 @iis_s3c2410_showbus(i8* %0)
ret void
}
void nop_free(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @nop_free(i8* nocapture %0) {
ret void
}
void mus_lint_to_char(unsigned char *j, int x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[3];
  j[1] = ox[2];
  j[2] = ox[1];
  j[3] = ox[0];
}


x86 assembly (clang, -O0):
<mus_lint_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_lint_to_char>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mus_lint_to_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast i32* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @mus_lint_to_char(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = lshr i32 %1, 24
%9 = trunc i32 %8 to i8
store i8 %9, i8* %0
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %12
ret void
}
void av_frame_get_colorspace() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_get_colorspace() {
ret void
}
/* Variables and functions */
scalar_t__ soc_is_rt3050();
scalar_t__ soc_is_rt3052();
int soc_is_rt305x(void) { return soc_is_rt3050() || soc_is_rt3052(); }


x86 assembly (clang, -O0):
<soc_is_rt305x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <soc_is_rt3050@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1152 <soc_is_rt305x+0x32>
mov    $0x0,%al
call   1040 <soc_is_rt3052@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_is_rt305x>:
push   %rax
xor    %eax,%eax
call   1030 <soc_is_rt3050@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <soc_is_rt305x+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <soc_is_rt3052@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_is_rt305x() {
%1 = call i64 (...) @soc_is_rt3050()
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @soc_is_rt3052()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @soc_is_rt305x() {
%1 = tail call i64 (...) @soc_is_rt3050()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @soc_is_rt3052()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ ldexp(float, int);
float ldexpf(float x, int expn) { return (float)ldexp(x, expn); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
push   %rax
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call i64 @ldexp(float %0, i32 %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int f();
int f2(int p) {
  int y;
  y = f();
  return y + p;
}


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

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <f@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = add nsw i32 %2, %0
ret i32 %3
}
void TC4_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @TC4_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_57uint16_mem(unsigned short *val) {
  return ((*val) & (0x57 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_57uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 87
%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_57uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 87
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void av_probe_input_buffer() {}


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

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

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

LLVM IR (-O2):
define void @av_probe_input_buffer() {
ret void
}
/* Variables and functions */
int strlen(char *);
char *chomp(char *str) {
  int last = strlen(str) - 1;
  if (str[last] == '\n')
    str[last] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114c <chomp+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <chomp+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @chomp(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret i8* %0
}