xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ o16(int);
void gfunc_call(int nb_args) {
  o16(0x120b);
  o16(0x0000);
}


x86 assembly (clang, -O0):
<gfunc_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x120b,%edi
call   1030 <o16@plt>
xor    %edi,%edi
call   1030 <o16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfunc_call>:
push   %rax
mov    $0x120b,%edi
call   1030 <o16@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <o16@plt>

LLVM IR (-O0):
define void @gfunc_call(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @o16(i32 4619)
%4 = call i32 @o16(i32 0)
ret void
}

LLVM IR (-O2):
define void @gfunc_call(i32 %0) {
%2 = tail call i32 @o16(i32 4619)
%3 = tail call i32 @o16(i32 0)
ret void
}
int is_vowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}


x86 assembly (clang, -O0):
<is_vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x69,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6f,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x75,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vowel>:
lea    -0x61(%rdi),%eax
ror    %al
cmp    $0x8,%al
jae    111b <is_vowel+0x1b>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x95,%edx
bt     %ecx,%edx
jb     1124 <is_vowel+0x24>
xor    %eax,%eax
cmp    $0x75,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_vowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 8
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i8 %0, 117
%7 = zext i1 %6 to i32
br label %12
8: ; preds = %1
%9 = lshr i8 -107, %3
%10 = and i8 %9, 1
%11 = icmp eq i8 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ test_base64length();
int main(void) {
  test_base64length();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_base64length@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_base64length()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_base64length()
ret i32 0
}
InitWindows(argc, argv) int argc;
char *argv[];
{
  int i, j;
  char **buffer1, **buffer2;
}


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

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

