xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zfree(int type, void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @zfree(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ sqrt(double);
int64_t inorm64(int64_t a, int64_t b) {
  return sqrt((double)a * (double)a + (double)b * (double)b);
}


x86 assembly (clang, -O0):
<inorm64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm2
cvtsi2sdq -0x10(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inorm64>:
cvtsi2sd %rdi,%xmm0
cvtsi2sd %rsi,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i64 @inorm64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = load i64, i64* %4
%10 = sitofp i64 %9 to double
%11 = load i64, i64* %4
%12 = sitofp i64 %11 to double
%13 = fmul double %10, %12
%14 = call double @llvm.fmuladd.f64(double %6, double %8, double %13)
%15 = call i64 @sqrt(double %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @inorm64(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %5)
%7 = tail call i64 @sqrt(double %6)
ret i64 %7
}
int utl_rvn_getdigits(int nbr) {
  int rtn;
  rtn = 0;
  while (nbr != 0) {
    nbr /= 10;
    rtn++;
  }
  return (rtn);
}


x86 assembly (clang, -O0):
<utl_rvn_getdigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <utl_rvn_getdigits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <utl_rvn_getdigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_rvn_getdigits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <utl_rvn_getdigits+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <utl_rvn_getdigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @utl_rvn_getdigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
int idris_time() {
  time_t t = time(NULL);
  return (int)t;
}


x86 assembly (clang, -O0):
<idris_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @idris_time() {
%1 = alloca i64
%2 = call i64 @time(i32* null)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @idris_time() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
size_t libkeccak_hmac_unmarshal(int /*<<< orphan*/ *, void const *);
__attribute__((
    __deprecated__("Use libkeccak_hmac_unmarshal(NULL, data) instead of "
                   "libkeccak_hmac_unmarshal_skip(data)"))) size_t
libkeccak_hmac_unmarshal_skip(const void *restrict data) {
  return libkeccak_hmac_unmarshal(NULL, data);
}


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

x86 assembly (clang, -O2):
<libkeccak_hmac_unmarshal_skip>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <libkeccak_hmac_unmarshal@plt>

LLVM IR (-O0):
define i64 @libkeccak_hmac_unmarshal_skip(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @libkeccak_hmac_unmarshal(i32* null, i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @libkeccak_hmac_unmarshal_skip(i8* noalias %0) {
%2 = tail call i64 @libkeccak_hmac_unmarshal(i32* null, i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char name[20], s[50];
  printf("Type something: \n");
  scanf("%s", name);
  snprintf(s, 50, "Say Hello World %s", name);
  system(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x20(%rbp),%rcx
mov    $0x32,%esi
lea    0xe93(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xe94(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
mov    %r14,%rcx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Type something: \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"Say Hello World %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [50 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @snprintf(i8* %7, i32 50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"Say Hello World %s\00"
@str = [17 x i8] c"Type something: \00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @snprintf(i8* %4, i32 50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = call i32 @system(i8* %4)
ret i32 0
}
float tetragwno(float pleura) { return (4 * pleura); }


x86 assembly (clang, -O0):
<tetragwno>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @tetragwno(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 4.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @tetragwno(float %0) {
%2 = fmul float %0, 4.000000e+00
ret float %2
}
/* Variables and functions */
int getegid();
int getgid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("gid is :%d \n egid is %d\n\n", getgid(), getegid());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getegid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"gid is :%d \0A egid is %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getgid()
%3 = call i32 (...) @getegid()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"gid is :%d \0A egid is %d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getgid()
%2 = tail call i32 (...) @getegid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen(int, int);
int main(int argc, char **argv) { gen(1024, 1024); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%esi
mov    %esi,%edi
call   1030 <gen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
mov    $0x400,%esi
call   1030 <gen@plt>
xor    %eax,%eax
pop    %rcx
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 @gen(i32 1024, i32 1024)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @gen(i32 1024, i32 1024)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ index_add_arg(char *);
void cm_pindex(void) { index_add_arg("pg"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"pg\00"
define void @cm_pindex() {
%1 = call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"pg\00"
define void @cm_pindex() {
%1 = tail call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int sign(int number) {
  const int temp = number >> (sizeof(int) * 8 - 1);
  return temp + !temp + ~(!number + ~0);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmpl   $0x0,-0x8(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    $0xffffffff,%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%ecx
sar    $0x1f,%ecx
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
add    %ecx,%eax
cmp    $0x1,%edi
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = add nsw i32 %6, %10
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
%16 = add nsw i32 %15, -1
%17 = xor i32 %16, -1
%18 = add nsw i32 %11, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = add nsw i32 %2, %4
%6 = icmp eq i32 %0, 0
%7 = sext i1 %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
char get_mapped_char_from_num(int);
int get_mapped_num_from_char(char);
char encode_character(char input_letter, char key_letter) {
  int letter_mapped = get_mapped_num_from_char(input_letter);
  int key_mapped = get_mapped_num_from_char(key_letter);
  int summed = (letter_mapped + key_mapped);
  if (summed >= 27) {
    summed -= 27;
  }
  return get_mapped_char_from_num(summed);
}


x86 assembly (clang, -O0):
<encode_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <get_mapped_num_from_char@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <get_mapped_num_from_char@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1b,-0x10(%rbp)
jl     1168 <encode_character+0x48>
mov    -0x10(%rbp),%eax
sub    $0x1b,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <get_mapped_char_from_num@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_character>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <get_mapped_num_from_char@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <get_mapped_num_from_char@plt>
lea    (%rax,%rbx,1),%ecx
cmp    $0x1b,%ecx
lea    -0x1b(%rax,%rbx,1),%edi
cmovl  %ecx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <get_mapped_char_from_num@plt>

LLVM IR (-O0):
define signext i8 @encode_character(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = call i32 @get_mapped_num_from_char(i8 signext %8)
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = call i32 @get_mapped_num_from_char(i8 signext %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp sge i32 %15, 27
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 27
store i32 %19, i32* %7
br label %20
20: ; preds = %17, %2
%21 = load i32, i32* %7
%22 = call signext i8 @get_mapped_char_from_num(i32 %21)
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @encode_character(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @get_mapped_num_from_char(i8 signext %0)
%4 = tail call i32 @get_mapped_num_from_char(i8 signext %1)
%5 = add nsw i32 %4, %3
%6 = icmp sgt i32 %5, 26
%7 = add nsw i32 %5, -27
%8 = select i1 %6, i32 %7, i32 %5
%9 = tail call signext i8 @get_mapped_char_from_num(i32 %8)
ret i8 %9
}
void test_min_with_posneg_numbers(void) {
  do {
    seatest_assert_int_equal(-6111, ({
      typeof(7222) _a = (7222);
      typeof(-6111) _b = (-6111);
      (_a < _b) ? _a : _b;
    }),
                             __FUNCTION__, 22);
  } while (0);
}


x86 assembly (clang, -O0):
<test_min_with_posneg_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1c36,-0x4(%rbp)
movl   $0xffffe821,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113d <test_min_with_posneg_numbers+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <test_min_with_posneg_numbers+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xffffe821,%edi
lea    0xea8(%rip),%rdx
mov    $0x16,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_min_with_posneg_numbers>:
lea    0xee9(%rip),%rdx
mov    $0xffffe821,%edi
mov    $0xffffe821,%esi
mov    $0x16,%ecx
xor    %eax,%eax
jmp    1030 <seatest_assert_int_equal@plt>

LLVM IR (-O0):
@__FUNCTION__.test_min_with_posneg_numbers = [29 x i8] c"test_min_with_posneg_numbers\00"
define void @test_min_with_posneg_numbers() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
store i32 7222, i32* %1
store i32 -6111, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* %1
br label %12
10: ; preds = %4
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 -6111, i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_min_with_posneg_numbers, i64 0, i64 0), i32 22)
br label %16
16: ; preds = %12
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_min_with_posneg_numbers = [29 x i8] c"test_min_with_posneg_numbers\00"
define void @test_min_with_posneg_numbers() {
%1 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 -6111, i32 -6111, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_min_with_posneg_numbers, i64 0, i64 0), i32 22)
ret void
}
char *langRomTypeMegaRam768() { return "768kB MegaRAM"; }


x86 assembly (clang, -O0):
<langRomTypeMegaRam768>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeMegaRam768>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"768kB MegaRAM\00"
define i8* @langRomTypeMegaRam768() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"768kB MegaRAM\00"
define i8* @langRomTypeMegaRam768() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *ebbrt_newlib_realloc(void *, size_t);
void *realloc(void *ptr, size_t size) {
  return ebbrt_newlib_realloc(ptr, size);
}


x86 assembly (clang, -O0):
<realloc>:
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 <ebbrt_newlib_realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
jmp    1030 <ebbrt_newlib_realloc@plt>

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

LLVM IR (-O2):
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @ebbrt_newlib_realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cudaThreadSynchronize();
void dxGlobalSync() { cudaThreadSynchronize(); }


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

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

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

LLVM IR (-O2):
define void @dxGlobalSync() {
%1 = tail call i32 (...) @cudaThreadSynchronize()
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipSpace(char *ptr) {
  while (isspace(*ptr)) {
    ptr++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipSpace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipSpace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipSpace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ XgError(char *);
void writeerr() { XgError("error writing output file"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"error writing output file\00"
define void @writeerr() {
%1 = call i32 @XgError(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"error writing output file\00"
define void @writeerr() {
%1 = tail call i32 @XgError(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _glp_lib_xassert(char const *, char const *, int);
void glp_assert_(const char *expr, const char *file, int line) {
  _glp_lib_xassert(expr, file, line);
}


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

x86 assembly (clang, -O2):
<glp_assert_>:
jmp    1030 <_glp_lib_xassert@plt>

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

LLVM IR (-O2):
define void @glp_assert_(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_glp_lib_xassert(i8* %0, i8* %1, i32 %2)
ret void
}
int test_imm_F6int64_highword_reg(long long val) {
  return ((val >> 32) & (0xF6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F6int64_highword_reg>:
movabs $0xf600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F6int64_highword_reg(i64 %0) {
%2 = and i64 %0, 1056561954816
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t rdd08sdp_get_length(const uint16_t *p_rdd08) {
  return p_rdd08[2] & 0xff;
}


x86 assembly (clang, -O0):
<rdd08sdp_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdd08sdp_get_length>:
movzbl 0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rdd08sdp_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @rdd08sdp_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}
/* Variables and functions */
char chop_at(char *, scalar_t__);
scalar_t__ strlen(char *);
char chop(char *str) { return chop_at(str, strlen(str) - 1); }


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1040 <chop_at@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <chop_at@plt>

LLVM IR (-O0):
define signext i8 @chop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call signext i8 @chop_at(i8* %3, i64 %6)
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @chop(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, -1
%4 = tail call signext i8 @chop_at(i8* %0, i64 %3)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *pname) {
  fprintf(stderr, "%s: [-v] cache_size(in GB) vol_size(in GB)\n", pname);
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"%s: [-v] cache_size(in GB) vol_size(in GB)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"%s: [-v] cache_size(in GB) vol_size(in GB)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strlen(char *);
void chomp(char *s) {
  if (s != NULL) {
    size_t last = strlen(s) - 1;
    if (s[last] == '\n')
      s[last] = '\0';
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115f <chomp+0x4f>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115a <chomp+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    115f <chomp+0x4f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
test   %rdi,%rdi
je     112c <chomp+0x1c>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112c <chomp+0x1c>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @chomp(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %6
%18 = load i8*, i8** %2
%19 = load i64, i64* %3
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
br label %21
21: ; preds = %17, %6
br label %22
22: ; preds = %21, %1
ret void
}

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %3
store i8 0, i8* %7
br label %11
11: ; preds = %3, %10, %1
ret void
}
/* Variables and functions */
int roundf(float);
void round_w_s(float *source, int *dest) { *dest = roundf(*source); }


x86 assembly (clang, -O0):
<round_w_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <roundf@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_w_s>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <roundf@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @round_w_s(float* nocapture %0, i32* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call i32 @roundf(float %3)
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printd(int n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  if (n / 10) {
    printd(n / 10);
  }
  putchar(n % 10 + '0');
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <printd+0x27>
mov    $0x2d,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     116d <printd+0x4d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <printd@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <printd+0x16>
mov    $0x2d,%edi
call   1030 <putchar@plt>
neg    %ebx
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <printd+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <printd@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @putchar(i32 45)
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %2
%18 = srem i32 %17, 10
%19 = add nsw i32 %18, 48
%20 = call i32 @putchar(i32 %19)
ret void
}

LLVM IR (-O2):
define void @printd(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @putchar(i32 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = icmp ult i32 %7, 10
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @printd(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @putchar(i32 %13)
ret void
}
float test2(__attribute__((vector_size(16))) float a, int b) { return a[b]; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x3,%eax
movss  -0x10(%rbp,%rax,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
movaps %xmm0,-0x18(%rsp)
and    $0x3,%edi
movss  -0x18(%rsp,%rdi,4),%xmm0
ret

LLVM IR (-O0):
define float @test2(<4 x float> %0, i32 %1) {
%3 = alloca <4 x float>
%4 = alloca i32
store <4 x float> %0, <4 x float>* %3
store i32 %1, i32* %4
%5 = load <4 x float>, <4 x float>* %3
%6 = load i32, i32* %4
%7 = extractelement <4 x float> %5, i32 %6
ret float %7
}

LLVM IR (-O2):
define float @test2(<4 x float> %0, i32 %1) {
%3 = extractelement <4 x float> %0, i32 %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ matvec2_c(float *, float *, float *);
void matvec2_neon(float m[4], float v[2], float d[2]) { matvec2_c(m, v, d); }


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

x86 assembly (clang, -O2):
<matvec2_neon>:
jmp    1030 <matvec2_c@plt>

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

LLVM IR (-O2):
define void @matvec2_neon(float* %0, float* %1, float* %2) {
%4 = tail call i32 @matvec2_c(float* %0, float* %1, float* %2)
ret void
}
int list_comparator_float(const void *a, const void *b) {
  return (*(float *)a < *(float *)b) - (*(float *)a > *(float *)b);
}


x86 assembly (clang, -O0):
<list_comparator_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
movss  (%rcx),%xmm0
mov    -0x10(%rbp),%rcx
ucomiss (%rcx),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_float(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 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp olt float %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to float*
%15 = load float, float* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to float*
%18 = load float, float* %17
%19 = fcmp ogt float %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt float %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void least_square() { printf("inside least_square\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"inside least_square\00"
define void @least_square() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct kgsl_device_private {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
long adreno_compat_ioctl(struct kgsl_device_private *dev_priv, unsigned int cmd,
                         unsigned long arg) {
  BUG();
}


x86 assembly (clang, -O0):
<adreno_compat_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <BUG@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kgsl_device_private = type { i32 }
define i64 @adreno_compat_ioctl(%struct.kgsl_device_private* %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca %struct.kgsl_device_private*
%6 = alloca i32
%7 = alloca i64
store %struct.kgsl_device_private* %0, %struct.kgsl_device_private** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%8 = call i32 (...) @BUG()
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
%struct.kgsl_device_private = type { i32 }
define i64 @adreno_compat_ioctl(%struct.kgsl_device_private* nocapture readnone %0, i32 %1, i64 %2) {
%4 = tail call i32 (...) @BUG()
ret i64 undef
}
void wait_for_irsc_completion(void) {}


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

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

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

LLVM IR (-O2):
define void @wait_for_irsc_completion() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_cpu_time();
int main() {
  while (1) {
    print_cpu_time();
    for (int i = 0x1000000; i > 0; i--)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <print_cpu_time@plt>
movl   $0x1000000,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114a <main+0x3a>
jmp    113c <main+0x2c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <print_cpu_time@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %12
%4 = call i32 (...) @print_cpu_time()
store i32 16777216, i32* %2
br label %5
5: ; preds = %9, %3
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @print_cpu_time()
br label %1
}
void jz4740_clock_debugfs_add_clk(struct clk *clk) {}


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define void @jz4740_clock_debugfs_add_clk(%struct.clk* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ first(char *);
char *first2(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *test = "select * from mytable where city = \"Auckland\" ;";
  first(test);
  char *test2 = first2(test);
  printf("%s \n", test2);
  free(test2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <first@plt>
mov    -0x10(%rbp),%rdi
call   1050 <first2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1060 <first@plt>
mov    %rbx,%rdi
call   1050 <first2@plt>
mov    %rax,%rbx
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"select * from mytable where city = \22Auckland\22 ;\00"
@.str.1 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @first(i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @first2(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"select * from mytable where city = \22Auckland\22 ;\00"
@.str.1 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = tail call i32 @first(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @first2(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
int test(arg)
int arg;
{
  if (arg > 0 || arg == 0)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111b <test+0x1b>
cmpl   $0x0,-0x8(%rbp)
jne    1127 <test+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <test+0x2e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
void do_segv() {
  int *segv;
  segv = 0;
  *segv = 1;
  int *ptr = NULL;
  int i = *(int *)0;
}


x86 assembly (clang, -O0):
<do_segv>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
mov    (%rax),%eax
xor    %ecx,%ecx
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @do_segv() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
store i32* null, i32** %1
%4 = load i32*, i32** %1
store i32 1, i32* %4
store i32* null, i32** %2
%5 = load i32, i32* null
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):