xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void moveDisk(char fp, char tp) {
  printf("moving disk from %c to %c\n", fp, tp);
}


x86 assembly (clang, -O0):
<moveDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"moving disk from %c to %c\0A\00"
define void @moveDisk(i8 signext %0, i8 signext %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 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"moving disk from %c to %c\0A\00"
define void @moveDisk(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CompileArgument();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Display(void) {
  CompileArgument();
  WriteInstruction("call disply");
}


x86 assembly (clang, -O0):
<CR_Display>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CompileArgument@plt>
lea    0xece(%rip),%rdi
call   1040 <WriteInstruction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Display>:
push   %rax
xor    %eax,%eax
call   1030 <CompileArgument@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"call disply\00"
define void @CR_Display() {
%1 = call i32 (...) @CompileArgument()
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"call disply\00"
define void @CR_Display() {
%1 = tail call i32 (...) @CompileArgument()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float NAN;
scalar_t__ isnan(float);
float fabsf(float x) {
  if (isnan(x)) {
    return NAN;
  }
  return ((x < 0) ? -x : x);
}


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1146 <fabsf+0x36>
mov    0x2ec0(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1183 <fabsf+0x73>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116f <fabsf+0x5f>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1179 <fabsf+0x69>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
je     1132 <fabsf+0x22>
mov    0x2ecf(%rip),%rax
movss  (%rax),%xmm0
add    $0x18,%rsp
ret
movaps 0xec7(%rip),%xmm1
movaps (%rsp),%xmm3
xorps  %xmm3,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm3,%xmm0
cmpltss %xmm2,%xmm0
andps  %xmm0,%xmm1
andnps %xmm3,%xmm0
orps   %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@NAN = global float 0.000000e+00
define float @fabsf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call i64 @isnan(float %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load float, float* @NAN
store float %8, float* %2
br label %19
9: ; preds = %1
%10 = load float, float* %3
%11 = fcmp olt float %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load float, float* %3
%14 = fneg float %13
br label %17
15: ; preds = %9
%16 = load float, float* %3
br label %17
17: ; preds = %15, %12
%18 = phi float [ %14, %12 ], [ %16, %15 ]
store float %18, float* %2
br label %19
19: ; preds = %17, %7
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
@NAN = global float 0.000000e+00
define float @fabsf(float %0) {
%2 = tail call i64 @isnan(float %0)
%3 = icmp eq i64 %2, 0
%4 = load float, float* @NAN
%5 = fcmp olt float %0, 0.000000e+00
%6 = fneg float %0
%7 = select i1 %5, float %6, float %0
%8 = select i1 %3, float %7, float %4
ret float %8
}
/* Variables and functions */
scalar_t__ erdIsCap(char);
int erdIsLetter(char c) { return (erdIsCap(c) || (c >= 'a' && c <= 'z')); }


x86 assembly (clang, -O0):
<erdIsLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <erdIsCap@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115e <erdIsLetter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1158 <erdIsLetter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erdIsLetter>:
push   %rbx
mov    %edi,%ebx
call   1030 <erdIsCap@plt>
test   %rax,%rax
setne  %al
lea    -0x61(%rbx),%ecx
cmp    $0x1a,%cl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @erdIsLetter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @erdIsCap(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @erdIsLetter(i8 signext %0) {
%2 = tail call i64 @erdIsCap(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -97
%5 = icmp ult i8 %4, 26
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
int rafaelFn(int x, int y) { return 9 * x * x + y * y; }


x86 assembly (clang, -O0):
<rafaelFn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x9,-0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rafaelFn>:
imul   %edi,%edi
lea    (%rdi,%rdi,8),%eax
imul   %esi,%esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @rafaelFn(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 = mul nsw i32 9, %5
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rafaelFn(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 9
%4 = mul nsw i32 %3, %0
%5 = mul nsw i32 %1, %1
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SystemInit();
int /*<<< orphan*/ _mainCRTStartup();
void Reset_Handler(void) {
  SystemInit();
  _mainCRTStartup();
}


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

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

LLVM IR (-O0):
define void @Reset_Handler() {
%1 = call i32 (...) @SystemInit()
%2 = call i32 (...) @_mainCRTStartup()
ret void
}

LLVM IR (-O2):
define void @Reset_Handler() {
%1 = tail call i32 (...) @SystemInit()
%2 = tail call i32 (...) @_mainCRTStartup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_DivideVec4_init(void) {
  _hmt_register_covercase("HMM_DivideVec4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_DivideVec4_init>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"HMM_DivideVec4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_DivideVec4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bar() { return 42; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 42
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ enablePaging();
void pa_enable_paging() { enablePaging(); }


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

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

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

LLVM IR (-O2):
define void @pa_enable_paging() {
%1 = tail call i32 (...) @enablePaging()
ret void
}
int isPow2(unsigned int x) { return ((x & (x - 1)) == 0); }


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

x86 assembly (clang, -O2):
<isPow2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isPow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isPow2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ BlankLine();
int /*<<< orphan*/ Emit(char *);
void ListHeaderFiles(void) {
  Emit("#include <string.h>\n"
       "#include <stdlib.h>\n"
       "#include <stdio.h>\n"
       "#include <stdarg.h>\n"
       "#include \"cut.h\"\n");
  BlankLine();
  BlankLine();
}


x86 assembly (clang, -O0):
<ListHeaderFiles>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Emit@plt>
mov    $0x0,%al
call   1030 <BlankLine@plt>
mov    $0x0,%al
call   1030 <BlankLine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListHeaderFiles>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Emit@plt>
xor    %eax,%eax
call   1030 <BlankLine@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <BlankLine@plt>

LLVM IR (-O0):
@.str = [97 x i8] c"#include <string.h>\0A#include <stdlib.h>\0A#include <stdio.h>\0A#include <stdarg.h>\0A#include \22cut.h\22\0A\00"
define void @ListHeaderFiles() {
%1 = call i32 @Emit(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @BlankLine()
%3 = call i32 (...) @BlankLine()
ret void
}

LLVM IR (-O2):
@.str = [97 x i8] c"#include <string.h>\0A#include <stdlib.h>\0A#include <stdio.h>\0A#include <stdarg.h>\0A#include \22cut.h\22\0A\00"
define void @ListHeaderFiles() {
%1 = tail call i32 @Emit(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @BlankLine()
%3 = tail call i32 (...) @BlankLine()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
void SysCtlVoltageEventClear(uint32_t ui32Status) {
  (*((volatile uint32_t *)(0x400FE060))) |= ui32Status;
}


x86 assembly (clang, -O0):
<SysCtlVoltageEventClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x400fe060,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x400fe060,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlVoltageEventClear>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,0x400fe060
ret

LLVM IR (-O0):
define void @SysCtlVoltageEventClear(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074782304 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlVoltageEventClear(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074782304 to i32*)
ret void
}
/* Variables and functions */
int ns_name_skip(unsigned char **, unsigned char *);
int dn_skipname(unsigned char *ptr, unsigned char *eom) {
  unsigned char *saveptr = ptr;
  if (ns_name_skip(&ptr, eom) == -1)
    return (-1);
  return (ptr - saveptr);
}


x86 assembly (clang, -O0):
<dn_skipname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <ns_name_skip@plt>
cmp    $0xffffffff,%eax
jne    114a <dn_skipname+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <dn_skipname+0x48>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dn_skipname>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ns_name_skip@plt>
mov    0x8(%rsp),%ecx
sub    %ebx,%ecx
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dn_skipname(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @ns_name_skip(i8** %3, i8* %1)
%5 = icmp eq i32 %4, -1
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = select i1 %5, i32 -1, i32 %10
ret i32 %11
}
void h_template_function_name2() {}


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

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

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

LLVM IR (-O2):
define void @h_template_function_name2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put4_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int, int);
void MC_put_xy_8_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_put4_8(height, dest, ref, stride, 1);
}


x86 assembly (clang, -O0):
<MC_put_xy_8_3dnow>:
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
mov    $0x1,%r8d
call   1030 <MC_put4_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_xy_8_3dnow>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
jmp    1030 <MC_put4_8@plt>

LLVM IR (-O0):
define void @MC_put_xy_8_3dnow(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_8(i32 %9, i32* %10, i32* %11, i32 %12, i32 1)
ret void
}

LLVM IR (-O2):
define void @MC_put_xy_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put4_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int);
int my_put_nbr_disp(int nb) {
  if (nb <= -10) {
    my_put_nbr_disp(nb / 10);
  }
  my_putchar('0' - nb % 10);
}


x86 assembly (clang, -O0):
<my_put_nbr_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffff6,-0x8(%rbp)
jg     1147 <my_put_nbr_disp+0x27>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <my_put_nbr_disp@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0x30,%edi
sub    %edx,%edi
call   1040 <my_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_nbr_disp>:
push   %rbx
mov    %edi,%ebx
cmp    $0xfffffff6,%edi
jg     1140 <my_put_nbr_disp+0x20>
mov    %ebx,%eax
neg    %eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
neg    %edi
call   1030 <my_put_nbr_disp@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%edi
sub    %ebx,%edi
add    $0x30,%edi
pop    %rbx
jmp    1040 <my_putchar@plt>

LLVM IR (-O0):
define i32 @my_put_nbr_disp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, -10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 10
%9 = call i32 @my_put_nbr_disp(i32 %8)
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = sub nsw i32 48, %12
%14 = call i32 @my_putchar(i32 %13)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_put_nbr_disp(i32 %0) {
%2 = icmp slt i32 %0, -9
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sub i32 0, %0
%5 = udiv i32 %4, 10
%6 = sub nsw i32 0, %5
%7 = tail call i32 @my_put_nbr_disp(i32 %6)
br label %8
8: ; preds = %3, %1
%9 = srem i32 %0, 10
%10 = sub nsw i32 48, %9
%11 = tail call i32 @my_putchar(i32 %10)
ret i32 undef
}
int isOnBoard(int i, int j) { return i >= 0 && j >= 0 && j < 7 && i < 6; }


x86 assembly (clang, -O0):
<isOnBoard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <isOnBoard+0x41>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <isOnBoard+0x41>
xor    %eax,%eax
cmpl   $0x7,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1141 <isOnBoard+0x41>
cmpl   $0x6,-0x4(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOnBoard>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    $0x7,%esi
setl   %cl
and    %al,%cl
cmp    $0x6,%edi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isOnBoard(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 7
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 6
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isOnBoard(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
%5 = icmp slt i32 %1, 7
%6 = and i1 %5, %4
%7 = icmp slt i32 %0, 6
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
int popcount_i4(unsigned int i) {
  return (i & 0x1) + ((i >> 1) & 0x1) + ((i >> 2) & 0x1) + ((i >> 3) & 0x1);
}


x86 assembly (clang, -O0):
<popcount_i4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount_i4>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x3,%edi
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @popcount_i4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1
%8 = add i32 %4, %7
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = and i32 %10, 1
%12 = add i32 %8, %11
%13 = load i32, i32* %2
%14 = lshr i32 %13, 3
%15 = and i32 %14, 1
%16 = add i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @popcount_i4(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %4, %2
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %5, %7
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
ret i32 %11
}
void WriteToMem(int num_measures) {}


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

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

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

LLVM IR (-O2):
define void @WriteToMem(i32 %0) {
ret void
}
int foo(int predicate) {
  int __retres2;
  {
    if (predicate <= 0) {
      __retres2 = 1;
      goto return_label;
    } else {
      if (predicate > 5) {
        __retres2 = 2;
        goto return_label;
      }
      __retres2 = 3;
      goto return_label;
    }
  return_label:
    return (__retres2);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     111d <foo+0x1d>
movl   $0x1,-0x8(%rbp)
jmp    113a <foo+0x3a>
cmpl   $0x5,-0x4(%rbp)
jle    1133 <foo+0x33>
movl   $0x2,-0x8(%rbp)
jmp    113a <foo+0x3a>
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
cmp    $0x6,%edi
setge  %cl
xor    $0x3,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = icmp sgt i32 %0, 5
%4 = select i1 %3, i32 2, i32 3
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int age = 0;
  printf("Quel age avez-vous ? ");
  scanf("%d", &age);
  printf("Ah ! Vous avez donc %d ans !\n\n", age);
  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   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Quel age avez-vous ? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Ah ! Vous avez donc %d ans !\0A\0A\00"
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 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Quel age avez-vous ? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Ah ! Vous avez donc %d ans !\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, int *);
void main() {
  int n;
  float x;
  float px(float, int);
  printf("Please enter x,n:\n");
  scanf("%f %d", &x, &n);
  printf("%6.3f", px(x, n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x4(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mov    -0x4(%rbp),%edi
call   1040 <px@plt>
cvtss2sd %xmm0,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1060 <scanf@plt>
movss  (%rsp),%xmm0
mov    0x4(%rsp),%edi
call   1050 <px@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Please enter x,n:\0A\00"
@.str.1 = [6 x i8] c"%f %d\00"
@.str.2 = [6 x i8] c"%6.3f\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, i32* %1)
%5 = load float, float* %2
%6 = load i32, i32* %1
%7 = call float @px(float %5, i32 %6)
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f %d\00"
@.str.2 = [6 x i8] c"%6.3f\00"
@str = [18 x i8] c"Please enter x,n:\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, i32* %1)
%7 = load float, float* %2
%8 = load i32, i32* %1
%9 = call float @px(float %7, i32 %8)
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %10)
ret void
}
int test_imm_0Cint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x0C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Cint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 12
%7 = icmp ne i64 %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_0Cint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 786432
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
double strtod(char const *, char **);
double parse_number_or_die(const char *numstr, double min, double max) {
  char *tail;
  double d = strtod(numstr, &tail);
  if (*tail)
    fprintf(stderr, "Expected number\n");
  else
    return d;
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<parse_number_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <parse_number_or_die+0x4f>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
jmp    118a <parse_number_or_die+0x5a>
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<parse_number_or_die>:
push   %rax
mov    %rsp,%rsi
call   1030 <strtod@plt>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
jne    1144 <parse_number_or_die+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Expected number\0A\00"
define double @parse_number_or_die(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca i8*
%8 = alloca double
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
%9 = load i8*, i8** %4
%10 = call double @strtod(i8* %9, i8** %7)
store double %10, double* %8
%11 = load i8*, i8** %7
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %3
%18 = load double, double* %8
ret double %18
19: ; preds = %14
%20 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Expected number\0A\00"
define double @parse_number_or_die(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call double @strtod(i8* %0, i8** %4)
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %3
ret double %6
}
unsigned avcodec_build(void) { return 4701; }


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

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

LLVM IR (-O0):
define i32 @avcodec_build() {
ret i32 4701
}

LLVM IR (-O2):
define i32 @avcodec_build() {
ret i32 4701
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_y_root(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->y_root = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonReleasedEvent_y_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonReleasedEvent_y_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
float M_PI;
float deg2rad(float deg) { return (deg * M_PI / 180.0); }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
mulss  (%rax),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @deg2rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.800000e+02
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @deg2rad(float %0) {
%2 = load float, float* @M_PI
%3 = fmul float %2, %0
%4 = fdiv float %3, 1.800000e+02
ret float %4
}
/* Variables and functions */
int u8islatinsigni(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8islatinsigncc(const char *c) { return u8islatinsigni(u8tointcc(c)); }


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

x86 assembly (clang, -O2):
<u8islatinsigncc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8islatinsigni@plt>

LLVM IR (-O0):
define i32 @u8islatinsigncc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8islatinsigni(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8islatinsigncc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8islatinsigni(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ discriminant(double, double, double);
double sqrt(int /*<<< orphan*/);
double quadratic_equation_front(double a, double b, double c) {
  return sqrt(discriminant(a, b, c));
}


x86 assembly (clang, -O0):
<quadratic_equation_front>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <discriminant@plt>
mov    %eax,%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_equation_front>:
push   %rax
call   1040 <discriminant@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @quadratic_equation_front(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* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @discriminant(double %7, double %8, double %9)
%11 = call double @sqrt(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @quadratic_equation_front(double %0, double %1, double %2) {
%4 = tail call i32 @discriminant(double %0, double %1, double %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ t(int, void **);
int m(void **p) { t(10, p); }


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1030 <t@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
mov    %rdi,%rsi
mov    $0xa,%edi
jmp    1030 <t@plt>

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

LLVM IR (-O2):
define i32 @m(i8** %0) {
%2 = tail call i32 @t(i32 10, i8** %0)
ret i32 undef
}
/* Variables and functions */
scalar_t__ ft_isalpha(int);
scalar_t__ ft_isdigit(int);
int ft_isalnum(int c) {
  if (ft_isalpha(c) || ft_isdigit(c)) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ft_isalpha@plt>
cmp    $0x0,%rax
jne    114f <ft_isalnum+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x0,%rax
je     115b <ft_isalnum+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <ft_isalnum+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <ft_isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <ft_isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = tail call i64 @ft_isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT4_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT4_IRQHandler(void) {
  GPIO1_INT4_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_INT4_IRQHandler() {
%1 = call i32 (...) @GPIO1_INT4_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_INT4_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT4_DriverIRQHandler()
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
compareIndividuals(const void *first, const void *second) {
  return strcmp((char *)first, (char *)second);
}


x86 assembly (clang, -O0):
<compareIndividuals>:
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):
<compareIndividuals>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compareIndividuals(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 @compareIndividuals(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ TOSH_run_next_task();
int /*<<< orphan*/ TOSH_sleep();
int /*<<< orphan*/ TOSH_wait();
void TOSH_run_task() {
  while (TOSH_run_next_task())
    ;
  TOSH_sleep();
  TOSH_wait();
}


x86 assembly (clang, -O0):
<TOSH_run_task>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <TOSH_run_task+0x9>
mov    $0x0,%al
call   1040 <TOSH_run_next_task@plt>
cmp    $0x0,%rax
je     114f <TOSH_run_task+0x1f>
jmp    1139 <TOSH_run_task+0x9>
mov    $0x0,%al
call   1030 <TOSH_sleep@plt>
mov    $0x0,%al
call   1050 <TOSH_wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_run_task>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <TOSH_run_next_task@plt>
test   %rax,%rax
jne    1140 <TOSH_run_task+0x10>
xor    %eax,%eax
call   1030 <TOSH_sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <TOSH_wait@plt>

LLVM IR (-O0):
define void @TOSH_run_task() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @TOSH_run_next_task()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call i32 (...) @TOSH_sleep()
%7 = call i32 (...) @TOSH_wait()
ret void
}

LLVM IR (-O2):
define void @TOSH_run_task() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @TOSH_run_next_task()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 (...) @TOSH_sleep()
%6 = tail call i32 (...) @TOSH_wait()
ret void
}
/* Variables and functions */
int hexci(char);
int hex2i(char *s0) { return (hexci(s0[0]) * 16 + hexci(s0[1])); }


x86 assembly (clang, -O0):
<hex2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hexci@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <hexci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2i>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <hexci@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <hexci@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hex2i(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @hexci(i8 signext %5)
%7 = mul nsw i32 %6, 16
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @hexci(i8 signext %10)
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hex2i(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @hexci(i8 signext %2)
%4 = shl nsw i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @hexci(i8 signext %6)
%8 = add nsw i32 %7, %4
ret i32 %8
}
const char *openr2_get_version(void) { return "wtf?"; }


x86 assembly (clang, -O0):
<openr2_get_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<openr2_get_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"wtf?\00"
define i8* @openr2_get_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"wtf?\00"
define i8* @openr2_get_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int isupper(int c) {
  if ('A' <= c && c <= 'Z')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     112b <isupper+0x2b>
cmpl   $0x5a,-0x8(%rbp)
jg     112b <isupper+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <isupper+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ demo();
int main(int argc, const char *argv[]) {
  demo();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @demo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @demo()
ret i32 0
}
/* Variables and functions */
unsigned long gfx_ind(int);
int /*<<< orphan*/ gfx_outd(int, unsigned long);
void Dorado9211ClearClock(void) {
  unsigned long value;
  value = gfx_ind(0x6400 + 0x04);
  gfx_outd(0x6400 + 0x00, value & (~0x00000080));
}


x86 assembly (clang, -O0):
<Dorado9211ClearClock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
and    $0xffffffffffffff7f,%rsi
mov    $0x6400,%edi
call   1030 <gfx_outd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado9211ClearClock>:
push   %rax
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
and    $0xffffffffffffff7f,%rax
mov    $0x6400,%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <gfx_outd@plt>

LLVM IR (-O0):
define void @Dorado9211ClearClock() {
%1 = alloca i64
%2 = call i64 @gfx_ind(i32 25604)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, -129
%5 = call i32 @gfx_outd(i32 25600, i64 %4)
ret void
}

LLVM IR (-O2):
define void @Dorado9211ClearClock() {
%1 = tail call i64 @gfx_ind(i32 25604)
%2 = and i64 %1, -129
%3 = tail call i32 @gfx_outd(i32 25600, i64 %2)
ret void
}