xunge/DecIR huggingface dataset:
void slashcharclass2WHITESPACE() {}


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

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

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

LLVM IR (-O2):
define void @slashcharclass2WHITESPACE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *abort_if_null(void *p) {
  if (!p) {
    exit(ENOMEM);
  }
  return p;
}


x86 assembly (clang, -O0):
<abort_if_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <abort_if_null+0x25>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abort_if_null>:
test   %rdi,%rdi
je     1119 <abort_if_null+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @abort_if_null(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 %8, label %5
5: ; preds = %1
%6 = load i32, i32* @ENOMEM
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i8* @abort_if_null(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @ENOMEM
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void testAsymmetricIntSymOperations(int a) {
  clang_analyzer_eval(((~0) >> a) == (~0));
  clang_analyzer_eval((0 >> a) == 0);
  clang_analyzer_eval((0 << a) == 0);
  clang_analyzer_eval(((~0U) >> a) != (~0U));
}


x86 assembly (clang, -O0):
<testAsymmetricIntSymOperations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
sar    %cl,%eax
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
sar    %cl,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAsymmetricIntSymOperations>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
pop    %rbx
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @testAsymmetricIntSymOperations(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 -1, %3
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = load i32, i32* %2
%9 = ashr i32 0, %8
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @clang_analyzer_eval(i32 %11)
%13 = load i32, i32* %2
%14 = shl i32 0, %13
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @clang_analyzer_eval(i32 %16)
%18 = load i32, i32* %2
%19 = lshr i32 -1, %18
%20 = icmp ne i32 %19, -1
%21 = zext i1 %20 to i32
%22 = call i32 @clang_analyzer_eval(i32 %21)
ret void
}

LLVM IR (-O2):
define void @testAsymmetricIntSymOperations(i32 %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 1)
%3 = tail call i32 @clang_analyzer_eval(i32 1)
%4 = tail call i32 @clang_analyzer_eval(i32 1)
%5 = icmp ne i32 %0, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @clang_analyzer_eval(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unsigned_prune_zero2_Good(int /*<<< orphan*/);
void call_unsigned_prune_zero2_Good() { unsigned_prune_zero2_Good(0); }


x86 assembly (clang, -O0):
<call_unsigned_prune_zero2_Good>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <unsigned_prune_zero2_Good@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_unsigned_prune_zero2_Good>:
xor    %edi,%edi
jmp    1030 <unsigned_prune_zero2_Good@plt>

LLVM IR (-O0):
define void @call_unsigned_prune_zero2_Good() {
%1 = call i32 @unsigned_prune_zero2_Good(i32 0)
ret void
}

LLVM IR (-O2):
define void @call_unsigned_prune_zero2_Good() {
%1 = tail call i32 @unsigned_prune_zero2_Good(i32 0)
ret void
}
int test_imm_B1uint8_mem(unsigned char *val) {
  return ((*val) & (0xB1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B1uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -79
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int do_c(int);
int do_d(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char **argv) {
  int result = do_c(50) + do_d(40);
  printf("%d\n", result);
  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    $0x32,%edi
call   1050 <do_c@plt>
mov    %eax,-0x18(%rbp)
mov    $0x28,%edi
call   1040 <do_d@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x32,%edi
call   1050 <do_c@plt>
mov    %eax,%ebx
mov    $0x28,%edi
call   1040 <do_d@plt>
add    %eax,%ebx
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @do_c(i32 50)
%8 = call i32 @do_d(i32 40)
%9 = add nsw i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_c(i32 50)
%4 = tail call i32 @do_d(i32 40)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void dump_dpb(void) {}


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

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

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

LLVM IR (-O2):
define void @dump_dpb() {
ret void
}
void _M2_Points_init(__attribute__((unused)) int argc,
                     __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_Points_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_md5_r(unsigned char const *, char *);
char *str_md5(const unsigned char *md5) {
  static char ret[33];
  str_md5_r(md5, ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<str_md5>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
call   1030 <str_md5_r@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@str_md5.ret = internal global [33 x i8] zeroinitializer
define i8* @str_md5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @str_md5_r(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str_md5.ret, i64 0, i64 0))
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str_md5.ret, i64 0, i64 0)
}

LLVM IR (-O2):
@str_md5.ret = internal global [33 x i8] zeroinitializer
define i8* @str_md5(i8* %0) {
%2 = tail call i32 @str_md5_r(i8* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str_md5.ret, i64 0, i64 0))
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str_md5.ret, i64 0, i64 0)
}
/* Type definitions */
struct stat {
  unsigned long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ lstat(char const *, struct stat *);
unsigned long int get_file_size(const char *pfile) {
  struct stat st;
  lstat(pfile, &st);
  return st.st_size;
}


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

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @lstat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
void kernel_main() {
  init_descriptor_tables();
  terminal_initialize();
  asm volatile("int $0x1");
  asm volatile("int $0x2");
  asm volatile("sti");
  init_timer(50);
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_descriptor_tables@plt>
mov    $0x0,%al
call   1030 <terminal_initialize@plt>
int    $0x1
int    $0x2
sti
mov    $0x32,%edi
mov    $0x0,%al
call   1040 <init_timer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1050 <init_descriptor_tables@plt>
xor    %eax,%eax
call   1030 <terminal_initialize@plt>
int    $0x1
int    $0x2
sti
mov    $0x32,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_timer@plt>

LLVM IR (-O0):
define void @kernel_main() {
%1 = call i32 (...) @init_descriptor_tables()
%2 = call i32 (...) @terminal_initialize()
%3 = call i32 (i32, ...) bitcast (i32 (...)* @init_timer to i32 (i32, ...)*)(i32 50)
ret void
}

LLVM IR (-O2):
define void @kernel_main() {
%1 = tail call i32 (...) @init_descriptor_tables()
%2 = tail call i32 (...) @terminal_initialize()
tail call void asm sideeffect "int $$0x1", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x2", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @init_timer to i32 (i32, ...)*)(i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("hello-world 2.0\nCopyright (C) 2013 Jorge Azevedo\nLicense GPLv3+: "
         "GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis "
         "is free software: you are free to change and redistribute it.\nThere "
         "is NO WARRANTY, to the extent permitted by law.\n");
}


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

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

LLVM IR (-O0):
@.str = [249 x i8] c"hello-world 2.0\0ACopyright (C) 2013 Jorge Azevedo\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([249 x i8], [249 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [248 x i8] c"hello-world 2.0\0ACopyright (C) 2013 Jorge Azevedo\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([248 x i8], [248 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ __cmpdf2(float, float);
int __gedf2(double a1, double a2) {
  return (__cmpdf2((float)a1, (float)a2) >= 0) - 1;
}


x86 assembly (clang, -O0):
<__gedf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <__cmpdf2@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gedf2>:
push   %rax
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
call   1030 <__cmpdf2@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__gedf2(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 = fptrunc double %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = call i64 @__cmpdf2(float %6, float %8)
%10 = icmp sge i64 %9, 0
%11 = zext i1 %10 to i32
%12 = sub nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @__gedf2(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = tail call i64 @__cmpdf2(float %3, float %4)
%6 = ashr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}
g(_Bool a) {}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @g(i1 zeroext %0) {
ret i32 undef
}
int rcomp(double *p1, double *p2) { return ((*p1 < *p2) ? -1 : (*p1 > *p2)); }


x86 assembly (clang, -O0):
<rcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1133 <rcomp+0x33>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <rcomp+0x4e>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcomp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rcomp(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 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp olt double %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %18
11: ; preds = %2
%12 = load double*, double** %3
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = fcmp ogt double %13, %15
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %11, %10
%19 = phi i32 [ -1, %10 ], [ %17, %11 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @rcomp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
char ascii(int letterIndex) {
  int asciiOffset = 65;
  char newChar;
  newChar = (char)(asciiOffset + letterIndex);
  return newChar;
}


x86 assembly (clang, -O0):
<ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii>:
lea    0x41(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @ascii(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %2
store i32 65, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @ascii(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 65
ret i8 %3
}
/* Variables and functions */
char *strdup(char *);
char toupper(char);
char *strtoupper(char *s) {
  char *cp, *p;
  p = cp = strdup(s);
  while ((*p = toupper(*p)))
    p++;
  return cp;
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1168 <strtoupper+0x48>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113d <strtoupper+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r14
push   %rbx
push   %rax
call   1040 <strdup@plt>
mov    %rax,%r14
mov    %rax,%rbx
nop
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtoupper+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @strtoupper(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call signext i8 @toupper(i8 signext %5)
store i8 %6, i8* %4
%7 = icmp eq i8 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i8* %2
}
int z(double i) { return i >= (i + (-2.0)); }


x86 assembly (clang, -O0):
<z>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @z(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, -2.000000e+00
%6 = fcmp oge double %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @z(double %0) {
%2 = fadd double %0, -2.000000e+00
%3 = fcmp ole double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ remove(char const *);
int /*<<< orphan*/ write_error_with_error_number_var(char *, char const *);
unsigned char remove_file(const char *filename) {
  if (remove(filename)) {
    write_error_with_error_number_var("Could not remove file %s. Exiting.",
                                      filename);
    exit(EXIT_FAILURE);
  }
  return 1;
}


x86 assembly (clang, -O0):
<remove_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <remove@plt>
cmp    $0x0,%rax
je     116d <remove_file+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <write_error_with_error_number_var@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <remove@plt>
test   %rax,%rax
jne    1142 <remove_file+0x12>
mov    $0x1,%al
pop    %rbx
ret
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <write_error_with_error_number_var@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Could not remove file %s. Exiting.\00"
@EXIT_FAILURE = global i32 0
define zeroext i8 @remove_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @remove(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @write_error_with_error_number_var(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret i8 1
}

LLVM IR (-O2):
@.str = [35 x i8] c"Could not remove file %s. Exiting.\00"
@EXIT_FAILURE = global i32 0
define zeroext i8 @remove_file(i8* %0) {
%2 = tail call i64 @remove(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @write_error_with_error_number_var(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ log2f(int /*<<< orphan*/);
uint8_t bear_log2(uint8_t value) { return log2f(value); }


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

x86 assembly (clang, -O2):
<bear_log2>:
jmp    1030 <log2f@plt>

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

LLVM IR (-O2):
define i32 @bear_log2(i32 %0) {
%2 = tail call i32 @log2f(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_pin(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void io_set_pin_pullup(uint8_t pin, uint8_t value) {
  set_pin(pin, value, 0x0C, 0x0D);
}


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

x86 assembly (clang, -O2):
<io_set_pin_pullup>:
mov    $0xc,%edx
mov    $0xd,%ecx
jmp    1030 <set_pin@plt>

LLVM IR (-O0):
define void @io_set_pin_pullup(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 @set_pin(i32 %5, i32 %6, i32 12, i32 13)
ret void
}

LLVM IR (-O2):
define void @io_set_pin_pullup(i32 %0, i32 %1) {
%3 = tail call i32 @set_pin(i32 %0, i32 %1, i32 12, i32 13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strdel(char **);
char *ft_strjoin(char *, char const *);
char *ft_strjoin_free(char *s1, const char *s2) {
  char *new;
  if ((new = ft_strjoin(s1, s2)))
    ft_strdel(&s1);
  return (new);
}


x86 assembly (clang, -O0):
<ft_strjoin_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1154 <ft_strjoin_free+0x34>
lea    -0x8(%rbp),%rdi
call   1030 <ft_strdel@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strjoin_free>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
call   1040 <ft_strjoin@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <ft_strjoin_free+0x21>
lea    0x8(%rsp),%rdi
call   1030 <ft_strdel@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_strjoin_free(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = tail call i8* @ft_strjoin(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @ft_strdel(i8** %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int IsInAlphabetOrder(char *first, char *second) {
  return strcmp(first, second) < 0;
}


x86 assembly (clang, -O0):
<IsInAlphabetOrder>:
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 <strcmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsInAlphabetOrder>:
push   %rax
call   1030 <strcmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsInAlphabetOrder(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @IsInAlphabetOrder(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
void swap(char *p, char *q) {
  char temp = *p;
  *p = *q;
  *q = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t i = 0;
  while (str[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void XSubImage() {}


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

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

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

LLVM IR (-O2):
define void @XSubImage() {
ret void
}
void dv2o_add(double *output, double *a, double *b) {
  output[0] = a[0] - b[0];
  output[1] = a[1] - b[1];
}


x86 assembly (clang, -O0):
<dv2o_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv2o_add>:
movsd  (%rsi),%xmm0
subsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
subsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @dv2o_add(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
ret void
}

LLVM IR (-O2):
define void @dv2o_add(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
ret void
}
void add_list(filename) char *filename;
{
  add1_list(filename);
  return;
}


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

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

LLVM IR (-O0):
define void @add_list(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @add1_list to i32 (i8*, ...)*)(i8* %3)
ret void
}

LLVM IR (-O2):
define void @add_list(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @add1_list to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
float get_time_msec();
double get_time_sec(void) { return get_time_msec() / 1000.0f; }


x86 assembly (clang, -O0):
<get_time_sec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_time_msec@plt>
movss  0xedd(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_sec>:
push   %rax
xor    %eax,%eax
call   1030 <get_time_msec@plt>
divss  0xee0(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_time_sec() {
%1 = call float (...) @get_time_msec()
%2 = fdiv float %1, 1.000000e+03
%3 = fpext float %2 to double
ret double %3
}

LLVM IR (-O2):
define double @get_time_sec() {
%1 = tail call float (...) @get_time_msec()
%2 = fdiv float %1, 1.000000e+03
%3 = fpext float %2 to double
ret double %3
}
unsigned long get_fs(void) {
  unsigned long _v;
  __asm__("mov %%fs,%w0" : "=r"(_v) : "0"(0));
  return _v;
}


x86 assembly (clang, -O0):
<get_fs>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %fs,%ax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs>:
xor    %eax,%eax
mov    %fs,%ax
ret

LLVM IR (-O0):
define i64 @get_fs() {
%1 = alloca i64
%2 = call i64 asm "mov %fs,${0:w}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 0)
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_fs() {
%1 = tail call i64 asm "mov %fs,${0:w}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 0)
ret i64 %1
}
/* Variables and functions */
int rand();
int random_400(void) {
  int i = rand() % 400;
  return i;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_400() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 400
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @random_400() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 400
ret i32 %2
}
int func(void) {
  int n = 3;
  int m = 5;
  n = (1, 2, 3, 4, m);
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
scalar_t__ system(char *);
void stop_time(char *key) {
  char sys_str[1024];
  sprintf(sys_str, "stop_time.e %s_%d", key, getpid());
  if (system(sys_str)) {
  };
}


x86 assembly (clang, -O0):
<stop_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x420(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    %eax,%ecx
lea    0xe8a(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
je     1196 <stop_time+0x66>
jmp    1196 <stop_time+0x66>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_time>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb5(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <system@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"stop_time.e %s_%d\00"
define void @stop_time(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 (...) @getpid()
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i64 @system(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"stop_time.e %s_%d\00"
define void @stop_time(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @getpid()
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
%6 = call i64 @system(i8* %3)
ret void
}
int ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
                            struct wpa_driver_associate_params *params) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_driver_associate_params = type opaque
define i32 @ieee80211_sta_associate(%struct.wpa_supplicant* %0, %struct.wpa_driver_associate_params* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpa_driver_associate_params*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpa_driver_associate_params* %1, %struct.wpa_driver_associate_params** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_driver_associate_params = type opaque
define i32 @ieee80211_sta_associate(%struct.wpa_supplicant* nocapture readnone %0, %struct.wpa_driver_associate_params* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int dequeue(int element, int front, int rear, int queue[]) {
  if ((front == -1) || (front > rear))
    printf("queue is empty \n");
  else
    element = queue[front];
  return element;
}


x86 assembly (clang, -O0):
<dequeue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     113b <dequeue+0x2b>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114c <dequeue+0x3c>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    115a <dequeue+0x4a>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequeue>:
push   %rbx
mov    %edi,%ebx
cmp    $0xffffffff,%esi
je     1124 <dequeue+0x14>
cmp    %edx,%esi
jg     1124 <dequeue+0x14>
movslq %esi,%rax
mov    (%rcx,%rax,4),%ebx
jmp    1130 <dequeue+0x20>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"queue is empty \0A\00"
define i32 @dequeue(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 = icmp eq i32 %9, -1
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11, %4
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %23
17: ; preds = %11
%18 = load i32*, i32** %8
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
store i32 %22, i32* %5
br label %23
23: ; preds = %17, %15
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
@str = [16 x i8] c"queue is empty \00"
define i32 @dequeue(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = icmp eq i32 %1, -1
%6 = icmp sgt i32 %1, %2
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %14
10: ; preds = %4
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i32, i32* %3, i64 %11
%13 = load i32, i32* %12
br label %14
14: ; preds = %10, %8
%15 = phi i32 [ %0, %8 ], [ %13, %10 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ pnmReadHeader(int /*<<< orphan*/ *, int *, int *, int *,
                                 int *);
void pgmReadHeader(FILE *fp, int *magic, int *ncols, int *nrows, int *maxval) {
  pnmReadHeader(fp, magic, ncols, nrows, maxval);
  if (*magic != 5)
    error("(pgmReadHeader) Magic number is not 'P5', but 'P%d'", *magic);
}


x86 assembly (clang, -O0):
<pgmReadHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <pnmReadHeader@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
je     1174 <pgmReadHeader+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe91(%rip),%rdi
call   1030 <error@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgmReadHeader>:
push   %rbx
mov    %rsi,%rbx
call   1040 <pnmReadHeader@plt>
mov    (%rbx),%esi
cmp    $0x5,%esi
jne    1132 <pgmReadHeader+0x12>
pop    %rbx
ret
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"(pgmReadHeader) Magic number is not 'P5', but 'P%d'\00"
define void @pgmReadHeader(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @pnmReadHeader(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 5
br i1 %19, label %20, label %24
20: ; preds = %5
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20, %5
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"(pgmReadHeader) Magic number is not 'P5', but 'P%d'\00"
define void @pgmReadHeader(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @pnmReadHeader(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 5
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %11
11: ; preds = %9, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ farlj();
void main(int argc, char *argv[]) { farlj(); }


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

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

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @farlj()
ret void
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @farlj()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printBinData(int data) {
  int count, aux;
  for (count = 31; count >= 0; count--) {
    aux = data >> count;
    aux = aux & 1;
    printf("%i", aux);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBinData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115f <printBinData+0x4f>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printBinData+0x12>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBinData>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x1f,%ebp
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1140 <printBinData+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printBinData(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = ashr i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = and i32 %12, 1
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @printBinData(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 31, %1 ], [ %7, %2 ]
%4 = lshr i32 %0, %3
%5 = and i32 %4, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %3, -1
%8 = icmp eq i32 %3, 0
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = tail call i32 @putchar(i32 10)
ret void
}
void ble_rsp_system_endpoint_tx(
    const struct ble_msg_system_endpoint_tx_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_endpoint_tx_rsp_t = type opaque
define void @ble_rsp_system_endpoint_tx(%struct.ble_msg_system_endpoint_tx_rsp_t* nocapture %0) {
ret void
}