LLVM IR (-O0):
define i32 @InitWindows(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @InitWindows(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
void hf_handler() {
  volatile int i = 0;
  while (!i) {
  }
}


x86 assembly (clang, -O0):
<hf_handler>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1123 <hf_handler+0x23>
jmp    1128 <hf_handler+0x28>
jmp    110b <hf_handler+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hf_handler>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,-0x4(%rsp)
je     1110 <hf_handler+0x10>
ret

LLVM IR (-O0):
define void @hf_handler() {
%1 = alloca i32
store volatile i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @hf_handler() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
char *parse_android(char *agent) {
  char *p;
  p = agent;
  while (*p != ';' && *p != ')' && *p != '(' && *p != '\0')
    p++;
  *p = 0;
  return agent;
}


x86 assembly (clang, -O0):
<parse_android>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3b,%ecx
mov    %al,-0x11(%rbp)
je     115f <parse_android+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x29,%ecx
mov    %al,-0x11(%rbp)
je     115f <parse_android+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x28,%ecx
mov    %al,-0x11(%rbp)
je     115f <parse_android+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <parse_android+0x6f>
jmp    1180 <parse_android+0x80>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <parse_android+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_android>:
mov    %rdi,%rax
movabs $0x800030000000001,%rdx
mov    %rdi,%rcx
jmp    1124 <parse_android+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
movzbl (%rcx),%esi
cmp    $0x3b,%rsi
ja     1120 <parse_android+0x20>
bt     %rsi,%rdx
jae    1120 <parse_android+0x20>
movb   $0x0,(%rcx)
ret

LLVM IR (-O0):
define i8* @parse_android(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 59
br i1 %9, label %10, label %25
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 41
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 40
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br label %25
25: ; preds = %20, %15, %10, %5
%26 = phi i1 [ false, %15 ], [ false, %10 ], [ false, %5 ], [ %24, %20 ]
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %5
30: ; preds = %25
%31 = load i8*, i8** %3
store i8 0, i8* %31
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
define i8* @parse_android(i8* returned %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 59, label %7
i8 41, label %7
i8 40, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
store i8 0, i8* %3
ret i8* %0
}
void vec3_inverse(float *dst) {
  dst[0] = 1.0 / dst[0];
  dst[1] = 1.0 / dst[1];
  dst[2] = 1.0 / dst[2];
}


x86 assembly (clang, -O0):
<vec3_inverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_inverse>:
movss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
divss  (%rdi),%xmm1
movss  %xmm1,(%rdi)
movaps %xmm0,%xmm1
divss  0x4(%rdi),%xmm1
movss  %xmm1,0x4(%rdi)
divss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vec3_inverse(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = fdiv double 1.000000e+00, %6
%8 = fptrunc double %7 to float
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = fptrunc double %15 to float
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 1
store float %16, float* %18
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = fdiv double 1.000000e+00, %22
%24 = fptrunc double %23 to float
%25 = load float*, float** %2
%26 = getelementptr inbounds float, float* %25, i64 2
store float %24, float* %26
ret void
}

LLVM IR (-O2):
define void @vec3_inverse(float* nocapture %0) {
%2 = load float, float* %0
%3 = fdiv float 1.000000e+00, %2
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fdiv float 1.000000e+00, %5
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fdiv float 1.000000e+00, %8
store float %9, float* %7
ret void
}
/* Variables and functions */
int platform_linux_getch();
extern int platform_getch(void) { return platform_linux_getch(); }


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

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

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

LLVM IR (-O2):
define i32 @platform_getch() {
%1 = tail call i32 (...) @platform_linux_getch()
ret i32 %1
}
int test_imm_57uint8_mem(unsigned char *val) {
  return ((*val) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%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_57uint8_mem>:
testb  $0x57,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_57uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %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_57uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 87
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double lados;
  scanf("%lf", &lados);
  printf("%.0f\n", (lados * (lados - 3)) / 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb7(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xebb(%rip),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 3.000000e+00
%7 = fmul double %4, %6
%8 = fdiv double %7, 2.000000e+00
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fadd double %4, -3.000000e+00
%6 = fmul double %4, %5
%7 = fmul double %6, 5.000000e-01
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
unsigned int UARTRXCTSDSRTransitionStatusGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x44)))) & (0x00000002u));
}


x86 assembly (clang, -O0):
<UARTRXCTSDSRTransitionStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRXCTSDSRTransitionStatusGet>:
add    $0x44,%edi
mov    (%rdi),%eax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @UARTRXCTSDSRTransitionStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 68
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTRXCTSDSRTransitionStatusGet(i32 %0) {
%2 = add i32 %0, 68
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 2
ret i32 %6
}
__attribute__((weak)) void DBGU_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @DBGU_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int diminuto_ipc4_close(int);
int diminuto_ping4_close(int fd) { return diminuto_ipc4_close(fd); }


x86 assembly (clang, -O0):
<diminuto_ping4_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <diminuto_ipc4_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ping4_close>:
jmp    1030 <diminuto_ipc4_close@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ping4_close(i32 %0) {
%2 = tail call i32 @diminuto_ipc4_close(i32 %0)
ret i32 %2
}
double ls_costN_nm7_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_costN_nm7_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_costN_nm7_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_costN_nm7_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_costN_nm7_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_costN_nm7_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm7_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm7_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_costN_nm7_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
int omap_sata_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_sata_init() {
ret i32 0
}
int r(int i) { return 2 * i + 2; }


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @r(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @r(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
double strtod(char const *, char **);
double atof(const char *ascii) { return (strtod(ascii, (char **)NULL)); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i8** null)
ret double %2
}
int calc_boundary_padding(int wTiles, int hTiles) {
  float data_size =
      ((float)((float)(((float)wTiles * (float)hTiles * (float)(64 * 32)) /
                       (float)(4 * (64 * 32)))));
  data_size = data_size - (float)((int)data_size);
  return (int)(data_size * (float)(4 * (64 * 32)));
}


x86 assembly (clang, -O0):
<calc_boundary_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xee4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeac(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_boundary_padding>:
cvtsi2ss %edi,%xmm0
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
mulss  0xeec(%rip),%xmm1
mulss  0xee8(%rip),%xmm1
cvttps2dq %xmm1,%xmm0
cvtdq2ps %xmm0,%xmm0
subss  %xmm0,%xmm1
mulss  0xed9(%rip),%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @calc_boundary_padding(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fmul float %7, %9
%11 = fmul float %10, 2.048000e+03
%12 = fdiv float %11, 8.192000e+03
store float %12, float* %5
%13 = load float, float* %5
%14 = load float, float* %5
%15 = fptosi float %14 to i32
%16 = sitofp i32 %15 to float
%17 = fsub float %13, %16
store float %17, float* %5
%18 = load float, float* %5
%19 = fmul float %18, 8.192000e+03
%20 = fptosi float %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @calc_boundary_padding(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = sitofp i32 %1 to float
%5 = fmul float %3, %4
%6 = fmul float %5, 2.048000e+03
%7 = fmul float %6, 0x3F20000000000000
%8 = fptosi float %7 to i32
%9 = sitofp i32 %8 to float
%10 = fsub float %7, %9
%11 = fmul float %10, 8.192000e+03
%12 = fptosi float %11 to i32
ret i32 %12
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_release_name(void *bus, const char *name) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_release_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_release_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_release_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int delete_service_comment(unsigned long comment_id) {}


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

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

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

LLVM IR (-O2):
define i32 @delete_service_comment(i64 %0) {
ret i32 undef
}
int getbit(int number, int pos) { return (number >> pos) & 1; }


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getbit(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 = ashr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @getbit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ changelog_rotate();
int /*<<< orphan*/ main_exit();
scalar_t__ meta_storeall(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void meta_dostoreall(void) {
  changelog_rotate();
  if (meta_storeall(1) <= 0) {
    syslog(LOG_ERR, "can't store metadata - exiting");
    main_exit();
  }
}


x86 assembly (clang, -O0):
<meta_dostoreall>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <changelog_rotate@plt>
mov    $0x1,%edi
call   1040 <meta_storeall@plt>
cmp    $0x0,%rax
jg     117b <meta_dostoreall+0x3b>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1060 <syslog@plt>
mov    $0x0,%al
call   1050 <main_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<meta_dostoreall>:
push   %rax
xor    %eax,%eax
call   1030 <changelog_rotate@plt>
mov    $0x1,%edi
call   1040 <meta_storeall@plt>
test   %rax,%rax
jle    1159 <meta_dostoreall+0x19>
pop    %rax
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1060 <syslog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <main_exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [31 x i8] c"can't store metadata - exiting\00"
define void @meta_dostoreall() {
%1 = call i32 (...) @changelog_rotate()
%2 = call i64 @meta_storeall(i32 1)
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @LOG_ERR
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @main_exit()
br label %8
8: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [31 x i8] c"can't store metadata - exiting\00"
define void @meta_dostoreall() {
%1 = tail call i32 (...) @changelog_rotate()
%2 = tail call i64 @meta_storeall(i32 1)
%3 = icmp slt i64 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @LOG_ERR
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @main_exit()
br label %8
8: ; preds = %4, %0
ret void
}
/* Variables and functions */
unsigned char *aes256cbc_encrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_encrypt_aes256cbc(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes256cbc_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_aes256cbc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <aes256cbc_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_aes256cbc>:
jmp    1030 <aes256cbc_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_aes256cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @aes256cbc_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_aes256cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes256cbc_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
int clamp0255(int x) { return x < 0 ? 0 : (x > 255 ? 255 : x); }


x86 assembly (clang, -O0):
<clamp0255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <clamp0255+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <clamp0255+0x41>
cmpl   $0xff,-0x4(%rbp)
jle    1135 <clamp0255+0x35>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <clamp0255+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp0255>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp0255(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char const *argv[]) {
  puts("Hello World!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
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 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int abc[] = {0, 1, 2};
  int *copy = abc;
  copy[0] = 3;
  assert(abc[0] == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.abc = [3 x i32] [i32 0, i32 1, i32 2]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = bitcast [3 x i32]* %1 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 3, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ FLine(int /*<<< orphan*/ *);
int strtoi(int /*<<< orphan*/);
int getNumLines(FILE *file) { return strtoi(FLine(file)); }


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

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

LLVM IR (-O0):
define i32 @getNumLines(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @FLine(i32* %3)
%5 = call i32 @strtoi(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @getNumLines(i32* %0) {
%2 = tail call i32 @FLine(i32* %0)
%3 = tail call i32 @strtoi(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned long reg_r(void *, int);
int /*<<< orphan*/ reg_w(void *, int, int);
unsigned long mac_r(void *base, int reg) {
  reg_w(base, 0xA4, 0xc0000000 + reg);
  return reg_r(base, 0xA8);
}


x86 assembly (clang, -O0):
<mac_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0xc0000000,%edx
mov    $0xa4,%esi
call   1030 <reg_w@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa8,%esi
call   1040 <reg_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_r>:
push   %rbx
mov    %rdi,%rbx
lea    -0x40000000(%rsi),%edx
mov    $0xa4,%esi
call   1030 <reg_w@plt>
mov    %rbx,%rdi
mov    $0xa8,%esi
pop    %rbx
jmp    1040 <reg_r@plt>

LLVM IR (-O0):
define i64 @mac_r(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = add i32 -1073741824, %6
%8 = call i32 @reg_w(i8* %5, i32 164, i32 %7)
%9 = load i8*, i8** %3
%10 = call i64 @reg_r(i8* %9, i32 168)
ret i64 %10
}

LLVM IR (-O2):
define i64 @mac_r(i8* %0, i32 %1) {
%3 = add i32 %1, -1073741824
%4 = tail call i32 @reg_w(i8* %0, i32 164, i32 %3)
%5 = tail call i64 @reg_r(i8* %0, i32 168)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
int inet6_opt_get_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy(val, (uint8_t *)databuf + offset, vallen);
  return offset + vallen;
}


x86 assembly (clang, -O0):
<inet6_opt_get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_get_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rsi
mov    %rdx,%rdi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i8* %9, i32* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i8* %2, i32* %7, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_sigterm(int sig) { exit(0); }


x86 assembly (clang, -O0):
<signal_sigterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<signal_sigterm>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @signal_sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @signal_sigterm(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
extern int divs(int a, int b) { return a / b; }


x86 assembly (clang, -O0):
<divs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divs>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divs(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @divs(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int select_modulation(int mask) {
  int val;
  val = 0x8000;
  if (mask & (1 << 12))
    val = (1 << 12);
  if (mask & (1 << 10))
    val = (1 << 10);
  if (mask & (1 << 1))
    val = (1 << 1);
  if (mask & (1 << 0))
    val = (1 << 0);
  return val;
}


x86 assembly (clang, -O0):
<select_modulation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x8000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
je     1126 <select_modulation+0x26>
movl   $0x1000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     113e <select_modulation+0x3e>
movl   $0x400,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1154 <select_modulation+0x54>
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116a <select_modulation+0x6a>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_modulation>:
test   $0x1000,%edi
mov    $0x8000,%eax
mov    $0x1000,%ecx
cmove  %eax,%ecx
test   $0x400,%edi
mov    $0x400,%eax
cmove  %ecx,%eax
test   $0x2,%dil
mov    $0x2,%ecx
cmove  %eax,%ecx
test   $0x1,%dil
mov    $0x1,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @select_modulation(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 32768, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 4096
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 4096, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 1024
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1024, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
%15 = and i32 %14, 2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %3
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %2
%20 = and i32 %19, 1
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @select_modulation(i32 %0) {
%2 = and i32 %0, 4096
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 32768, i32 4096
%5 = and i32 %0, 1024
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 %4, i32 1024
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 %7, i32 2
%11 = and i32 %0, 1
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 %10, i32 1
ret i32 %13
}
/* Variables and functions */
char *TukeysNinther(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char const);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  char chars[] = "RLAPMCGAXZKRBRJJE";
  const char *med = TukeysNinther(chars, strlen(chars), sizeof(char));
  printf("%c\n", *med);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea4(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1060 <TukeysNinther@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
lea    0xe72(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x45,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1060 <TukeysNinther@plt>
movsbl (%rax),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.chars = [18 x i8] c"RLAPMCGAXZKRBRJJE\00"
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [18 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [18 x i8]* %2 to i8*
%5 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i8* @TukeysNinther(i8* %5, i32 %7, i32 1)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.chars = [18 x i8] c"RLAPMCGAXZKRBRJJE\00"
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i8* @TukeysNinther(i8* %2, i32 %3, i32 1)
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", f(1));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ region_write(int, int, int, int /*<<< orphan*/);
void i2c_trx_resume(void) { region_write((0xE1800000), 0x1, 4, 0); }


x86 assembly (clang, -O0):
<i2c_trx_resume>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe1800000,%edi
mov    $0x1,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <region_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_trx_resume>:
mov    $0xe1800000,%edi
mov    $0x1,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <region_write@plt>

LLVM IR (-O0):
define void @i2c_trx_resume() {
%1 = call i32 @region_write(i32 -511705088, i32 1, i32 4, i32 0)
ret void
}

LLVM IR (-O2):
define void @i2c_trx_resume() {
%1 = tail call i32 @region_write(i32 -511705088, i32 1, i32 4, i32 0)
ret void
}
int fun303() { return 303; }


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

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

LLVM IR (-O0):
define i32 @fun303() {
ret i32 303
}

LLVM IR (-O2):
define i32 @fun303() {
ret i32 303
}
void interpret(char *myinput) {}


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

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

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

LLVM IR (-O2):
define void @interpret(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIFLUSH;
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ tcflush(int /*<<< orphan*/, int /*<<< orphan*/);
void flush_in(void) { tcflush(fileno(stdin), TCIFLUSH); }


x86 assembly (clang, -O0):
<flush_in>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_in>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    0x2ea2(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@stdin = global i32 0
@TCIFLUSH = global i32 0
define void @flush_in() {
%1 = load i32, i32* @stdin
%2 = call i32 @fileno(i32 %1)
%3 = load i32, i32* @TCIFLUSH
%4 = call i32 @tcflush(i32 %2, i32 %3)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@TCIFLUSH = global i32 0
define void @flush_in() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fileno(i32 %1)
%3 = load i32, i32* @TCIFLUSH
%4 = tail call i32 @tcflush(i32 %2, i32 %3)
ret void
}
int muspcm_load_mixlr(int slot, int noL, int noR) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @muspcm_load_mixlr(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}