xunge/DecIR huggingface dataset:
void fn_test4(void) { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__.fn_test4 = [9 x i8] c"fn_test4\00"
define void @fn_test4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.fn_test4, i64 0, i64 0))
ret void
}
void fire_delta_events(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @fire_delta_events() {
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
time_t timeval_to_us(struct timeval *tv) {
  return tv->tv_sec * 1000000 + tv->tv_usec;
}


x86 assembly (clang, -O0):
<timeval_to_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%eax
cltq
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_us>:
movslq (%rdi),%rax
imul   $0xf4240,%rax,%rax
add    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @timeval_to_us(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @timeval_to_us(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
ret i64 %8
}
float floatsisf(int i) { return i; }


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

x86 assembly (clang, -O2):
<floatsisf>:
cvtsi2ss %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @floatsisf(i32 %0) {
%2 = sitofp i32 %0 to float
ret float %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int pib_is_unicast_lid(uint16_t lid) {
  return (lid < (0x0C000)) || (lid == (0xFFFF));
}


x86 assembly (clang, -O0):
<pib_is_unicast_lid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xc000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <pib_is_unicast_lid+0x26>
cmpl   $0xffff,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pib_is_unicast_lid>:
cmp    $0xc000,%edi
setl   %al
cmp    $0xffff,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @pib_is_unicast_lid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 49152
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 65535
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @pib_is_unicast_lid(i32 %0) {
%2 = icmp slt i32 %0, 49152
%3 = icmp eq i32 %0, 65535
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ Cyc_Character_isdigit(unsigned char);
unsigned char Cyc_Character_toupper(unsigned char);
int Cyc_Character_isxdigit(unsigned char c) {
  if (Cyc_Character_isdigit(c)) {
    return 1;
  } else {
    unsigned char d = Cyc_Character_toupper(c);
    return d >= 'A' ? d <= 'F' : 0;
  }
}


x86 assembly (clang, -O0):
<Cyc_Character_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <Cyc_Character_isdigit@plt>
cmp    $0x0,%rax
je     114d <Cyc_Character_isxdigit+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    118d <Cyc_Character_isxdigit+0x6d>
movzbl -0x5(%rbp),%edi
call   1040 <Cyc_Character_toupper@plt>
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x41,%eax
jl     117d <Cyc_Character_isxdigit+0x5d>
movzbl -0x6(%rbp),%eax
cmp    $0x46,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1187 <Cyc_Character_isxdigit+0x67>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1187 <Cyc_Character_isxdigit+0x67>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Character_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <Cyc_Character_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <Cyc_Character_isxdigit+0x17>
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <Cyc_Character_toupper@plt>
mov    %eax,%ecx
add    $0xbf,%cl
xor    %eax,%eax
cmp    $0x6,%cl
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cyc_Character_isxdigit(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = call i64 @Cyc_Character_isdigit(i8 zeroext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %23
9: ; preds = %1
%10 = load i8, i8* %3
%11 = call zeroext i8 @Cyc_Character_toupper(i8 zeroext %10)
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = icmp sle i32 %17, 70
%19 = zext i1 %18 to i32
br label %21
20: ; preds = %9
br label %21
21: ; preds = %20, %15
%22 = phi i32 [ %19, %15 ], [ 0, %20 ]
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %8
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @Cyc_Character_isxdigit(i8 zeroext %0) {
%2 = tail call i64 @Cyc_Character_isdigit(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call zeroext i8 @Cyc_Character_toupper(i8 zeroext %0)
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, int /*<<< orphan*/);
char *newname(const char *str) {
  static int cpt = 0;
  static char name[15];
  sprintf(name, "%s%d", str, cpt++);
  return name;
}


x86 assembly (clang, -O0):
<newname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    0x2f06(%rip),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x2efb(%rip)
lea    0x2ef8(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newname>:
push   %rbx
mov    %rdi,%rdx
mov    0x2f12(%rip),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x2f09(%rip)
lea    0x2f06(%rip),%rbx
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@newname.cpt = internal global i32 0
@newname.name = internal global [15 x i8] zeroinitializer
@.str = [5 x i8] c"%s%d\00"
define i8* @newname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @newname.cpt
%5 = add nsw i32 %4, 1
store i32 %5, i32* @newname.cpt
%6 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @newname.name, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @newname.name, i64 0, i64 0)
}

LLVM IR (-O2):
@newname.cpt = internal unnamed_addr global i32 0
@newname.name = internal global [15 x i8] zeroinitializer
@.str = [5 x i8] c"%s%d\00"
define i8* @newname(i8* %0) {
%2 = load i32, i32* @newname.cpt
%3 = add nsw i32 %2, 1
store i32 %3, i32* @newname.cpt
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @newname.name, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @newname.name, i64 0, i64 0)
}
int test_imm_FEuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FEuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 254
%6 = icmp ne i64 %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_FEuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 254
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long test_lrintf(float x) { return __builtin_lrintf(x); }


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

x86 assembly (clang, -O2):
<test_lrintf>:
jmp    1030 <lrintf@plt>

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

LLVM IR (-O2):
define i64 @test_lrintf(float %0) {
%2 = tail call i64 @lrintf(float %0)
ret i64 %2
}
/* Variables and functions */
int strlen(char const *);
size_t base16_decoded_max_len(const char *encoded) {
  return ((strlen(encoded) + 1) / 2);
}


x86 assembly (clang, -O0):
<base16_decoded_max_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base16_decoded_max_len>:
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @base16_decoded_max_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 2
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @base16_decoded_max_len(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sdiv i32 %3, 2
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot13_sem() { grava_li(1, "$CC"); }


x86 assembly (clang, -O0):
<rot13_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <grava_li@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot13_sem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <grava_li@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"$CC\00"
define void @rot13_sem() {
%1 = tail call i32 @grava_li(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g2_phy_write(unsigned int, unsigned int, unsigned int);
void MDC_MDIO_WRITE(unsigned int len, unsigned int devid, unsigned int reg,
                    unsigned int data) {
  g2_phy_write(devid, reg, data);
}


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

x86 assembly (clang, -O2):
<MDC_MDIO_WRITE>:
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <g2_phy_write@plt>

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

LLVM IR (-O2):
define void @MDC_MDIO_WRITE(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @g2_phy_write(i32 %1, i32 %2, i32 %3)
ret void
}
void NV21ToYUV24Row_C() {}


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

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

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

LLVM IR (-O2):
define void @NV21ToYUV24Row_C() {
ret void
}
int pr7383(__const char *__) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pr7383(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f();
void h() { f(); }


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

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

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

LLVM IR (-O2):
define void @h() {
%1 = tail call i32 (...) @f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_splashscreen();
int /*<<< orphan*/ show_startmenu();
void init_game(void) {
  show_splashscreen();
  show_startmenu();
}


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

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

LLVM IR (-O0):
define void @init_game() {
%1 = call i32 (...) @show_splashscreen()
%2 = call i32 (...) @show_startmenu()
ret void
}

LLVM IR (-O2):
define void @init_game() {
%1 = tail call i32 (...) @show_splashscreen()
%2 = tail call i32 (...) @show_startmenu()
ret void
}
int sdcard_unregister_driver(struct sdcard_driver *pdrv) {
  do {
    if ((0x04) & 0x0)
      sdioapi_ddi_printf("%s: enter\n", __func__);
  } while (0);
  sdioapi_ddi_unset();
  return 1;
}


x86 assembly (clang, -O0):
<sdcard_unregister_driver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <sdcard_unregister_driver+0x11>
mov    $0x0,%al
call   1030 <sdioapi_ddi_unset@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sdcard_driver = type opaque
define i32 @sdcard_unregister_driver(%struct.sdcard_driver* %0) {
%2 = alloca %struct.sdcard_driver*
store %struct.sdcard_driver* %0, %struct.sdcard_driver** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = call i32 (...) @sdioapi_ddi_unset()
ret i32 1
}

LLVM IR (-O2):
%struct.sdcard_driver = type opaque
define i32 @sdcard_unregister_driver(%struct.sdcard_driver* nocapture readnone %0) {
%2 = tail call i32 (...) @sdioapi_ddi_unset()
ret i32 1
}
OP(fd, a8) {
  illegal_1();
  op_a8();
}


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_a8()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_a8()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clrscr() { system("@cls||clear"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"@cls||clear\00"
define void @clrscr() {
%1 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"@cls||clear\00"
define void @clrscr() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int q = __VERIFIER_nondet_int();
  int p = __VERIFIER_nondet_int();
  while (q > 0 && p > 0) {
    if (q < p) {
      q = q - 1;
    } else {
      if (p < q) {
        p = p - 1;
      } else {
        break;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    114c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115c <main+0x4c>
jmp    119f <main+0x8f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <main+0x66>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119a <main+0x8a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1190 <main+0x80>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1195 <main+0x85>
jmp    119f <main+0x8f>
jmp    119a <main+0x8a>
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %30, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %31
14: ; preds = %12
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %2
br label %30
21: ; preds = %14
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %3
br label %29
28: ; preds = %21
br label %31
29: ; preds = %25
br label %30
30: ; preds = %29, %18
br label %6
31: ; preds = %28, %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void CL_EatMe_f(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_EatMe_f() {
ret void
}
void foo239(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo239(i32 %0) {
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_add_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_add_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_add_wch+0x2a>
jmp    1170 <cmd_add_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_add_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_add_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_add_wch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_add_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
bool bf_isset(uint8_t field[], size_t idx) {
  return (field[idx / 8] & (1u << (idx % 8)));
}


x86 assembly (clang, -O0):
<bf_isset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_isset>:
mov    %rsi,%rcx
mov    %rsi,%rdx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x3,%rdx
and    (%rdi,%rdx,4),%eax
ret

LLVM IR (-O0):
define i32 @bf_isset(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = udiv i64 %6, 8
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = load i64, i64* %4
%11 = urem i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = shl i32 1, %12
%14 = and i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bf_isset(i32* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 3
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = trunc i64 %1 to i32
%7 = and i32 %6, 7
%8 = shl nuw nsw i32 1, %7
%9 = and i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ cglit(int);
int /*<<< orphan*/ cgpush();
void cgpushlit(int n) {
  cglit(n);
  cgpush();
}


x86 assembly (clang, -O0):
<cgpushlit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <cglit@plt>
mov    $0x0,%al
call   1030 <cgpush@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cgpushlit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cglit(i32 %3)
%5 = call i32 (...) @cgpush()
ret void
}

LLVM IR (-O2):
define void @cgpushlit(i32 %0) {
%2 = tail call i32 @cglit(i32 %0)
%3 = tail call i32 (...) @cgpush()
ret void
}
int is_leap(int year) {
  return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <is_leap+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <is_leap+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
test   $0x3,%dil
jne    112c <is_leap+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <is_leap+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
char *f2(char *a, char *b) { return __builtin_strstr(a, b); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <strstr@plt>

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

LLVM IR (-O2):
define i8* @f2(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
/* Variables and functions */
long LONG_MAX;
long product(long a, long b) {
  if (b > LONG_MAX / a)
    return -1;
  return a * b;
}


x86 assembly (clang, -O0):
<product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    1141 <product+0x41>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114e <product+0x4e>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<product>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rcx
or     %rdi,%rcx
shr    $0x20,%rcx
je     111d <product+0x1d>
cqto
idiv   %rdi
jmp    1121 <product+0x21>
xor    %edx,%edx
div    %edi
imul   %rsi,%rdi
cmp    %rsi,%rax
mov    $0xffffffffffffffff,%rax
cmovge %rdi,%rax
ret

LLVM IR (-O0):
@LONG_MAX = global i64 0
define i64 @product(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* @LONG_MAX
%8 = load i64, i64* %4
%9 = sdiv i64 %7, %8
%10 = icmp sgt i64 %6, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i64 -1, i64* %3
br label %16
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = mul nsw i64 %13, %14
store i64 %15, i64* %3
br label %16
16: ; preds = %12, %11
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
define i64 @product(i64 %0, i64 %1) {
%3 = load i64, i64* @LONG_MAX
%4 = sdiv i64 %3, %0
%5 = icmp slt i64 %4, %1
%6 = mul nsw i64 %1, %0
%7 = select i1 %5, i64 -1, i64 %6
ret i64 %7
}
/* Type definitions */
struct iterator {
  int dummy;
};
struct genhash_iter {
  int dummy;
};
struct genhash {
  int dummy;
};
struct entry_hash_iter {
  int dummy;
};
struct entry_hash {
  int dummy;
};

/* Variables and functions */
struct iterator *genhash_iter_init(struct genhash_iter *,
                                   struct genhash const *);
struct iterator *entry_hash_iter_init(struct entry_hash_iter *iter,
                                      const struct entry_hash *tthis) {
  return genhash_iter_init((struct genhash_iter *)iter,
                           (const struct genhash *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_hash_iter_init>:
jmp    1030 <genhash_iter_init@plt>

LLVM IR (-O0):
%struct.iterator = type { i32 }
%struct.entry_hash_iter = type { i32 }
%struct.entry_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @entry_hash_iter_init(%struct.entry_hash_iter* %0, %struct.entry_hash* %1) {
%3 = alloca %struct.entry_hash_iter*
%4 = alloca %struct.entry_hash*
store %struct.entry_hash_iter* %0, %struct.entry_hash_iter** %3
store %struct.entry_hash* %1, %struct.entry_hash** %4
%5 = load %struct.entry_hash_iter*, %struct.entry_hash_iter** %3
%6 = bitcast %struct.entry_hash_iter* %5 to %struct.genhash_iter*
%7 = load %struct.entry_hash*, %struct.entry_hash** %4
%8 = bitcast %struct.entry_hash* %7 to %struct.genhash*
%9 = call %struct.iterator* @genhash_iter_init(%struct.genhash_iter* %6, %struct.genhash* %8)
ret %struct.iterator* %9
}

LLVM IR (-O2):
%struct.iterator = type { i32 }
%struct.entry_hash_iter = type { i32 }
%struct.entry_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @entry_hash_iter_init(%struct.entry_hash_iter* %0, %struct.entry_hash* %1) {
%3 = bitcast %struct.entry_hash_iter* %0 to %struct.genhash_iter*
%4 = bitcast %struct.entry_hash* %1 to %struct.genhash*
%5 = tail call %struct.iterator* @genhash_iter_init(%struct.genhash_iter* %3, %struct.genhash* %4)
ret %struct.iterator* %5
}
int test34(int x) {
  if (x == 1) {
    return 3;
  } else if (x == 2 || 1) {
    return 5;
  }
}


x86 assembly (clang, -O0):
<test34>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <test34+0x1d>
movl   $0x3,-0x4(%rbp)
jmp    1147 <test34+0x47>
cmpl   $0x2,-0x8(%rbp)
je     1136 <test34+0x36>
mov    $0x1,%al
test   $0x1,%al
jne    1136 <test34+0x36>
jmp    1142 <test34+0x42>
movl   $0x5,-0x4(%rbp)
jmp    1147 <test34+0x47>
jmp    1147 <test34+0x47>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test34>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
add    %eax,%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @test34(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 3, i32 5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free_mem(void **);
void int_destructor(void **tag, void **cell) { free_mem(cell); }


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

x86 assembly (clang, -O2):
<int_destructor>:
mov    %rsi,%rdi
jmp    1030 <free_mem@plt>

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

LLVM IR (-O2):
define void @int_destructor(i8** nocapture readnone %0, i8** %1) {
%3 = tail call i32 @free_mem(i8** %1)
ret void
}
void __yotta_dummy_lib_symbol_cmsis_core_nordic() {}


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

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

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

LLVM IR (-O2):
define void @__yotta_dummy_lib_symbol_cmsis_core_nordic() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int major_code;
};
struct TYPE_4__ {
  TYPE_1__ xnoexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xnoexpose_major_code(void *_p, int _v) {
  ((XEvent *)_p)->xnoexpose.major_code = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xnoexpose_major_code(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RST(int, int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xe7(void) {
  RST(0x20, 5, 8);
  T_WAIT_UNTIL(11);
  return;
}


x86 assembly (clang, -O0):
<op_0xe7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0xe7>:
push   %rax
mov    $0x20,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0xe7() {
%1 = call i32 @RST(i32 32, i32 5, i32 8)
%2 = call i32 @T_WAIT_UNTIL(i32 11)
ret void
}

LLVM IR (-O2):
define void @op_0xe7() {
%1 = tail call i32 @RST(i32 32, i32 5, i32 8)
%2 = tail call i32 @T_WAIT_UNTIL(i32 11)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *);
void empty(char **name) {
  *name = (char *)malloc(100 * sizeof(char));
  sprintf(*name, "");
}


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @empty(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
%5 = load i8**, i8*** %2
store i8* %4, i8** %5
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @empty(i8** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %0
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int read_long_data(unsigned char *, unsigned char *);
int op_mac_recv(unsigned char *packet, unsigned char *data) {
  return read_long_data(packet, data);
}


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

x86 assembly (clang, -O2):
<op_mac_recv>:
jmp    1030 <read_long_data@plt>

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

LLVM IR (-O2):
define i32 @op_mac_recv(i8* %0, i8* %1) {
%3 = tail call i32 @read_long_data(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, const char *argv[]) {
  func1();
  int a = 0;
  char *b = "BCD";
  printf("Print1\n");
  a = 1123;
  b = "GJD";
  printf("Print2\n");
  sleep(1);
  printf("Print3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
movl   $0x0,-0x14(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x463,-0x14(%rbp)
lea    0xe93(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"BCD\00"
@.str.1 = [8 x i8] c"Print1\0A\00"
@.str.2 = [4 x i8] c"GJD\00"
@.str.3 = [8 x i8] c"Print2\0A\00"
@.str.4 = [8 x i8] c"Print3\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @func1()
store i32 0, i32* %6
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 1123, i32* %6
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %7
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @sleep(i32 1)
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Print1\00"
@str.5 = [7 x i8] c"Print2\00"
@str.6 = [7 x i8] c"Print3\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func1()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int test__date_to_timestamp();
void *timestamp_worker(void *data) {
  int *ret = (int *)data;
  *ret = test__date_to_timestamp();
  return NULL;
}


x86 assembly (clang, -O0):
<timestamp_worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test__date_to_timestamp@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_worker>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <test__date_to_timestamp@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @timestamp_worker(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 (...) @test__date_to_timestamp()
store i32 %3, i32* %2
ret i8* null
}
double millimetresToInches(double millimetres) { return millimetres * 39369.6; }


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

x86 assembly (clang, -O2):
<millimetresToInches>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @millimetresToInches(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.936960e+04
ret double %4
}

LLVM IR (-O2):
define double @millimetresToInches(double %0) {
%2 = fmul double %0, 3.936960e+04
ret double %2
}
void tzdev_init_migration(void) { return; }


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

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

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

LLVM IR (-O2):
define void @tzdev_init_migration() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void isEven(int *p1) {
  if (*p1 % 2 == 0) {
    printf("Yes, %d is even\n", *p1);
  } else {
    printf("No, %d is odd.\n", *p1);
  }
}


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114a <isEven+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <isEven+0x4c>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
mov    (%rdi),%esi
test   $0x1,%sil
lea    0xee3(%rip),%rax
lea    0xeed(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Yes, %d is even\0A\00"
@.str.1 = [16 x i8] c"No, %d is odd.\0A\00"
define void @isEven(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %1
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Yes, %d is even\0A\00"
@.str.1 = [16 x i8] c"No, %d is odd.\0A\00"
define void @isEven(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ omp_set_dynamic(int);
void matmul_init() { omp_set_dynamic(1); }


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

x86 assembly (clang, -O2):
<matmul_init>:
mov    $0x1,%edi
jmp    1030 <omp_set_dynamic@plt>

LLVM IR (-O0):
define void @matmul_init() {
%1 = call i32 @omp_set_dynamic(i32 1)
ret void
}

LLVM IR (-O2):
define void @matmul_init() {
%1 = tail call i32 @omp_set_dynamic(i32 1)
ret void
}
char printingQ(char in) {
  if (in < ' ' || in > '~') {
    in = '.';
  }
  return in;
}


x86 assembly (clang, -O0):
<printingQ>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     1124 <printingQ+0x24>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
jle    1128 <printingQ+0x28>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printingQ>:
lea    -0x7f(%rdi),%eax
cmp    $0xa1,%al
mov    $0x2e,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @printingQ(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %8, 126
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8 46, i8* %2
br label %11
11: ; preds = %10, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @printingQ(i8 signext %0) {
%2 = add i8 %0, -127
%3 = icmp ult i8 %2, -95
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}
double KtoF(double K) {
  double f = (1.8 * (K - 273.15) + 32);
  return f;
}


x86 assembly (clang, -O0):
<KtoF>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<KtoF>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KtoF(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 2.731500e+02
%6 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %5, double 3.200000e+01)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @KtoF(double %0) {
%2 = fadd double %0, -2.731500e+02
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
ret double %3
}