xunge/DecIR huggingface dataset:
void write_5200_rom(unsigned int addr, unsigned int value) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @write_5200_rom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @write_5200_rom(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *roll(void *cookie) {
  (*(int *)cookie) = 0x00000000;
  pthread_exit(cookie);
}


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

x86 assembly (clang, -O2):
<roll>:
movl   $0x0,(%rdi)
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @roll(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = call i32 @pthread_exit(i8* %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @roll(i8* %0) {
%2 = bitcast i8* %0 to i32*
store i32 0, i32* %2
%3 = tail call i32 @pthread_exit(i8* %0)
ret i8* undef
}
void move(int left, int right) {}


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

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

LLVM IR (-O0):
define void @move(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @move(i32 %0, i32 %1) {
ret void
}
void sleep1s() {
  for (unsigned int j = 0; j < 65535; j++)
    ;
  for (unsigned int j = 0; j < 65535; j++)
    ;
}


x86 assembly (clang, -O0):
<sleep1s>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xffff,-0x4(%rbp)
jae    112b <sleep1s+0x2b>
jmp    111d <sleep1s+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <sleep1s+0xb>
movl   $0x0,-0x8(%rbp)
cmpl   $0xffff,-0x8(%rbp)
jae    1152 <sleep1s+0x52>
jmp    1144 <sleep1s+0x44>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <sleep1s+0x32>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sleep1s() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 65535
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
store i32 0, i32* %2
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %2
%13 = icmp ult i32 %12, 65535
br i1 %13, label %14, label %18
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = add i32 %16, 1
store i32 %17, i32* %2
br label %11
18: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @sleep1s() {
ret void
}
void tcm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @tcm_init() {
ret void
}
double vec3_dot_product(const double a[3], const double b[3]) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<vec3_dot_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_dot_product>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vec3_dot_product(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @vec3_dot_product(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fini(void) { printf("Unloading Atomic Red Team preload...\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Unloading Atomic Red Team preload...\0A\00"
define void @fini() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Unloading Atomic Red Team preload...\00"
define void @fini() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int callee();
int __attribute__((aarch64_vector_pcs)) caller(int *x) {
  if (*x)
    return callee() + 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     113b <caller+0x2b>
mov    $0x0,%al
call   1030 <callee@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <caller+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller>:
push   %rax
cmpl   $0x0,(%rdi)
je     1122 <caller+0x12>
xor    %eax,%eax
call   1030 <callee@plt>
add    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @caller(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @callee()
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int);
void brc2(int pn1, int pn2, int c) { do_csi("%d;%d%c", pn1, pn2, c); }


x86 assembly (clang, -O0):
<brc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brc2>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%d;%d%c\00"
define void @brc2(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @do_csi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d;%d%c\00"
define void @brc2(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @do_csi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
int clean_memcopysuite(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clean_memcopysuite() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb5() {
  Assert_real((isprint(181) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              910, ("isprint should be 0 for 0xb5"));
}


x86 assembly (clang, -O0):
<t_isprint_0xb5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb5,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x38e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xb5>:
push   %rax
mov    $0xb5,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x38e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb5\00"
define void @t_isprint_0xb5() {
%1 = call i64 @isprint(i32 181)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb5\00"
define void @t_isprint_0xb5() {
%1 = tail call i64 @isprint(i32 181)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_FDint16_reg(short val) {
  return ((val) & (-0xFD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FDint16_reg(i16 signext %0) {
%2 = and i16 %0, -253
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XtAppWarning() {}


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

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

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

LLVM IR (-O2):
define void @XtAppWarning() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ u_pass();
void main(void) { u_pass(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ mod_mac(int /*<<< orphan*/, int /*<<< orphan*/, int);
uint_fast32_t mod_mac_y(uint_fast32_t sum, uint_fast32_t a) {
  return mod_mac(sum, a, 104480);
}


x86 assembly (clang, -O0):
<mod_mac_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x19820,%edx
call   1030 <mod_mac@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_mac_y>:
mov    $0x19820,%edx
jmp    1030 <mod_mac@plt>

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

LLVM IR (-O2):
define i32 @mod_mac_y(i32 %0, i32 %1) {
%3 = tail call i32 @mod_mac(i32 %0, i32 %1, i32 104480)
ret i32 %3
}
/* Variables and functions */
char *current_month_name();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Current month: %s\n", current_month_name());
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <current_month_name@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <current_month_name@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Current month: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @current_month_name()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() { printf("%d %d\n", sizeof(0), sizeof(0)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
uint32_t eori0(uint32_t x) { return x ^ 0; }


x86 assembly (clang, -O0):
<eori0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x0,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @eori0(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
void *do_one_thing(void *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @do_one_thing(i8* nocapture readnone %0) {
ret i8* null
}
void DMA2_Channel4_5_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA2_Channel4_5_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int strlen(char *);
char *julian_get_clean_hhmm(char *hhmm) {
  if (!hhmm || !*hhmm || !atoi(hhmm) || (strlen(hhmm) != 4)) {
    hhmm = "0000";
  }
  return hhmm;
}


x86 assembly (clang, -O0):
<julian_get_clean_hhmm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <julian_get_clean_hhmm+0x48>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <julian_get_clean_hhmm+0x48>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
cmp    $0x0,%eax
je     1168 <julian_get_clean_hhmm+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     1173 <julian_get_clean_hhmm+0x53>
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_get_clean_hhmm>:
push   %rbx
test   %rdi,%rdi
je     1147 <julian_get_clean_hhmm+0x27>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1147 <julian_get_clean_hhmm+0x27>
mov    %rbx,%rdi
call   1040 <atoi@plt>
test   %eax,%eax
je     1147 <julian_get_clean_hhmm+0x27>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     114e <julian_get_clean_hhmm+0x2e>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"0000\00"
define i8* @julian_get_clean_hhmm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i32 @atoi(i8* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 @strlen(i8* %14)
%16 = icmp ne i32 %15, 4
br i1 %16, label %17, label %18
17: ; preds = %13, %9, %5, %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
18: ; preds = %17, %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"0000\00"
define i8* @julian_get_clean_hhmm(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 @strlen(i8* %0)
%11 = icmp eq i32 %10, 4
br i1 %11, label %13, label %12
12: ; preds = %9, %6, %3, %1
br label %13
13: ; preds = %12, %9
%14 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %12 ], [ %0, %9 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ textSize(int);
void setup() { textSize(32); }


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

x86 assembly (clang, -O2):
<setup>:
mov    $0x20,%edi
jmp    1030 <textSize@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @textSize(i32 32)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @textSize(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run();
void __start(void) { run(); }


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

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

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

LLVM IR (-O2):
define void @__start() {
%1 = tail call i32 (...) @run()
ret void
}
/* Variables and functions */
int inc(int *);
int /*<<< orphan*/ putchar(char);
void print_buffer(char *buffer, int i) {
  int end_i = i;
  do
    putchar(buffer[i]);
  while (inc(&i) != end_i);
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
lea    -0xc(%rbp),%rdi
call   1040 <inc@plt>
cmp    -0x10(%rbp),%eax
jne    1135 <print_buffer+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,0xc(%rsp)
movslq %esi,%r15
movsbl (%rdi,%r15,1),%edi
call   1030 <putchar@plt>
lea    0xc(%rsp),%rdi
call   1040 <inc@plt>
cmp    %r15d,%eax
je     117b <print_buffer+0x5b>
lea    0xc(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq 0xc(%rsp),%rax
movsbl (%r14,%rax,1),%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1040 <inc@plt>
cmp    %ebx,%eax
jne    1160 <print_buffer+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_buffer(i8* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = call i32 @putchar(i8 signext %6)
%8 = call i32 @inc(i32* %3)
%9 = icmp eq i32 %8, %1
br i1 %9, label %18, label %10
10: ; preds = %2, %10
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putchar(i8 signext %14)
%16 = call i32 @inc(i32* %3)
%17 = icmp eq i32 %16, %1
br i1 %17, label %18, label %10
18: ; preds = %10, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: rm [OPTIONS] FILE\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: rm [OPTIONS] FILE\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Usage: rm [OPTIONS] FILE\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAP_LOCKED;
int /*<<< orphan*/ do_file_dirty(int /*<<< orphan*/, char *);
void file_dirty_mlocked(void) {
  do_file_dirty(MAP_LOCKED, "file dirty mlocked");
}


x86 assembly (clang, -O0):
<file_dirty_mlocked>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <do_file_dirty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_dirty_mlocked>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <do_file_dirty@plt>

LLVM IR (-O0):
@MAP_LOCKED = global i32 0
@.str = [19 x i8] c"file dirty mlocked\00"
define void @file_dirty_mlocked() {
%1 = load i32, i32* @MAP_LOCKED
%2 = call i32 @do_file_dirty(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@MAP_LOCKED = global i32 0
@.str = [19 x i8] c"file dirty mlocked\00"
define void @file_dirty_mlocked() {
%1 = load i32, i32* @MAP_LOCKED
%2 = tail call i32 @do_file_dirty(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
long ioctl(int, int /*<<< orphan*/);
long check_for_redo(int fd_spec) { return ioctl(fd_spec, _IO('u', 24)); }


x86 assembly (clang, -O0):
<check_for_redo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x75,%edi
mov    $0x18,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_redo>:
push   %rbx
mov    %edi,%ebx
mov    $0x75,%edi
mov    $0x18,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i64 @check_for_redo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 zeroext 117, i32 24)
%5 = call i64 @ioctl(i32 %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @check_for_redo(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 117, i32 24)
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
main() {
  printf("%ld\n", 5);
  printf("%ld\n", (long)2);
  printf("%d\n", (long)3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0x5,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3)
ret i32 0
}
void BIO_ctrl_wpending(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_ctrl_wpending() {
ret void
}
void snow_task_yield() {}


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

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

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

LLVM IR (-O2):
define void @snow_task_yield() {
ret void
}
/* Variables and functions */
double DProbNormal(int /*<<< orphan*/);
int /*<<< orphan*/ DRanNormalZigVec();
double DRanQuanNormalZigVec(void) { return DProbNormal(DRanNormalZigVec()); }


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

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

LLVM IR (-O0):
define double @DRanQuanNormalZigVec() {
%1 = call i32 (...) @DRanNormalZigVec()
%2 = call double @DProbNormal(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @DRanQuanNormalZigVec() {
%1 = tail call i32 (...) @DRanNormalZigVec()
%2 = tail call double @DProbNormal(i32 %1)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_y1f();
scalar_t__ y1f(float);
void test_y1f(float f) {
  if (y1f(f) != y1f(f))
    link_failure_y1f();
}


x86 assembly (clang, -O0):
<test_y1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <y1f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <y1f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_y1f+0x3c>
mov    $0x0,%al
call   1040 <link_failure_y1f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_y1f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <y1f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <y1f@plt>
cmp    %rax,%rbx
jne    1149 <test_y1f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_y1f@plt>

LLVM IR (-O0):
define void @test_y1f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @y1f(float %3)
%5 = load float, float* %2
%6 = call i64 @y1f(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_y1f()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_y1f(float %0) {
%2 = tail call i64 @y1f(float %0)
%3 = tail call i64 @y1f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_y1f()
br label %7
7: ; preds = %5, %1
ret void
}
void fd146(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  p02A:
    goto p02A;
    goto a;
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  a : {
    typedef int(*h)[n];
  P025A:
    goto P025A;
    0;
  };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd146>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd146+0x7>

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

LLVM IR (-O0):
define void @fd146(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; preds = %27
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd146(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int algorithm(int);
int main(int argc) { return algorithm(argc); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <algorithm@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 @algorithm(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *mkdtemp(char *);
char *strdup(char *);
char *create_tempdir(void) {
  char template[] = "/tmp/tang.test.XXXXXX";
  char *tmpdir = mkdtemp(template);
  return strdup(tmpdir);
}


x86 assembly (clang, -O0):
<create_tempdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <mkdtemp@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_tempdir>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x5858585858582e,%rax
mov    %rax,0xe(%rsp)
mov    %rsp,%rdi
call   1030 <mkdtemp@plt>
mov    %rax,%rdi
call   1040 <strdup@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.create_tempdir.template = [22 x i8] c"/tmp/tang.test.XXXXXX\00"
define i8* @create_tempdir() {
%1 = alloca [22 x i8]
%2 = alloca i8*
%3 = bitcast [22 x i8]* %1 to i8*
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%5 = call i8* @mkdtemp(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@__const.create_tempdir.template = [22 x i8] c"/tmp/tang.test.XXXXXX\00"
define noalias i8* @create_tempdir() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = call i8* @mkdtemp(i8* %2)
%4 = call i8* @strdup(i8* %3)
ret i8* %4
}
int fn(int x) {
  switch (x) {
  case -1:
    return 0;
  case 0:
    return 2;
  case 2:
    return 3;
  case 12:
    return 7;
  default:
    return 255;
  }
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xd,%eax
ja     1160 <fn+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1167 <fn+0x67>
movl   $0x2,-0x4(%rbp)
jmp    1167 <fn+0x67>
movl   $0x3,-0x4(%rbp)
jmp    1167 <fn+0x67>
movl   $0x7,-0x4(%rbp)
jmp    1167 <fn+0x67>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
add    $0x1,%edi
cmp    $0xd,%edi
ja     1120 <fn+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
ret
mov    $0xff,%eax
ret
mov    $0x3,%eax
ret
mov    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @fn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 -1, label %5
i32 0, label %6
i32 2, label %7
i32 12, label %8
]
5: ; preds = %1
store i32 0, i32* %2
br label %10
6: ; preds = %1
store i32 2, i32* %2
br label %10
7: ; preds = %1
store i32 3, i32* %2
br label %10
8: ; preds = %1
store i32 7, i32* %2
br label %10
9: ; preds = %1
store i32 255, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @fn(i32 %0) {
switch i32 %0, label %5 [
i32 -1, label %6
i32 0, label %2
i32 2, label %3
i32 12, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 255, %5 ], [ 7, %4 ], [ 3, %3 ], [ 2, %2 ], [ 0, %1 ]
ret i32 %7
}
int toupper(int c) { return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     112c <toupper+0x2c>
cmpl   $0x7a,-0x4(%rbp)
jg     112c <toupper+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <toupper+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ flushall();
int /*<<< orphan*/ getchar();
int main(void) {
  flushall();
  getchar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @flushall()
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int hi_set_blocking(int sd) {
  int flags;
  flags = fcntl(sd, F_GETFL, 0);
  if (flags < 0) {
    return flags;
  }
  return fcntl(sd, F_SETFL, flags & ~O_NONBLOCK);
}


x86 assembly (clang, -O0):
<hi_set_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1146 <hi_set_blocking+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <hi_set_blocking+0x5b>
mov    -0x8(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_set_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1147 <hi_set_blocking+0x37>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @hi_set_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* %3
%14 = load i32, i32* @F_SETFL
%15 = load i32, i32* %4
%16 = load i32, i32* @O_NONBLOCK
%17 = xor i32 %16, -1
%18 = and i32 %15, %17
%19 = call i32 @fcntl(i32 %13, i32 %14, i32 %18)
store i32 %19, i32* %2
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @hi_set_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = xor i32 %7, -1
%9 = and i32 %3, %8
%10 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %9)
br label %11
11: ; preds = %1, %5
%12 = phi i32 [ %10, %5 ], [ %3, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ BTIC1H_CodecBT1H_Init();
int BTIC1H_Codec_Init() {
  static int init;
  if (init)
    return (0);
  init = 1;
  BTIC1H_CodecBT1H_Init();
  return (1);
}


x86 assembly (clang, -O0):
<BTIC1H_Codec_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
je     1131 <BTIC1H_Codec_Init+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1149 <BTIC1H_Codec_Init+0x39>
movl   $0x1,0x2ef1(%rip)
mov    $0x0,%al
call   1030 <BTIC1H_CodecBT1H_Init@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTIC1H_Codec_Init>:
push   %rax
xor    %eax,%eax
cmpb   $0x0,0x2f12(%rip)
jne    112f <BTIC1H_Codec_Init+0x1f>
movb   $0x1,0x2f09(%rip)
xor    %eax,%eax
call   1030 <BTIC1H_CodecBT1H_Init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@BTIC1H_Codec_Init.init = internal global i32 0
define i32 @BTIC1H_Codec_Init() {
%1 = alloca i32
%2 = load i32, i32* @BTIC1H_Codec_Init.init
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
store i32 1, i32* @BTIC1H_Codec_Init.init
%6 = call i32 (...) @BTIC1H_CodecBT1H_Init()
store i32 1, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@BTIC1H_Codec_Init.init = internal unnamed_addr global i1 false
define i32 @BTIC1H_Codec_Init() {
%1 = load i1, i1* @BTIC1H_Codec_Init.init
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @BTIC1H_Codec_Init.init
%3 = tail call i32 (...) @BTIC1H_CodecBT1H_Init()
br label %4
4: ; preds = %0, %2
%5 = phi i32 [ 1, %2 ], [ 0, %0 ]
ret i32 %5
}
int max(int x, int y) {
  if (x >= y) {
    return x;
  }
  return y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void ILibORTC_AddCandidate(void *stunModule, char *localUsername,
                           struct sockaddr_in6 *candidate) {
  int slot = (localUsername[0] >= 97 ? (localUsername[0] - 97)
                                     : (localUsername[0] - 65));
  if (slot < 0 || slot > 10) {
    ;
    ;
    return;
  };
  ;
}


x86 assembly (clang, -O0):
<ILibORTC_AddCandidate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1132 <ILibORTC_AddCandidate+0x32>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
mov    %eax,-0x20(%rbp)
jmp    113f <ILibORTC_AddCandidate+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1159 <ILibORTC_AddCandidate+0x59>
cmpl   $0xa,-0x1c(%rbp)
jle    115e <ILibORTC_AddCandidate+0x5e>
jmp    115e <ILibORTC_AddCandidate+0x5e>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in6 = type opaque
define void @ILibORTC_AddCandidate(i8* %0, i8* %1, %struct.sockaddr_in6* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.sockaddr_in6*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.sockaddr_in6* %2, %struct.sockaddr_in6** %6
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 97
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 97
br label %25
19: ; preds = %3
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 65
br label %25
25: ; preds = %19, %13
%26 = phi i32 [ %18, %13 ], [ %24, %19 ]
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = icmp slt i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = load i32, i32* %7
%31 = icmp sgt i32 %30, 10
br i1 %31, label %32, label %33
32: ; preds = %29, %25
br label %33
33: ; preds = %32, %29
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type opaque
define void @ILibORTC_AddCandidate(i8* nocapture %0, i8* nocapture %1, %struct.sockaddr_in6* nocapture %2) {
ret void
}