xunge/DecIR huggingface dataset:
/* Variables and functions */
int fpow(double, int);
int xpow(int, int);
float get_max_float() {
  int exp_bit = 8;
  int frac_bit = 23;
  float frac = 1 - fpow(0.5, frac_bit);
  float true_frac = 1 + frac;
  int exp = xpow(2, exp_bit - 1) - 1;
  float times = fpow(2.0, exp);
  float max = true_frac * times;
  return max;
}


x86 assembly (clang, -O0):
<get_max_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x8,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
mov    -0x8(%rbp),%edi
movsd  0xec7(%rip),%xmm0
call   1040 <fpow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb0(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1030 <xpow@plt>
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
movsd  0xe75(%rip),%xmm0
call   1040 <fpow@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_float>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x17,%edi
call   1040 <fpow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
addss  0xec7(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
mov    $0x7,%esi
call   1030 <xpow@plt>
lea    -0x1(%rax),%edi
movsd  0xe9f(%rip),%xmm0
call   1040 <fpow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @get_max_float() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 8, i32* %1
store i32 23, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @fpow(double 5.000000e-01, i32 %8)
%10 = sub nsw i32 1, %9
%11 = sitofp i32 %10 to float
store float %11, float* %3
%12 = load float, float* %3
%13 = fadd float 1.000000e+00, %12
store float %13, float* %4
%14 = load i32, i32* %1
%15 = sub nsw i32 %14, 1
%16 = call i32 @xpow(i32 2, i32 %15)
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = call i32 @fpow(double 2.000000e+00, i32 %18)
%20 = sitofp i32 %19 to float
store float %20, float* %6
%21 = load float, float* %4
%22 = load float, float* %6
%23 = fmul float %21, %22
store float %23, float* %7
%24 = load float, float* %7
ret float %24
}

LLVM IR (-O2):
define float @get_max_float() {
%1 = tail call i32 @fpow(double 5.000000e-01, i32 23)
%2 = sub nsw i32 1, %1
%3 = sitofp i32 %2 to float
%4 = fadd float %3, 1.000000e+00
%5 = tail call i32 @xpow(i32 2, i32 7)
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fpow(double 2.000000e+00, i32 %6)
%8 = sitofp i32 %7 to float
%9 = fmul float %4, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_PW6_PIN() { set_io_bit(0x40, 6); }


x86 assembly (clang, -O0):
<TOSH_SET_PW6_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_PW6_PIN>:
mov    $0x40,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_PW6_PIN() {
%1 = call i32 @set_io_bit(i32 64, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_PW6_PIN() {
%1 = tail call i32 @set_io_bit(i32 64, i32 6)
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
int /*<<< orphan*/ spawn_rand_particle();
void random_spawn() {
  while ((float)rand() / RAND_MAX > 0.8)
    spawn_rand_particle();
}


x86 assembly (clang, -O0):
<random_spawn>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <random_spawn+0x9>
mov    $0x0,%al
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eac(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1162 <random_spawn+0x42>
mov    $0x0,%al
call   1030 <spawn_rand_particle@plt>
jmp    1129 <random_spawn+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_spawn>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
divss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd 0xeb0(%rip),%xmm0
jbe    116a <random_spawn+0x4a>
xor    %eax,%eax
call   1030 <spawn_rand_particle@plt>
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
jmp    1140 <random_spawn+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define void @random_spawn() {
br label %1
1: ; preds = %8, %0
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = load float, float* @RAND_MAX
%5 = fdiv float %3, %4
%6 = fpext float %5 to double
%7 = fcmp ogt double %6, 8.000000e-01
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @spawn_rand_particle()
br label %1
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define void @random_spawn() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 8.000000e-01
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = tail call i32 (...) @spawn_rand_particle()
%9 = tail call i64 (...) @rand()
%10 = sitofp i64 %9 to float
%11 = load float, float* @RAND_MAX
%12 = fdiv float %10, %11
%13 = fpext float %12 to double
%14 = fcmp ogt double %13, 8.000000e-01
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret void
}
void free_measurements() { return; }


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

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

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

LLVM IR (-O2):
define void @free_measurements() {
ret void
}
int hlp_string_diff(register const char *const s1,
                    register const char *const s2) {
  register int i = 0;
  while (s1[i] && (s1[i] == s2[i])) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<hlp_string_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     114d <hlp_string_diff+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    115d <hlp_string_diff+0x5d>
jmp    116b <hlp_string_diff+0x6b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <hlp_string_diff+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_string_diff>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <hlp_string_diff+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1122 <hlp_string_diff+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <hlp_string_diff+0x10>
ret

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

LLVM IR (-O2):
define i32 @hlp_string_diff(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2, %12
%6 = phi i64 [ %13, %12 ], [ 0, %2 ]
%7 = phi i8 [ %16, %12 ], [ %3, %2 ]
%8 = phi i32 [ %14, %12 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %6
%10 = load i8, i8* %9
%11 = icmp eq i8 %7, %10
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = add nuw i64 %6, 1
%14 = add nuw nsw i32 %8, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %20, label %5
18: ; preds = %5
%19 = trunc i64 %6 to i32
br label %20
20: ; preds = %12, %18, %2
%21 = phi i32 [ 0, %2 ], [ %19, %18 ], [ %14, %12 ]
ret i32 %21
}
/* Type definitions */
struct C {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ C_read(void *, struct C *, int, unsigned long);
int read_raw_varint32(unsigned long *, void *, int);
int C_read_delimited_from(void *_buffer, struct C *_C, int offset) {
  unsigned long size;
  offset = read_raw_varint32(&size, _buffer, offset);
  C_read(_buffer, _C, offset, size + offset);
  return offset + size;
}


x86 assembly (clang, -O0):
<C_read_delimited_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1030 <read_raw_varint32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rax,%rcx
call   1040 <C_read@plt>
movslq -0x14(%rbp),%rax
add    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_read_delimited_from>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1030 <read_raw_varint32@plt>
movslq %eax,%rbx
mov    0x8(%rsp),%rcx
add    %rbx,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <C_read@plt>
add    0x8(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.C = type { i32 }
define i32 @C_read_delimited_from(i8* %0, %struct.C* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.C*
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store %struct.C* %1, %struct.C** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @read_raw_varint32(i64* %7, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %4
%12 = load %struct.C*, %struct.C** %5
%13 = load i32, i32* %6
%14 = load i64, i64* %7
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add i64 %14, %16
%18 = call i32 @C_read(i8* %11, %struct.C* %12, i32 %13, i64 %17)
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = load i64, i64* %7
%22 = add i64 %20, %21
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
%struct.C = type { i32 }
define i32 @C_read_delimited_from(i8* %0, %struct.C* %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @read_raw_varint32(i64* %4, i8* %0, i32 %2)
%7 = load i64, i64* %4
%8 = sext i32 %6 to i64
%9 = add i64 %7, %8
%10 = call i32 @C_read(i8* %0, %struct.C* %1, i32 %6, i64 %9)
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = add i32 %6, %12
ret i32 %13
}
double Tween_CubicInEasing(double k) { return k * k * k; }


x86 assembly (clang, -O0):
<Tween_CubicInEasing>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_CubicInEasing>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Tween_CubicInEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Tween_CubicInEasing(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
void xinitcgo(void) {}


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

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

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

LLVM IR (-O2):
define void @xinitcgo() {
ret void
}
int test_imm_B6uint8_reg(unsigned char val) {
  return ((val) & (-0xB6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B6uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B6uint8_reg>:
test   $0x4a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B6uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -182
%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_B6uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 74
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "smoothing via DFT convolution  \n");
  fprintf(stderr, "   gaussconv_dft IN SIGMA OUT  \n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef2(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"smoothing via DFT convolution \0A\00"
@.str.1 = [33 x i8] c" gaussconv_dft IN SIGMA OUT \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"smoothing via DFT convolution \0A\00"
@.str.1 = [33 x i8] c" gaussconv_dft IN SIGMA OUT \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int f1(int x, int y, int z) {
  if (x > 100) {
    x++;
    z = -z;
  } else {
    x = -x;
    y = -y;
    z = 1;
  }
  return x + y + z;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    112d <f1+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <f1+0x44>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0x1(%rdi),%r8d
neg    %edx
mov    %edi,%ecx
neg    %ecx
mov    %esi,%eax
neg    %eax
cmp    $0x65,%edi
cmovge %r8d,%ecx
cmovge %esi,%eax
mov    $0x1,%esi
cmovge %edx,%esi
add    %ecx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = icmp sgt i32 %7, 100
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = load i32, i32* %6
%13 = sub nsw i32 0, %12
store i32 %13, i32* %6
br label %19
14: ; preds = %3
%15 = load i32, i32* %4
%16 = sub nsw i32 0, %15
store i32 %16, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 0, %17
store i32 %18, i32* %5
store i32 1, i32* %6
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %6
%24 = add nsw i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 100
%5 = add nsw i32 %0, 1
%6 = sub nsw i32 0, %2
%7 = sub nsw i32 0, %0
%8 = sub nsw i32 0, %1
%9 = select i1 %4, i32 %5, i32 %7
%10 = select i1 %4, i32 %1, i32 %8
%11 = select i1 %4, i32 %6, i32 1
%12 = add nsw i32 %9, %10
%13 = add nsw i32 %12, %11
ret i32 %13
}
int wifi_load_driver() { return -1; }


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

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

LLVM IR (-O0):
define i32 @wifi_load_driver() {
ret i32 -1
}

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


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

x86 assembly (clang, -O2):
<xrop3_211_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_211_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
void test1() {
  goto c;
d:
  goto e;
c:;
  int i;
  return;
  goto b;
  goto a;
b:
  i = 1;
a:
  i = 2;
  goto f;
e:
  goto d;
f:;
}


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

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

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
br label %3
2: ; preds = %6
br label %6
3: ; preds = %0
br label %8
4: ; No predecessors!
store i32 1, i32* %1
br label %5
5: ; preds = %4
store i32 2, i32* %1
br label %7
6: ; preds = %2
br label %2
7: ; preds = %5
br label %8
8: ; preds = %7, %3
ret void
}

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

/* Variables and functions */
scalar_t__ swap_path(char *, int);
int swap_read_usage(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
unsigned swap_enabled(void) {
  char path[256];
  return (swap_path(path, sizeof(path)) ? swap_read_usage(path, NULL, NULL)
                                        : 0);
}


x86 assembly (clang, -O0):
<swap_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
call   1040 <swap_path@plt>
cmp    $0x0,%rax
je     1164 <swap_enabled+0x44>
lea    -0x100(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <swap_read_usage@plt>
mov    %eax,-0x104(%rbp)
jmp    1171 <swap_enabled+0x51>
xor    %eax,%eax
mov    %eax,-0x104(%rbp)
jmp    1171 <swap_enabled+0x51>
mov    -0x104(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_enabled>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <swap_path@plt>
test   %rax,%rax
je     114d <swap_enabled+0x2d>
mov    %rsp,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <swap_read_usage@plt>
add    $0x108,%rsp
ret
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @swap_enabled() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i64 @swap_path(i8* %2, i32 256)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @swap_read_usage(i8* %6, i32* null, i32* null)
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @swap_enabled() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i64 @swap_path(i8* %2, i32 256)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @swap_read_usage(i8* %2, i32* null, i32* null)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ %6, %5 ], [ 0, %0 ]
ret i32 %8
}
int nf_hook_ingress_active(struct sk_buff *skb) { return 0; }


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define i32 @nf_hook_ingress_active(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
ret i32 0
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define i32 @nf_hook_ingress_active(%struct.sk_buff* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PodExit();
int /*<<< orphan*/ PodInit();
int /*<<< orphan*/ Read();
int /*<<< orphan*/ Write();
int PodMain(void) {
  PodInit();
  Write();
  Read();
  PodExit();
  return 0;
}


x86 assembly (clang, -O0):
<PodMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <PodInit@plt>
mov    $0x0,%al
call   1060 <Write@plt>
mov    $0x0,%al
call   1040 <Read@plt>
mov    $0x0,%al
call   1030 <PodExit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PodMain>:
push   %rax
xor    %eax,%eax
call   1050 <PodInit@plt>
xor    %eax,%eax
call   1060 <Write@plt>
xor    %eax,%eax
call   1040 <Read@plt>
xor    %eax,%eax
call   1030 <PodExit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PodMain() {
%1 = call i32 (...) @PodInit()
%2 = call i32 (...) @Write()
%3 = call i32 (...) @Read()
%4 = call i32 (...) @PodExit()
ret i32 0
}

LLVM IR (-O2):
define i32 @PodMain() {
%1 = tail call i32 (...) @PodInit()
%2 = tail call i32 (...) @Write()
%3 = tail call i32 (...) @Read()
%4 = tail call i32 (...) @PodExit()
ret i32 0
}
void intern_del(void *entry) { (void)entry; }


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

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

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

LLVM IR (-O2):
define void @intern_del(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int isize;

/* Variables and functions */
int LZ4_compressBound(size_t isize) {
  return ((unsigned int)(isize) > (unsigned int)0x7E000000
              ? 0
              : (isize) + ((isize) / 255) + 16);
}


x86 assembly (clang, -O0):
<LZ4_compressBound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x7e000000,%eax
jbe    1122 <LZ4_compressBound+0x22>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    114a <LZ4_compressBound+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xff,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressBound>:
xor    %eax,%eax
cmp    $0x7e000000,%edi
ja     1124 <LZ4_compressBound+0x24>
movabs $0x8080808080808081,%rcx
80 80 80
mov    %rdi,%rax
mul    %rcx
shr    $0x7,%rdx
lea    (%rdx,%rdi,1),%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @LZ4_compressBound(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = icmp ugt i32 %4, 2113929216
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i64, i64* %2
%9 = load i64, i64* %2
%10 = udiv i64 %9, 255
%11 = add i64 %8, %10
%12 = add i64 %11, 16
br label %13
13: ; preds = %7, %6
%14 = phi i64 [ 0, %6 ], [ %12, %7 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @LZ4_compressBound(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = icmp ugt i32 %2, 2113929216
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = udiv i64 %0, 255
%6 = add i64 %5, %0
%7 = trunc i64 %6 to i32
%8 = add i32 %7, 16
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void eerror(const char *string) { error("%s: %s", string, strerror(errno)); }


x86 assembly (clang, -O0):
<eerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb0(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eerror>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @eerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @eerror(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
abc() { printf("Jobs "); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Jobs \00"
define i32 @abc() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ valid_prefix(char *);
int main(int argc, char **argv) {
  while (--argc) {
    if (!valid_prefix(*++argv))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     116a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <valid_prefix@plt>
cmp    $0x0,%eax
jne    1165 <main+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1171 <main+0x61>
jmp    1126 <main+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cmp    %ebx,%r15d
je     113d <main+0x2d>
mov    (%r14,%rbx,8),%rdi
call   1030 <valid_prefix@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <main+0x10>
mov    $0x1,%eax
jmp    113f <main+0x2f>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ %0, %2 ], [ %6, %8 ]
%5 = phi i8** [ %1, %2 ], [ %9, %8 ]
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8*, i8** %5, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @valid_prefix(i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %3
13: ; preds = %3, %8
%14 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void msg_error_var_already_exists(char *s) {
  printf("Error: there's already someone called %s here.\n", s);
}


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

x86 assembly (clang, -O2):
<msg_error_var_already_exists>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Error: there's already someone called %s here.\0A\00"
define void @msg_error_var_already_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Error: there's already someone called %s here.\0A\00"
define void @msg_error_var_already_exists(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ svga_write_common(int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/, void *);
void svga_write(uint32_t addr, uint8_t val, void *p) {
  svga_write_common(addr, val, 0, p);
}


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

x86 assembly (clang, -O2):
<svga_write>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <svga_write_common@plt>

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

LLVM IR (-O2):
define void @svga_write(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @svga_write_common(i32 %0, i32 %1, i32 0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_rx(char *, int);
void scan_line(char *line, int max_len) { serial_rx(line, max_len); }


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

x86 assembly (clang, -O2):
<scan_line>:
jmp    1030 <serial_rx@plt>

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

LLVM IR (-O2):
define void @scan_line(i8* %0, i32 %1) {
%3 = tail call i32 @serial_rx(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _write_decimal(int);
void _write_decimal_10(uint8_t value) {
  uint8_t decimal_10 = (value % 100) / 10;
  if (decimal_10 != 0) {
    _write_decimal(decimal_10);
  }
}


x86 assembly (clang, -O0):
<_write_decimal_10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1145 <_write_decimal_10+0x35>
mov    -0x8(%rbp),%edi
call   1030 <_write_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_decimal_10>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
mov    %eax,%ecx
neg    %ecx
add    %edi,%ecx
add    $0x9,%ecx
cmp    $0x13,%ecx
jae    1139 <_write_decimal_10+0x29>
ret
sub    %eax,%edi
movsbl %dil,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xa,%ecx
add    %al,%cl
movsbl %cl,%edi
jmp    1030 <_write_decimal@plt>

LLVM IR (-O0):
define void @_write_decimal_10(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 100
%6 = sdiv i32 %5, 10
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @_write_decimal(i32 %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @_write_decimal_10(i32 %0) {
%2 = srem i32 %0, 100
%3 = add nsw i32 %2, 9
%4 = icmp ult i32 %3, 19
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = trunc i32 %2 to i8
%7 = sdiv i8 %6, 10
%8 = sext i8 %7 to i32
%9 = tail call i32 @_write_decimal(i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort_array();
int /*<<< orphan*/ start();
int /*<<< orphan*/ stop();
int main() {
  start();
  sort_array();
  stop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start()
%2 = tail call i32 (...) @sort_array()
%3 = tail call i32 (...) @stop()
ret i32 0
}
int lqtvq_fmin(int x, int y) { return ((x < y) ? x : y); }


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

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

LLVM IR (-O0):
define i32 @lqtvq_fmin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @lqtvq_fmin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int compare(const void *x, const void *y) {
  int a = *(int *)x;
  int b = *(int *)y;
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <compare+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <compare+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void uksm_vma_add_new(struct vm_area_struct *vma) {}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define void @uksm_vma_add_new(%struct.vm_area_struct* %0) {
%2 = alloca %struct.vm_area_struct*
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %2
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @uksm_vma_add_new(%struct.vm_area_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int maxfactor_checker(int, int const);
int maxfactor(int a) {
  assert(a > 1);
  const int half_of_a = (a / 2);
  return ((a % 2) == 0) ? half_of_a : maxfactor_checker(a, half_of_a);
}


x86 assembly (clang, -O0):
<maxfactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1169 <maxfactor+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <maxfactor+0x57>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <maxfactor_checker@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxfactor>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x2,%ebx
setge  %dil
call   1030 <assert@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
test   $0x1,%bl
jne    1141 <maxfactor+0x21>
pop    %rbx
ret
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <maxfactor_checker@plt>

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

LLVM IR (-O2):
define i32 @maxfactor(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sdiv i32 %0, 2
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @maxfactor_checker(i32 %0, i32 %5)
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ %9, %8 ], [ %5, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ raw();
int /*<<< orphan*/ wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void Continue(WINDOW *win) {
  mvwaddstr(win, 10, 1, " Press any key to continue");
  wrefresh(win);
  raw();
  wgetch(win);
}


x86 assembly (clang, -O0):
<Continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
lea    0xe9f(%rip),%rcx
call   1060 <mvwaddstr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    $0x0,%al
call   1040 <raw@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wgetch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Continue>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rcx
mov    $0xa,%esi
mov    $0x1,%edx
call   1060 <mvwaddstr@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
xor    %eax,%eax
call   1040 <raw@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wgetch@plt>

LLVM IR (-O0):
@.str = [27 x i8] c" Press any key to continue\00"
define void @Continue(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @mvwaddstr(i32* %3, i32 10, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @wrefresh(i32* %5)
%7 = call i32 (...) @raw()
%8 = load i32*, i32** %2
%9 = call i32 @wgetch(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c" Press any key to continue\00"
define void @Continue(i32* %0) {
%2 = tail call i32 @mvwaddstr(i32* %0, i32 10, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @wrefresh(i32* %0)
%4 = tail call i32 (...) @raw()
%5 = tail call i32 @wgetch(i32* %0)
ret void
}
/* Variables and functions */
unsigned int Mod1Mask;
unsigned int Mod4Mask;
unsigned int Mod5Mask;
unsigned int getmodnumber(char c) {
  switch (c) {
  case '1':
    return Mod1Mask;
  case '4':
    return Mod4Mask;
  case '5':
    return Mod5Mask;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<getmodnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x31,%eax
je     1141 <getmodnumber+0x41>
jmp    111f <getmodnumber+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x34,%eax
je     1152 <getmodnumber+0x52>
jmp    1130 <getmodnumber+0x30>
mov    -0xc(%rbp),%eax
sub    $0x35,%eax
je     1163 <getmodnumber+0x63>
jmp    1174 <getmodnumber+0x74>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <getmodnumber+0x7b>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <getmodnumber+0x7b>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <getmodnumber+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmodnumber>:
cmp    $0x35,%edi
je     111a <getmodnumber+0x1a>
cmp    $0x34,%edi
je     1123 <getmodnumber+0x23>
xor    %eax,%eax
cmp    $0x31,%edi
jne    112c <getmodnumber+0x2c>
mov    0x2ec8(%rip),%rax
jmp    112a <getmodnumber+0x2a>
mov    0x2ea7(%rip),%rax
jmp    112a <getmodnumber+0x2a>
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@Mod1Mask = global i32 0
@Mod4Mask = global i32 0
@Mod5Mask = global i32 0
define i32 @getmodnumber(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 49, label %6
i32 52, label %8
i32 53, label %10
]
6: ; preds = %1
%7 = load i32, i32* @Mod1Mask
store i32 %7, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* @Mod4Mask
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* @Mod5Mask
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10, %8, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@Mod1Mask = global i32 0
@Mod4Mask = global i32 0
@Mod5Mask = global i32 0
define i32 @getmodnumber(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 49, label %3
i32 52, label %5
i32 53, label %7
]
3: ; preds = %1
%4 = load i32, i32* @Mod1Mask
br label %9
5: ; preds = %1
%6 = load i32, i32* @Mod4Mask
br label %9
7: ; preds = %1
%8 = load i32, i32* @Mod5Mask
br label %9
9: ; preds = %1, %7, %5, %3
%10 = phi i32 [ %8, %7 ], [ %6, %5 ], [ %4, %3 ], [ 0, %1 ]
ret i32 %10
}