xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_DotVec3_init(void) {
  _hmt_register_covercase("HMM_DotVec3", "1");
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"HMM_DotVec3\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_DotVec3_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double neuron_sigmoid(double input, double response) {
  return 1.0 / (1.0 + exp(-input * response));
}


x86 assembly (clang, -O0):
<neuron_sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xeb0(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neuron_sigmoid>:
push   %rax
xorpd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @neuron_sigmoid(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fneg double %5
%7 = load double, double* %4
%8 = fmul double %6, %7
%9 = call double @exp(double %8)
%10 = fadd double 1.000000e+00, %9
%11 = fdiv double 1.000000e+00, %10
ret double %11
}

LLVM IR (-O2):
define double @neuron_sigmoid(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %3, %1
%5 = tail call double @exp(double %4)
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  char s1[] = "abcdef";
  char s2[] = "cde";
  printf("%d\n", any(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0xf(%rbp)
lea    -0xb(%rbp),%rdi
lea    -0xf(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x666564,0x13(%rsp)
movl   $0x64636261,0x10(%rsp)
64
movl   $0x656463,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <any@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [7 x i8] c"abcdef\00"
@__const.main.s2 = [4 x i8] c"cde\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @any(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [7 x i8] c"abcdef\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 6644835, i32* %2
%5 = call i32 @any(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *getlogin();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void printLogin() {
  printf("Login: %s\n", getlogin());
  fflush(stdout);
}


x86 assembly (clang, -O0):
<printLogin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <getlogin@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLogin>:
push   %rax
xor    %eax,%eax
call   1050 <getlogin@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Login: %s\0A\00"
@stdout = global i32 0
define void @printLogin() {
%1 = call i8* (...) @getlogin()
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Login: %s\0A\00"
@stdout = global i32 0
define void @printLogin() {
%1 = tail call i8* (...) @getlogin()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
void flush_icache_range(unsigned long start, unsigned long end) {}


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

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

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

LLVM IR (-O2):
define void @flush_icache_range(i64 %0, i64 %1) {
ret void
}
/* Variables and functions */
scalar_t__ naive_isspace(char);
scalar_t__ read_char(char *);
int /*<<< orphan*/ unread_char(char);
void read_space() {
  char c = '\0';
  while (read_char(&c) && naive_isspace(c))
    ;
  if (c)
    unread_char(c);
}


x86 assembly (clang, -O0):
<read_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
call   1040 <read_char@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     116a <read_space+0x3a>
movsbl -0x1(%rbp),%edi
call   1030 <naive_isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    117a <read_space+0x4a>
jmp    117f <read_space+0x4f>
jmp    113c <read_space+0xc>
cmpb   $0x0,-0x1(%rbp)
je     1192 <read_space+0x62>
movsbl -0x1(%rbp),%edi
call   1050 <unread_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_space>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rbx
nop
mov    %rbx,%rdi
call   1040 <read_char@plt>
test   %rax,%rax
je     115c <read_space+0x2c>
movsbl 0xf(%rsp),%edi
call   1030 <naive_isspace@plt>
test   %rax,%rax
jne    1140 <read_space+0x10>
mov    0xf(%rsp),%al
test   %al,%al
je     116c <read_space+0x3c>
movsbl %al,%edi
call   1050 <unread_char@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @read_space() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %11, %0
%3 = call i64 @read_char(i8* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8, i8* %1
%7 = call i64 @naive_isspace(i8 signext %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
%13 = load i8, i8* %1
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8, i8* %1
%17 = call i32 @unread_char(i8 signext %16)
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @read_space() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 @read_char(i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = call i64 @naive_isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2, %5
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 @unread_char(i8 signext %10)
br label %14
14: ; preds = %12, %9
ret void
}
float flt_cmp_ge(float a, float b, float c, float d) {
  return (a >= b) ? c : d;
}


x86 assembly (clang, -O0):
<flt_cmp_ge>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1136 <flt_cmp_ge+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1140 <flt_cmp_ge+0x40>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_cmp_ge>:
cmpless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @flt_cmp_ge(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fcmp oge float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load float, float* %7
br label %16
14: ; preds = %4
%15 = load float, float* %8
br label %16
16: ; preds = %14, %12
%17 = phi float [ %13, %12 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @flt_cmp_ge(float %0, float %1, float %2, float %3) {
%5 = fcmp oge float %0, %1
%6 = select i1 %5, float %2, float %3
ret float %6
}
/* Variables and functions */
int call(int);
int /*<<< orphan*/ expecti(int, int);
void test() {
  int a = 100;
  int b = call(a);
  expecti(400, call(b));
  expecti(1600, call(call(400)));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <call@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <call@plt>
mov    %eax,%esi
mov    $0x190,%edi
call   1030 <expecti@plt>
mov    $0x190,%edi
call   1040 <call@plt>
mov    %eax,%edi
call   1040 <call@plt>
mov    %eax,%esi
mov    $0x640,%edi
call   1030 <expecti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x64,%edi
call   1040 <call@plt>
mov    %eax,%edi
call   1040 <call@plt>
mov    $0x190,%edi
mov    %eax,%esi
call   1030 <expecti@plt>
mov    $0x190,%edi
call   1040 <call@plt>
mov    %eax,%edi
call   1040 <call@plt>
mov    $0x640,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <expecti@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
store i32 100, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @call(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @call(i32 %5)
%7 = call i32 @expecti(i32 400, i32 %6)
%8 = call i32 @call(i32 400)
%9 = call i32 @call(i32 %8)
%10 = call i32 @expecti(i32 1600, i32 %9)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @call(i32 100)
%2 = tail call i32 @call(i32 %1)
%3 = tail call i32 @expecti(i32 400, i32 %2)
%4 = tail call i32 @call(i32 400)
%5 = tail call i32 @call(i32 %4)
%6 = tail call i32 @expecti(i32 1600, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
int /*<<< orphan*/ printf(char *);
void U_EMRNOTIMPLEMENTED_swap(char *record, int torev) {
  core5_swap(record, torev);
  printf("WARNING:  could not convert data in record type that has not been "
         "implemented!\n");
}


x86 assembly (clang, -O0):
<U_EMRNOTIMPLEMENTED_swap>:
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   1040 <core5_swap@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRNOTIMPLEMENTED_swap>:
push   %rax
call   1040 <core5_swap@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"WARNING: could not convert data in record type that has not been implemented!\0A\00"
define void @U_EMRNOTIMPLEMENTED_swap(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 @core5_swap(i8* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c"WARNING: could not convert data in record type that has not been implemented!\00"
define void @U_EMRNOTIMPLEMENTED_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xcirculaterequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcirculaterequest_send_event(void *_p) {
  return (int)((XEvent *)_p)->xcirculaterequest.send_event;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcirculaterequest_send_event>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xcirculaterequest_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t Min(int32_t i, int32_t j) {
  if (i < j)
    return i;
  else
    return j;
}


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <Min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <Min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @Min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int foo(int n) { return n * n / 17; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x11,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
imul   %edi,%edi
mov    $0xf0f0f0f1,%eax
imul   %rdi,%rax
shr    $0x24,%rax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = udiv i32 %2, 17
ret i32 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
ssize_t write(int fd, const void *buf, size_t count) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<write>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void wbinvd() {
  db(0x0F);
  db(0x09);
}


x86 assembly (clang, -O0):
<wbinvd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x9,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wbinvd>:
push   %rax
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x9,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @wbinvd() {
%1 = call i32 @db(i32 15)
%2 = call i32 @db(i32 9)
ret void
}

LLVM IR (-O2):
define void @wbinvd() {
%1 = tail call i32 @db(i32 15)
%2 = tail call i32 @db(i32 9)
ret void
}
int do_184() { return 184; }


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

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

LLVM IR (-O0):
define i32 @do_184() {
ret i32 184
}

LLVM IR (-O2):
define i32 @do_184() {
ret i32 184
}
/* Variables and functions */
int one();
int /*<<< orphan*/ printf(char *, int);
main() {
  int o = one();
  printf("Result %d\n", o);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Result %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @one()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ testingGameBoardFunctions();
int /*<<< orphan*/ testingPositionFunctions();
void runTestingMode() {
  testingPositionFunctions();
  testingGameBoardFunctions();
}


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

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

LLVM IR (-O0):
define void @runTestingMode() {
%1 = call i32 (...) @testingPositionFunctions()
%2 = call i32 (...) @testingGameBoardFunctions()
ret void
}

LLVM IR (-O2):
define void @runTestingMode() {
%1 = tail call i32 (...) @testingPositionFunctions()
%2 = tail call i32 (...) @testingGameBoardFunctions()
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *agile_strclone(const char *str) {
  size_t l = strlen(str);
  char *s = malloc(l + 1);
  memcpy(s, str, l + 1);
  return s;
}


x86 assembly (clang, -O0):
<agile_strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agile_strclone>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @agile_strclone(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = add i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @agile_strclone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int sysapi_unlink_file(char *);
int sysapi_untouch(char *filename) { return sysapi_unlink_file(filename); }


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

x86 assembly (clang, -O2):
<sysapi_untouch>:
jmp    1030 <sysapi_unlink_file@plt>

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

LLVM IR (-O2):
define i32 @sysapi_untouch(i8* %0) {
%2 = tail call i32 @sysapi_unlink_file(i8* %0)
ret i32 %2
}
/* Type definitions */
struct property {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ subprop(struct property *, char *, int);
struct property *sellProp(struct property *head, int user) {
  char lotname[30];
  printf("Which property would you like to sell?\n");
  scanf("%s", lotname);
  subprop(head, lotname, user);
}


x86 assembly (clang, -O0):
<sellProp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <subprop@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sellProp>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <subprop@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.property = type { i32 }
@.str = [40 x i8] c"Which property would you like to sell?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define %struct.property* @sellProp(%struct.property* %0, i32 %1) {
%3 = alloca %struct.property*
%4 = alloca %struct.property*
%5 = alloca i32
%6 = alloca [30 x i8]
store %struct.property* %0, %struct.property** %4
store i32 %1, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load %struct.property*, %struct.property** %4
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @subprop(%struct.property* %10, i8* %11, i32 %12)
%14 = load %struct.property*, %struct.property** %3
ret %struct.property* %14
}

LLVM IR (-O2):
%struct.property = type { i32 }
@.str.1 = [3 x i8] c"%s\00"
@str = [39 x i8] c"Which property would you like to sell?\00"
define noalias %struct.property* @sellProp(%struct.property* %0, i32 %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @subprop(%struct.property* %0, i8* %4, i32 %1)
ret %struct.property* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA1_Update(int /*<<< orphan*/ *, char *, int);
void ssl_sha1_transform(void *sha1_info, char *data, int len) {
  SHA1_Update((SHA_CTX *)sha1_info, data, len);
}


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

x86 assembly (clang, -O2):
<ssl_sha1_transform>:
jmp    1030 <SHA1_Update@plt>

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

LLVM IR (-O2):
define void @ssl_sha1_transform(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @SHA1_Update(i32* %4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ implicitConversion(unsigned int);
int main(int argc, char **argv) { return !implicitConversion(~0U); }


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    $0xffffffff,%edi
call   1030 <implicitConversion@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <implicitConversion@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @implicitConversion(i32 -1)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @implicitConversion(i32 -1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void writeb(volatile void *reg, uint8_t value) {
  *(volatile uint8_t *)reg = value;
}


x86 assembly (clang, -O0):
<writeb>:
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):
<writeb>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @writeb(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 i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @writeb(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int mpb_free(void *p) {
  if (p) {
    free(p);
    p = NULL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mpb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <mpb_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpb_free>:
test   %rdi,%rdi
je     111f <mpb_free+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mpb_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
store i8* null, i8** %2
br label %8
8: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @mpb_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i32 0
}
/* Variables and functions */
int i2c_smbus_read_byte(void *);
int read_d8(void *client) { return i2c_smbus_read_byte(client); }


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

x86 assembly (clang, -O2):
<read_d8>:
jmp    1030 <i2c_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @read_d8(i8* %0) {
%2 = tail call i32 @i2c_smbus_read_byte(i8* %0)
ret i32 %2
}
char __list_add_valid(struct list_head *newe, struct list_head *prev,
                      struct list_head *next) {
  (void)newe;
  (void)prev;
  (void)next;
  return 1;
  ;
}


x86 assembly (clang, -O0):
<__list_add_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__list_add_valid>:
mov    $0x1,%al
ret

LLVM IR (-O0):
%struct.list_head = type opaque
define signext i8 @__list_add_valid(%struct.list_head* %0, %struct.list_head* %1, %struct.list_head* %2) {
%4 = alloca %struct.list_head*
%5 = alloca %struct.list_head*
%6 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %4
store %struct.list_head* %1, %struct.list_head** %5
store %struct.list_head* %2, %struct.list_head** %6
%7 = load %struct.list_head*, %struct.list_head** %4
%8 = load %struct.list_head*, %struct.list_head** %5
%9 = load %struct.list_head*, %struct.list_head** %6
ret i8 1
}

LLVM IR (-O2):
%struct.list_head = type opaque
define signext i8 @__list_add_valid(%struct.list_head* nocapture readnone %0, %struct.list_head* nocapture readnone %1, %struct.list_head* nocapture readnone %2) {
ret i8 1
}
/* Type definitions */
typedef int /*<<< orphan*/ CRYPTO_THREADID;

/* Variables and functions */
int /*<<< orphan*/ CRYPTO_THREADID_set_numeric(int /*<<< orphan*/ *const,
                                               unsigned long);
scalar_t__ pthread_self();
void thread_id(CRYPTO_THREADID *const result) {
  CRYPTO_THREADID_set_numeric(result, (unsigned long)pthread_self());
}


x86 assembly (clang, -O0):
<thread_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
call   1030 <CRYPTO_THREADID_set_numeric@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_id>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <CRYPTO_THREADID_set_numeric@plt>

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

LLVM IR (-O2):
define void @thread_id(i32* %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = tail call i32 @CRYPTO_THREADID_set_numeric(i32* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_exec() { exit(1); }


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

x86 assembly (clang, -O2):
<caml_js_exec>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_exec() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_exec() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void mystrcpy(char *s, char *t) {
  while ((*t++ = *s++))
    ;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <mystrcpy+0x3b>
jmp    110c <mystrcpy+0xc>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mystrcpy(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ type();
int /*<<< orphan*/ var_dcl_cnts();
int yyselect();
var_dcl() {
  switch (yyselect()) {
  case 30: {
    switch (yyselect()) {
    case 114: {
      get_lexval();
    } break;
    default:;
    }
    type();
    var_dcl_cnts();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<var_dcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x1e,%eax
jne    1198 <var_dcl+0x58>
jmp    115d <var_dcl+0x1d>
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x72,%eax
jne    117e <var_dcl+0x3e>
jmp    1172 <var_dcl+0x32>
mov    $0x0,%al
call   1050 <get_lexval@plt>
jmp    1183 <var_dcl+0x43>
jmp    1183 <var_dcl+0x43>
mov    $0x0,%al
call   1030 <type@plt>
mov    $0x0,%al
call   1060 <var_dcl_cnts@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_dcl>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x1e,%eax
jne    1175 <var_dcl+0x35>
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x72,%eax
jne    1160 <var_dcl+0x20>
xor    %eax,%eax
call   1050 <get_lexval@plt>
xor    %eax,%eax
call   1030 <type@plt>
xor    %eax,%eax
call   1060 <var_dcl_cnts@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @var_dcl() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %12 [
i32 30, label %3
]
3: ; preds = %0
%4 = call i32 (...) @yyselect()
switch i32 %4, label %7 [
i32 114, label %5
]
5: ; preds = %3
%6 = call i32 (...) @get_lexval()
br label %8
7: ; preds = %3
br label %8
8: ; preds = %7, %5
%9 = call i32 (...) @type()
%10 = call i32 (...) @var_dcl_cnts()
%11 = call i32 (...) @get_lexval()
br label %12
12: ; preds = %0, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @var_dcl() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 30
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = tail call i32 (...) @yyselect()
%5 = icmp eq i32 %4, 114
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @get_lexval()
br label %8
8: ; preds = %3, %6
%9 = tail call i32 (...) @type()
%10 = tail call i32 (...) @var_dcl_cnts()
%11 = tail call i32 (...) @get_lexval()
br label %12
12: ; preds = %0, %8
ret i32 undef
}
/* Variables and functions */
int rand();
float rand_float() {
  unsigned int c0 = rand() & 0xffff;
  unsigned int c1 = rand() & 0xffff;
  unsigned int c = ((c1 << 16) | c0);
  return *(float *)&c;
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x10,%eax
or     %ebx,%eax
movd   %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @rand_float() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @rand()
%5 = and i32 %4, 65535
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = and i32 %6, 65535
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = shl i32 %8, 16
%10 = load i32, i32* %1
%11 = or i32 %9, %10
store i32 %11, i32* %3
%12 = bitcast i32* %3 to float*
%13 = load float, float* %12
ret float %13
}

LLVM IR (-O2):
define float @rand_float() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 65535
%3 = tail call i32 (...) @rand()
%4 = shl i32 %3, 16
%5 = or i32 %4, %2
%6 = bitcast i32 %5 to float
ret float %6
}
__attribute__((always_)) int task_handoff_register(struct notifier_block *n) {
  return -38;
}


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @task_handoff_register(%struct.notifier_block* nocapture readnone %0) {
ret i32 -38
}
int of_int(int x) { return x * 8192; }


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

x86 assembly (clang, -O2):
<of_int>:
mov    %edi,%eax
shl    $0xd,%eax
ret

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

LLVM IR (-O2):
define i32 @of_int(i32 %0) {
%2 = shl nsw i32 %0, 13
ret i32 %2
}
int test_imm_BEuint8_reg(unsigned char val) {
  return ((val) & (0xBE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BEuint8_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, 190
%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_BEuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -66
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("FOO FOO FOO FOO!!!!\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"FOO FOO FOO FOO!!!!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void sched_autogroup_exit(struct signal_struct *sig) {}


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

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

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

LLVM IR (-O2):
%struct.signal_struct = type opaque
define void @sched_autogroup_exit(%struct.signal_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(
      stderr,
      "USAGE: ./test-tl-led LEDNR:STATE, with LEDNR={0|1|2} and STATE={0|1}\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"USAGE: ./test-tl-led LEDNR:STATE, with LEDNR={0|1|2} and STATE={0|1}\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"USAGE: ./test-tl-led LEDNR:STATE, with LEDNR={0|1|2} and STATE={0|1}\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int *v, int len) { _quick_sort(v, 0, len); }


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

x86 assembly (clang, -O2):
<quick_sort>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <_quick_sort@plt>

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = tail call i32 @_quick_sort(i32* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[12] = {1, 3, 5, 4, 7, 2, 99, 16, 45, 67, 89, 45};
  int i;
  int total = 0;
  for (i = 0; i < 12; ++i) {
    total += a[i];
  }
  printf("Total of array element values is %d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jge    1178 <main+0x58>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1152 <main+0x32>
mov    -0x48(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [12 x i32] [i32 1, i32 3, i32 5, i32 4, i32 7, i32 2, i32 99, i32 16, i32 45, i32 67, i32 89, i32 45]
@.str = [37 x i8] c"Total of array element values is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [12 x i32]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 12
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Total of array element values is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 383)
ret i32 0
}
/* Type definitions */
struct fix_tag_classifier {
  int dummy;
};

/* Variables and functions */
const struct fix_tag_classifier *get_group_classifier_in_Party(size_t __tag) {
  (void)__tag;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fix_tag_classifier = type { i32 }
define %struct.fix_tag_classifier* @get_group_classifier_in_Party(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret %struct.fix_tag_classifier* null
}

LLVM IR (-O2):
%struct.fix_tag_classifier = type { i32 }
define noalias %struct.fix_tag_classifier* @get_group_classifier_in_Party(i64 %0) {
ret %struct.fix_tag_classifier* null
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_hk(scalar_t__);
int32_t __stdfix_sadd_hk(int32_t x, int32_t y) {
  return (__stdfix_sat_hk((int32_t)x + (int32_t)y));
}


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

x86 assembly (clang, -O2):
<__stdfix_sadd_hk>:
add    %rsi,%rdi
jmp    1030 <__stdfix_sat_hk@plt>

LLVM IR (-O0):
define i64 @__stdfix_sadd_hk(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
%8 = call i64 @__stdfix_sat_hk(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @__stdfix_sadd_hk(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = tail call i64 @__stdfix_sat_hk(i64 %3)
ret i64 %4
}