xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t get_xscom_base(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_xscom_base() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void dfree_matrix(double *mat) { free(mat); }


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

x86 assembly (clang, -O2):
<dfree_matrix>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dfree_matrix(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int rand();
int randomizer(int arrSize) {
  int randNum = rand() % arrSize;
  return randNum;
}


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

x86 assembly (clang, -O2):
<randomizer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomizer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @randomizer(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_perl_comment_entities();
int /*<<< orphan*/ test_perl_comments();
void all_perl_tests() {
  test_perl_comments();
  test_perl_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_perl_tests() {
%1 = call i32 (...) @test_perl_comments()
%2 = call i32 (...) @test_perl_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_perl_tests() {
%1 = tail call i32 (...) @test_perl_comments()
%2 = tail call i32 (...) @test_perl_comment_entities()
ret void
}
int initCam() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initCam() {
ret i32 0
}
void t_delay(number) unsigned long int number;
{
  unsigned long int i;
  unsigned long int j;
  unsigned long int k;
  unsigned long int result;
  for (i = 0; i < number; i++) {
    for (j = 0; j < number; j++) {
      for (k = 0; k < number; k++) {
        result = (i ^ 17) * (j ^ 23) * (k ^ 79);
      }
    }
  }
}


x86 assembly (clang, -O0):
<t_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    11ab <t_delay+0xab>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1195 <t_delay+0x95>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    117f <t_delay+0x7f>
mov    -0x10(%rbp),%rax
xor    $0x11,%rax
mov    -0x18(%rbp),%rcx
xor    $0x17,%rcx
imul   %rcx,%rax
mov    -0x20(%rbp),%rcx
xor    $0x4f,%rcx
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113c <t_delay+0x3c>
jmp    1184 <t_delay+0x84>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1126 <t_delay+0x26>
jmp    119a <t_delay+0x9a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <t_delay+0x10>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @t_delay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %7
7: ; preds = %38, %1
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %41
11: ; preds = %7
store i64 0, i64* %4
br label %12
12: ; preds = %34, %11
%13 = load i64, i64* %4
%14 = load i64, i64* %2
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %37
16: ; preds = %12
store i64 0, i64* %5
br label %17
17: ; preds = %30, %16
%18 = load i64, i64* %5
%19 = load i64, i64* %2
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %33
21: ; preds = %17
%22 = load i64, i64* %3
%23 = xor i64 %22, 17
%24 = load i64, i64* %4
%25 = xor i64 %24, 23
%26 = mul i64 %23, %25
%27 = load i64, i64* %5
%28 = xor i64 %27, 79
%29 = mul i64 %26, %28
store i64 %29, i64* %6
br label %30
30: ; preds = %21
%31 = load i64, i64* %5
%32 = add i64 %31, 1
store i64 %32, i64* %5
br label %17
33: ; preds = %17
br label %34
34: ; preds = %33
%35 = load i64, i64* %4
%36 = add i64 %35, 1
store i64 %36, i64* %4
br label %12
37: ; preds = %12
br label %38
38: ; preds = %37
%39 = load i64, i64* %3
%40 = add i64 %39, 1
store i64 %40, i64* %3
br label %7
41: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @t_delay(i64 %0) {
ret void
}
/* Type definitions */
struct cpu65x02 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cpu65x02_fatal(struct cpu65x02 *cpu) {
  fprintf(stderr, "Fatal error. Stopping execution");
  exit(1);
}


x86 assembly (clang, -O0):
<cpu65x02_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cpu65x02_fatal>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.cpu65x02 = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"Fatal error. Stopping execution\00"
define void @cpu65x02_fatal(%struct.cpu65x02* %0) {
%2 = alloca %struct.cpu65x02*
store %struct.cpu65x02* %0, %struct.cpu65x02** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.cpu65x02 = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"Fatal error. Stopping execution\00"
define void @cpu65x02_fatal(%struct.cpu65x02* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float log10(float);
float Float_log10(float x) { return log10(x); }


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

x86 assembly (clang, -O2):
<Float_log10>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define float @Float_log10(float %0) {
%2 = tail call float @log10(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ register_con_dip_function_list();
void con_dip_init() { register_con_dip_function_list(); }


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

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

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

LLVM IR (-O2):
define void @con_dip_init() {
%1 = tail call i32 (...) @register_con_dip_function_list()
ret void
}
unsigned xrop3_132_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_132_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
void *e(size_t);
void *f(size_t n) { return e(n); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <e@plt>

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

LLVM IR (-O2):
define i8* @f(i64 %0) {
%2 = tail call i8* @e(i64 %0)
ret i8* %2
}
/* Variables and functions */
int fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ stdout;
int put_number(int number) {
  char buffer[6];
  return fputs(itoa(number, buffer, 10), stdout);
}


x86 assembly (clang, -O0):
<put_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
mov    %eax,%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_number>:
push   %rax
lea    0x2(%rsp),%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1030 <fputs@plt>
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @put_number(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa(i32 %4, i8* %5, i32 10)
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @put_number(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i32 %0, i8* %3, i32 10)
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
double _get_sshort(const char *data, size_t pos) {
  signed short *buf = (signed short *)data;
  return ((double)buf[pos]);
}


x86 assembly (clang, -O0):
<_get_sshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_sshort>:
movswl (%rdi,%rsi,2),%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @_get_sshort(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i16*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i16*
store i16* %7, i16** %5
%8 = load i16*, i16** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_get_sshort(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i16*
%4 = getelementptr inbounds i16, i16* %3, i64 %1
%5 = load i16, i16* %4
%6 = sitofp i16 %5 to double
ret double %6
}
void gang(void) {}


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

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

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

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

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcpy(char *, char *);
char *timestring(time_t *t) {
  char *str;
  static char buf[26];
  str = ctime(t);
  strcpy(buf, &str[4]);
  buf[12] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<timestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
lea    0x2ef8(%rip),%rdi
call   1030 <strcpy@plt>
movb   $0x0,0x2ef8(%rip)
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestring>:
push   %rbx
call   1040 <ctime@plt>
lea    0x4(%rax),%rsi
lea    0x2f0f(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
movb   $0x0,0x2f0c(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@timestring.buf = internal global [26 x i8] zeroinitializer
define i8* @timestring(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i8* @ctime(i32* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = call i32 @strcpy(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @timestring.buf, i64 0, i64 0), i8* %7)
store i8 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @timestring.buf, i64 0, i64 12)
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @timestring.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@timestring.buf = internal global [26 x i8] zeroinitializer
define i8* @timestring(i32* %0) {
%2 = tail call i8* @ctime(i32* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 4
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @timestring.buf, i64 0, i64 0), i8* %3)
store i8 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @timestring.buf, i64 0, i64 12)
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @timestring.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ overlay(char *);
int secapp_ovl(char *path) { overlay(path); }


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

x86 assembly (clang, -O2):
<secapp_ovl>:
jmp    1030 <overlay@plt>

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

LLVM IR (-O2):
define i32 @secapp_ovl(i8* %0) {
%2 = tail call i32 @overlay(i8* %0)
ret i32 undef
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
char *get_filename(char *key) {
  static char filename[128];
  sprintf(filename, "/tmp/location_convert_%s_%d", key, getpid());
  return filename;
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0x2ef8(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0x2f0b(%rip),%r14
lea    0xec4(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_filename.filename = internal global [128 x i8] zeroinitializer
@.str = [28 x i8] c"/tmp/location_convert_%s_%d\00"
define i8* @get_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpid()
%5 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0)
}

LLVM IR (-O2):
@get_filename.filename = internal global [128 x i8] zeroinitializer
@.str = [28 x i8] c"/tmp/location_convert_%s_%d\00"
define i8* @get_filename(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_filename.filename, i64 0, i64 0)
}
int foo() { return 17; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 17
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 17
}
int from_hex(int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  else if (c >= 'A' && c <= 'F')
    return c - 'A' + 10;
  else if (c >= 'a' && c <= 'f')
    return c - 'a' + 10;
  else
    return -1;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <from_hex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <from_hex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <from_hex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <from_hex+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <from_hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <from_hex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <from_hex+0x73>
cmpl   $0x66,-0x8(%rbp)
jg     1173 <from_hex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <from_hex+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <from_hex+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <from_hex+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @from_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 102
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @from_hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
void lvmlockd_disconnect(void) {}


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

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

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

LLVM IR (-O2):
define void @lvmlockd_disconnect() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Set_Names();
int /*<<< orphan*/ readfile(char **);
main(int argc, char *argv[]) {
  Set_Names();
  readfile(argv);
}


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 <Set_Names@plt>
mov    -0x10(%rbp),%rdi
call   1040 <readfile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <Set_Names@plt>
mov    %rbx,%rdi
call   1040 <readfile@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @Set_Names()
%4 = tail call i32 @readfile(i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, unsigned char);
void SensorSetMirrorFlip_SP80818(unsigned char val) {
  unsigned char x;
  val = ~val;
  VIM_SIF_I2cReadByte(0x0c, &x);
  VIM_SIF_I2cWriteByte(0x0c, (unsigned char)(x & 0x1f) | ((val & 0x03) << 5));
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_SP80818>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
mov    $0xc,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0x1f,%eax
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    $0xc,%edi
movzbl %al,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_SP80818>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0xc,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0xf(%rsp),%al
and    $0x1f,%al
shl    $0x5,%bl
and    $0x60,%bl
or     %al,%bl
xor    $0x60,%bl
movzbl %bl,%esi
mov    $0xc,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SensorSetMirrorFlip_SP80818(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = call i32 @VIM_SIF_I2cReadByte(i32 12, i8* %3)
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, 31
%12 = trunc i32 %11 to i8
%13 = zext i8 %12 to i32
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = and i32 %15, 3
%17 = shl i32 %16, 5
%18 = or i32 %13, %17
%19 = trunc i32 %18 to i8
%20 = call i32 @VIM_SIF_I2cWriteByte(i32 12, i8 zeroext %19)
ret void
}

LLVM IR (-O2):
define void @SensorSetMirrorFlip_SP80818(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 12, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, 31
%6 = shl i8 %0, 5
%7 = and i8 %6, 96
%8 = or i8 %5, %7
%9 = xor i8 %8, 96
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 12, i8 zeroext %9)
ret void
}
/* Variables and functions */
double al_sun(double);
int /*<<< orphan*/ cos_to_earth(double);
double eqc(double);
double ra_sun(double, int /*<<< orphan*/);
double eot(double t, double to_earth) {
  double ec, al, ra;
  ec = eqc(t);
  al = al_sun(t);
  ra = ra_sun(t, cos_to_earth(to_earth));
  return -ec + al - ra;
}


x86 assembly (clang, -O0):
<eot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <eqc@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <al_sun@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cos_to_earth@plt>
movsd  -0x30(%rbp),%xmm0
mov    %eax,%edi
call   1030 <ra_sun@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eot>:
sub    $0x28,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <eqc@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <al_sun@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <cos_to_earth@plt>
movsd  0x8(%rsp),%xmm0
mov    %eax,%edi
call   1030 <ra_sun@plt>
movsd  0x10(%rsp),%xmm1
subsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @eot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %3
%9 = call double @eqc(double %8)
store double %9, double* %5
%10 = load double, double* %3
%11 = call double @al_sun(double %10)
store double %11, double* %6
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @cos_to_earth(double %13)
%15 = call double @ra_sun(double %12, i32 %14)
store double %15, double* %7
%16 = load double, double* %5
%17 = fneg double %16
%18 = load double, double* %6
%19 = fadd double %17, %18
%20 = load double, double* %7
%21 = fsub double %19, %20
ret double %21
}

LLVM IR (-O2):
define double @eot(double %0, double %1) {
%3 = tail call double @eqc(double %0)
%4 = tail call double @al_sun(double %0)
%5 = tail call i32 @cos_to_earth(double %1)
%6 = tail call double @ra_sun(double %0, i32 %5)
%7 = fsub double %4, %3
%8 = fsub double %7, %6
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ leds_set(int);
void rtc_init() {
  (*(volatile unsigned int *)(0x44E00804) = (unsigned int)(0x2));
  leds_set(1);
  (*(volatile unsigned int *)(0x44E00800) = (unsigned int)(0x2));
  leds_set(2);
  (*(volatile unsigned int *)(0x44E3E000 + 0x6C) = (unsigned int)(0x83E70B13));
  (*(volatile unsigned int *)(0x44E3E000 + 0x70) = (unsigned int)(0x95A4F1E0));
  (*(volatile unsigned int *)(0x44E3E000 + 0x40) = (unsigned int)(0x1));
  (*(volatile unsigned int *)(0x44E3E000 + 0x54) =
       (unsigned int)((1 << 3) | (1 << 6)));
}


x86 assembly (clang, -O0):
<rtc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e00804,%eax
movl   $0x2,(%rax)
mov    $0x1,%edi
call   1030 <leds_set@plt>
mov    $0x44e00800,%eax
movl   $0x2,(%rax)
mov    $0x2,%edi
call   1030 <leds_set@plt>
mov    $0x44e3e06c,%eax
movl   $0x83e70b13,(%rax)
mov    $0x44e3e070,%eax
movl   $0x95a4f1e0,(%rax)
mov    $0x44e3e040,%eax
movl   $0x1,(%rax)
mov    $0x44e3e054,%eax
movl   $0x48,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_init>:
push   %rax
movl   $0x2,0x44e00804
mov    $0x1,%edi
call   1030 <leds_set@plt>
movl   $0x2,0x44e00800
mov    $0x2,%edi
call   1030 <leds_set@plt>
movl   $0x83e70b13,0x44e3e06c
13 0b e7 83
movl   $0x95a4f1e0,0x44e3e070
e0 f1 a4 95
movl   $0x1,0x44e3e040
movl   $0x48,0x44e3e054
pop    %rax
ret

LLVM IR (-O0):
define void @rtc_init() {
store volatile i32 2, i32* inttoptr (i64 1155532804 to i32*)
%1 = call i32 @leds_set(i32 1)
store volatile i32 2, i32* inttoptr (i64 1155532800 to i32*)
%2 = call i32 @leds_set(i32 2)
store volatile i32 -2082010349, i32* inttoptr (i64 1155784812 to i32*)
store volatile i32 -1784352288, i32* inttoptr (i64 1155784816 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155784768 to i32*)
store volatile i32 72, i32* inttoptr (i64 1155784788 to i32*)
ret void
}

LLVM IR (-O2):
define void @rtc_init() {
store volatile i32 2, i32* inttoptr (i64 1155532804 to i32*)
%1 = tail call i32 @leds_set(i32 1)
store volatile i32 2, i32* inttoptr (i64 1155532800 to i32*)
%2 = tail call i32 @leds_set(i32 2)
store volatile i32 -2082010349, i32* inttoptr (i64 1155784812 to i32*)
store volatile i32 -1784352288, i32* inttoptr (i64 1155784816 to i32*)
store volatile i32 1, i32* inttoptr (i64 1155784768 to i32*)
store volatile i32 72, i32* inttoptr (i64 1155784788 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int two;
  int equals_two;
  two = 2;
  equals_two = (two == 2);
  assert((equals_two != 0));
  assert((equals_two == 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned char byte2;
};
typedef TYPE_1__ XChar2b;

/* Variables and functions */
void set_XChar2b_byte2(void *_p, unsigned char _v) {
  ((XChar2b *)_p)->byte2 = (unsigned char)_v;
}


x86 assembly (clang, -O0):
<set_XChar2b_byte2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XChar2b_byte2>:
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XChar2b_byte2(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
int compare_int_keys(register void *key1, register void *key2) {
  register int key1_v = *((int *)key1);
  register int key2_v = *((int *)key2);
  if (key1_v < key2_v)
    return -1;
  else if (key1_v == key2_v)
    return 0;
  else
    return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @compare_int_keys(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
_sgetc(sp) char **sp;
{ return *(*sp)++; }


x86 assembly (clang, -O0):
<_sgetc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sgetc>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movsbl (%rax),%eax
ret

LLVM IR (-O0):
define i32 @_sgetc(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @_sgetc(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}
int BigLong(int x) {
  return (int)((((unsigned int)x) >> 24) | ((((unsigned int)x) >> 8) & 0xff00) |
               ((((unsigned int)x) << 8) & 0xff0000) |
               (((unsigned int)x) << 24));
}


x86 assembly (clang, -O0):
<BigLong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BigLong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @BigLong(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int compare_ints(int, int, int);
int int_comparator(const void *vs_a, const void *vs_b, void *context) {
  int a = *((int *)vs_a);
  int b = *((int *)vs_b);
  int descending = *((int *)context);
  return compare_ints(a, b, descending);
}


x86 assembly (clang, -O0):
<int_comparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1030 <compare_ints@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_comparator>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <compare_ints@plt>

LLVM IR (-O0):
define i32 @int_comparator(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i8*, i8** %6
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
store i32 %18, i32* %9
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = call i32 @compare_ints(i32 %19, i32 %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @int_comparator(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = bitcast i8* %2 to i32*
%9 = load i32, i32* %8
%10 = tail call i32 @compare_ints(i32 %5, i32 %7, i32 %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ initialize(int, int);
int /*<<< orphan*/ mid_ellipse(int, int, int, int);
int /*<<< orphan*/ print(int, int);
int main() {
  initialize(100, 100);
  mid_ellipse(20, 20, 7, 3);
  print(100, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%esi
mov    %esi,%edi
call   1050 <initialize@plt>
mov    $0x14,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
mov    %esi,%edi
call   1030 <mid_ellipse@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0x64,%esi
call   1050 <initialize@plt>
mov    $0x14,%edi
mov    $0x14,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
call   1030 <mid_ellipse@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   1040 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @initialize(i32 100, i32 100)
%3 = call i32 @mid_ellipse(i32 20, i32 20, i32 7, i32 3)
%4 = call i32 @print(i32 100, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @initialize(i32 100, i32 100)
%2 = tail call i32 @mid_ellipse(i32 20, i32 20, i32 7, i32 3)
%3 = tail call i32 @print(i32 100, i32 100)
ret i32 0
}
/* Variables and functions */
int yywrap() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 1
}
/* Variables and functions */
int STDOUT_FILENO;
int stdout_stream(void) { return STDOUT_FILENO; }


x86 assembly (clang, -O0):
<stdout_stream>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_stream>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @stdout_stream() {
%1 = load i32, i32* @STDOUT_FILENO
ret i32 %1
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @stdout_stream() {
%1 = load i32, i32* @STDOUT_FILENO
ret i32 %1
}
int test_imm_B1int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xB1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B1int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 177
%7 = icmp ne i64 %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_B1int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 760209211392
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TestIfGoodThingHitsBadThing(int, int, int /*<<< orphan*/);
void TestIfPlayerTouchesBadThing(int x, int y) {
  TestIfGoodThingHitsBadThing(x, y, 0);
}


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

x86 assembly (clang, -O2):
<TestIfPlayerTouchesBadThing>:
xor    %edx,%edx
jmp    1030 <TestIfGoodThingHitsBadThing@plt>

LLVM IR (-O0):
define void @TestIfPlayerTouchesBadThing(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 @TestIfGoodThingHitsBadThing(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @TestIfPlayerTouchesBadThing(i32 %0, i32 %1) {
%3 = tail call i32 @TestIfGoodThingHitsBadThing(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
float glmComputeVectorLength3f(float *);
int /*<<< orphan*/ glmMakeVector3f(float *, float const *, float const *);
float glmComputeDistance3f(const float p1[3], const float p2[3]) {
  float d[3];
  glmMakeVector3f(d, p1, p2);
  return glmComputeVectorLength3f(d);
}


x86 assembly (clang, -O0):
<glmComputeDistance3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <glmMakeVector3f@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <glmComputeVectorLength3f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeDistance3f>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <glmMakeVector3f@plt>
mov    %rbx,%rdi
call   1030 <glmComputeVectorLength3f@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @glmComputeDistance3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [3 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%7 = load float*, float** %3
%8 = load float*, float** %4
%9 = call i32 @glmMakeVector3f(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%11 = call float @glmComputeVectorLength3f(float* %10)
ret float %11
}

LLVM IR (-O2):
define float @glmComputeDistance3f(float* %0, float* %1) {
%3 = alloca [3 x float]
%4 = bitcast [3 x float]* %3 to i8*
%5 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%6 = call i32 @glmMakeVector3f(float* %5, float* %0, float* %1)
%7 = call float @glmComputeVectorLength3f(float* %5)
ret float %7
}
/* Variables and functions */
int lower(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char foo = 'F';
  printf("The following letter should be lowercase: %c\n", lower(foo));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x46,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"The following letter should be lowercase: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 70, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @lower(i8 signext %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"The following letter should be lowercase: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @lower(i8 signext 70)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ brain(long long);
int /*<<< orphan*/ scanf(char *, long long *);
int main(int argc, const char *argv[]) {
  long long int a;
  while (2 == 2) {
    scanf("%lld", &a);
    if (a == 0) {
      break;
    };
    brain(a);
  };
  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)
lea    0xec3(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x0,-0x18(%rbp)
jne    1156 <main+0x36>
jmp    1164 <main+0x44>
mov    -0x18(%rbp),%rdi
call   1030 <brain@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rdi
test   %rdi,%rdi
je     1169 <main+0x49>
lea    0xebd(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
call   1030 <brain@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rdi
test   %rdi,%rdi
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = phi i64 [ %12, %8 ], [ %6, %2 ]
%10 = call i32 @brain(i64 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret i32 0
}