xunge/DecIR huggingface dataset:
void copyString(char *p1, char *p2) {
  while (*p2 != '\0') {
    *p1 = *p2;
    p1++;
    p2++;
  }
  *p1 = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <copyString+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <copyString+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
mov    (%rsi),%al
test   %al,%al
je     1121 <copyString+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <copyString+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ faux(int);
int main() {
  for (int tiph = 0; tiph <= 20; tiph++)
    faux(tiph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <faux@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <faux@plt>
mov    $0x1,%edi
call   1030 <faux@plt>
mov    $0x2,%edi
call   1030 <faux@plt>
mov    $0x3,%edi
call   1030 <faux@plt>
mov    $0x4,%edi
call   1030 <faux@plt>
mov    $0x5,%edi
call   1030 <faux@plt>
mov    $0x6,%edi
call   1030 <faux@plt>
mov    $0x7,%edi
call   1030 <faux@plt>
mov    $0x8,%edi
call   1030 <faux@plt>
mov    $0x9,%edi
call   1030 <faux@plt>
mov    $0xa,%edi
call   1030 <faux@plt>
mov    $0xb,%edi
call   1030 <faux@plt>
mov    $0xc,%edi
call   1030 <faux@plt>
mov    $0xd,%edi
call   1030 <faux@plt>
mov    $0xe,%edi
call   1030 <faux@plt>
mov    $0xf,%edi
call   1030 <faux@plt>
mov    $0x10,%edi
call   1030 <faux@plt>
mov    $0x11,%edi
call   1030 <faux@plt>
mov    $0x12,%edi
call   1030 <faux@plt>
mov    $0x13,%edi
call   1030 <faux@plt>
mov    $0x14,%edi
call   1030 <faux@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @faux(i32 0)
%2 = tail call i32 @faux(i32 1)
%3 = tail call i32 @faux(i32 2)
%4 = tail call i32 @faux(i32 3)
%5 = tail call i32 @faux(i32 4)
%6 = tail call i32 @faux(i32 5)
%7 = tail call i32 @faux(i32 6)
%8 = tail call i32 @faux(i32 7)
%9 = tail call i32 @faux(i32 8)
%10 = tail call i32 @faux(i32 9)
%11 = tail call i32 @faux(i32 10)
%12 = tail call i32 @faux(i32 11)
%13 = tail call i32 @faux(i32 12)
%14 = tail call i32 @faux(i32 13)
%15 = tail call i32 @faux(i32 14)
%16 = tail call i32 @faux(i32 15)
%17 = tail call i32 @faux(i32 16)
%18 = tail call i32 @faux(i32 17)
%19 = tail call i32 @faux(i32 18)
%20 = tail call i32 @faux(i32 19)
%21 = tail call i32 @faux(i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_llroundl();
scalar_t__ llroundl(long double);
void test_llroundl(long double ld) {
  if (llroundl(ld) != llroundl(ld))
    link_failure_llroundl();
}


x86 assembly (clang, -O0):
<test_llroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <llroundl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <llroundl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_llroundl+0x43>
mov    $0x0,%al
call   1040 <link_failure_llroundl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_llroundl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <llroundl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <llroundl@plt>
cmp    %rax,%rbx
jne    1151 <test_llroundl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_llroundl@plt>

LLVM IR (-O0):
define void @test_llroundl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @llroundl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @llroundl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_llroundl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_llroundl(x86_fp80 %0) {
%2 = tail call i64 @llroundl(x86_fp80 %0)
%3 = tail call i64 @llroundl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_llroundl()
br label %7
7: ; preds = %5, %1
ret void
}
float modulus(float first, float second) { return (int)first % (int)second; }


x86 assembly (clang, -O0):
<modulus>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
cvttss2si -0x4(%rbp),%eax
cvttss2si -0x8(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulus>:
cvttss2si %xmm0,%eax
cvttss2si %xmm1,%ecx
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
ret

LLVM IR (-O0):
define float @modulus(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fptosi float %5 to i32
%7 = load float, float* %4
%8 = fptosi float %7 to i32
%9 = srem i32 %6, %8
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @modulus(float %0, float %1) {
%3 = fptosi float %0 to i32
%4 = fptosi float %1 to i32
%5 = srem i32 %3, %4
%6 = sitofp i32 %5 to float
ret float %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void MPUEnable(uint32_t ui32MPUConfig) {

  ;
  (*((volatile unsigned long *)(0xE000ED94))) = ui32MPUConfig | 0x00000001;
}


x86 assembly (clang, -O0):
<MPUEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1,%eax
movslq %eax,%rcx
mov    $0xe000ed94,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPUEnable>:
or     $0x1,%edi
movslq %edi,%rax
mov    $0xe000ed94,%ecx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @MPUEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 1
%5 = sext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 3758157204 to i64*)
ret void
}

LLVM IR (-O2):
define void @MPUEnable(i32 %0) {
%2 = or i32 %0, 1
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 3758157204 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ input_errors(int, char **);
int /*<<< orphan*/ save_text_init();
void input_errors_headers(int nptrs, char **ptrs) {
  save_text_init();
  input_errors(nptrs, ptrs);
}


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

x86 assembly (clang, -O2):
<input_errors_headers>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <save_text_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <input_errors@plt>

LLVM IR (-O0):
define void @input_errors_headers(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @save_text_init()
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @input_errors(i32 %6, i8** %7)
ret void
}

LLVM IR (-O2):
define void @input_errors_headers(i32 %0, i8** %1) {
%3 = tail call i32 (...) @save_text_init()
%4 = tail call i32 @input_errors(i32 %0, i8** %1)
ret void
}
int minute_fn(const int time_var, const char *from, const char *to) {
  printf("%s %i %li %li\n", __FUNCTION__, time_var, (long)from, (long)to);
  return generic_fn(time_var, (long)from, (long)to, 0, 59);
}


x86 assembly (clang, -O0):
<minute_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebb(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x3b,%r8d
mov    $0x0,%al
call   1030 <generic_fn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minute_fn>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
mov    $0x3b,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <generic_fn@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.minute_fn = [10 x i8] c"minute_fn\00"
define i32 @minute_fn(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.minute_fn, i64 0, i64 0), i32 %7, i64 %9, i64 %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %6
%17 = ptrtoint i8* %16 to i64
%18 = call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %13, i64 %15, i64 %17, i32 0, i32 59)
ret i32 %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.minute_fn = [10 x i8] c"minute_fn\00"
define i32 @minute_fn(i32 %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %2 to i64
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.minute_fn, i64 0, i64 0), i32 %0, i64 %4, i64 %5)
%7 = tail call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %0, i64 %4, i64 %5, i32 0, i32 59)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Free(void *x) { free(x); }


x86 assembly (clang, -O0):
<Free>:
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):
<Free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stdout;
void print_fixed_float_32(void *fixed, unsigned frac) {
  fprintf(stdout, "single fixed point[32:%2u]:      ", frac);
  fprintf(stdout, "%#08X\n", *(unsigned *)fixed);
}


x86 assembly (clang, -O0):
<print_fixed_float_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fixed_float_32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%edx
mov    %rdi,%rbx
mov    0x2ec0(%rip),%r14
mov    (%r14),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%edx
lea    0xee7(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"single fixed point[32:%2u]: \00"
@.str.1 = [7 x i8] c"%X\0A\00"
define void @print_fixed_float_32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"single fixed point[32:%2u]: \00"
@.str.1 = [7 x i8] c"%X\0A\00"
define void @print_fixed_float_32(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = load i32, i32* @stdout
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
char *malloc(int);
char *strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s) {
  int size = strlen(s);
  char *newstr;
  newstr = malloc(size + 1);
  return strcpy(newstr, s);
}


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

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

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
float f(int i, int j) { return 0.0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @f(i32 %0, i32 %1) {
ret float 0.000000e+00
}
/* Type definitions */
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
char const *tv_to_str(struct timeval *);
const char *time_ull_to_str(unsigned long long time) {
  struct timeval tv;
  tv.tv_sec = time / 1000000;
  tv.tv_usec = time % 1000000;
  return tv_to_str(&tv);
}


x86 assembly (clang, -O0):
<time_ull_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <tv_to_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_ull_to_str>:
sub    $0x18,%rsp
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,0x8(%rsp)
imul   $0xf4240,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <tv_to_str@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i8* @time_ull_to_str(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = urem i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 %8, i64* %9
%10 = call i8* @tv_to_str(%struct.timeval* %3)
ret i8* %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i8* @time_ull_to_str(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = udiv i64 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = urem i64 %0, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 %6, i64* %7
%8 = call i8* @tv_to_str(%struct.timeval* %2)
ret i8* %8
}
void *get_stack_pointer(void) {
  void *sp;
  asm volatile("movq %%rsp, %0" : "=r"(sp));
  return sp;
}


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

x86 assembly (clang, -O2):
<get_stack_pointer>:
mov    %rsp,%rax
ret

LLVM IR (-O0):
define i8* @get_stack_pointer() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "movq %rsp, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_stack_pointer() {
%1 = tail call i8* asm sideeffect "movq %rsp, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int max(int, int);
int min(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a1 = 33;
  int a2 = 21;
  int maxNum = max(a1, a2);
  int minNum = min(a1, a2);
  printf("the max value is %d\nThe min value is %d\n", maxNum, minNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x21,-0x8(%rbp)
movl   $0x15,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <max@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <min@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x21,%edi
mov    $0x15,%esi
call   1050 <max@plt>
mov    %eax,%ebx
mov    $0x21,%edi
mov    $0x15,%esi
call   1040 <min@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"the max value is %d\0AThe min value is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 33, i32* %2
store i32 21, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @max(i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @min(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"the max value is %d\0AThe min value is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 33, i32 21)
%2 = tail call i32 @min(i32 33, i32 21)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ rand();
size_t randfunc(void *ctx, size_t max) {
  assert(!ctx);
  return (size_t)rand() % (max + 1);
}


x86 assembly (clang, -O0):
<randfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randfunc>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <rand@plt>
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1154 <randfunc+0x34>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @randfunc(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 = icmp ne i8* %5, null
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i64 (...) @rand()
%11 = load i64, i64* %4
%12 = add i64 %11, 1
%13 = urem i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @randfunc(i8* readnone %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 (...) @rand()
%7 = add i64 %1, 1
%8 = urem i64 %6, %7
ret i64 %8
}
/* Type definitions */
struct meta {
  int dummy;
};

/* Variables and functions */
struct meta *meta_parse(const char *filename, int options) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.meta = type { i32 }
define %struct.meta* @meta_parse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret %struct.meta* null
}

LLVM IR (-O2):
%struct.meta = type { i32 }
define noalias %struct.meta* @meta_parse(i8* nocapture readnone %0, i32 %1) {
ret %struct.meta* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void print_errno_message(int errnum) {
  char const *s;
  s = strerror(errnum);
  if (!s)
    s = "Unknown system error";
  fprintf(stderr, ": %s", s);
}


x86 assembly (clang, -O0):
<print_errno_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <print_errno_message+0x2d>
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_errno_message>:
push   %rax
call   1040 <strerror@plt>
test   %rax,%rax
lea    0xed0(%rip),%rdx
cmovne %rax,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unknown system error\00"
@stderr = global i32 0
@.str.1 = [5 x i8] c": %s\00"
define void @print_errno_message(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unknown system error\00"
@stderr = global i32 0
@.str.1 = [5 x i8] c": %s\00"
define void @print_errno_message(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
long myround(double u) {
  long result = u;
  while (result + 0.5 < u)
    result += 1;
  while (result - 0.5 > u)
    result -= 1;
  return result;
}


x86 assembly (clang, -O0):
<myround>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xedf(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1145 <myround+0x45>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <myround+0x13>
jmp    114a <myround+0x4a>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1178 <myround+0x78>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114a <myround+0x4a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myround>:
cvttsd2si %xmm0,%rax
movsd  0xef3(%rip),%xmm1
nopl   (%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %rax,%xmm2
addsd  %xmm1,%xmm2
add    $0x1,%rax
ucomisd %xmm2,%xmm0
ja     1110 <myround+0x10>
movsd  0xeda(%rip),%xmm1
xchg   %ax,%ax
add    $0xffffffffffffffff,%rax
xorps  %xmm2,%xmm2
cvtsi2sd %rax,%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm0,%xmm2
ja     1130 <myround+0x30>
ret

LLVM IR (-O0):
define i64 @myround(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
br label %6
6: ; preds = %12, %1
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = load double, double* %2
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %6
15: ; preds = %6
br label %16
16: ; preds = %22, %15
%17 = load i64, i64* %3
%18 = sitofp i64 %17 to double
%19 = fsub double %18, 5.000000e-01
%20 = load double, double* %2
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i64, i64* %3
%24 = sub nsw i64 %23, 1
store i64 %24, i64* %3
br label %16
25: ; preds = %16
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @myround(double %0) {
%2 = fptosi double %0 to i64
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %2, %1 ], [ %8, %3 ]
%5 = sitofp i64 %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fcmp olt double %6, %0
%8 = add nsw i64 %4, 1
br i1 %7, label %3, label %9
9: ; preds = %3, %9
%10 = phi i64 [ %14, %9 ], [ %4, %3 ]
%11 = sitofp i64 %10 to double
%12 = fadd double %11, -5.000000e-01
%13 = fcmp ogt double %12, %0
%14 = add nsw i64 %10, -1
br i1 %13, label %9, label %15
15: ; preds = %9
ret i64 %10
}
/* Variables and functions */
double qcs_randn();
void qcs_fill_randn(int n, double *p) {
  int i;
  for (i = 0; i < n; i++)
    p[i] = qcs_randn();
}


x86 assembly (clang, -O0):
<qcs_fill_randn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <qcs_fill_randn+0x44>
mov    $0x0,%al
call   1030 <qcs_randn@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <qcs_fill_randn+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcs_fill_randn>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <qcs_fill_randn+0x36>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <qcs_randn@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <qcs_fill_randn+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @qcs_fill_randn(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call double (...) @qcs_randn()
%12 = load double*, double** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @qcs_fill_randn(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call double (...) @qcs_randn()
%9 = getelementptr inbounds double, double* %1, i64 %7
store double %8, double* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_bar(uint8_t divchar) {
  uint16_t i;
  for (i = 0; i < 80; i++)
    printf("%c", divchar);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x50,-0x8(%rbp)
jge    114b <print_bar+0x3b>
mov    -0x4(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_bar+0x12>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x50,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1120 <print_bar+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_bar(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @putchar(i32 %0)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 80
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ stderr;
void err() {
  ERR_print_errors_fp(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
define void @err() {
%1 = load i32, i32* @stderr
%2 = call i32 @ERR_print_errors_fp(i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @err() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @ERR_print_errors_fp(i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ GLeeInit();
int pglXGetVideoSyncSGI(unsigned int *);
int _Lazy_glXGetVideoSyncSGI(unsigned int *count) {
  if (GLeeInit())
    return pglXGetVideoSyncSGI(count);
  return (int)0;
}


x86 assembly (clang, -O0):
<_Lazy_glXGetVideoSyncSGI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <GLeeInit@plt>
cmp    $0x0,%rax
je     114e <_Lazy_glXGetVideoSyncSGI+0x2e>
mov    -0x10(%rbp),%rdi
call   1030 <pglXGetVideoSyncSGI@plt>
mov    %eax,-0x4(%rbp)
jmp    1155 <_Lazy_glXGetVideoSyncSGI+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glXGetVideoSyncSGI>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <GLeeInit@plt>
test   %rax,%rax
je     1139 <_Lazy_glXGetVideoSyncSGI+0x19>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pglXGetVideoSyncSGI@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_Lazy_glXGetVideoSyncSGI(i32* %0) {
%2 = tail call i64 (...) @GLeeInit()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pglXGetVideoSyncSGI(i32* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
void bsp_coresight_disable(void) { return; }


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

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

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

LLVM IR (-O2):
define void @bsp_coresight_disable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log10(double);
int /*<<< orphan*/ log10f(float);
int /*<<< orphan*/ log10l(long double);
void uninitvar_log10(void) {
  float f;
  (void)log10f(f);
  double d;
  (void)log10(d);
  long double ld;
  (void)log10l(ld);
}


x86 assembly (clang, -O0):
<uninitvar_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <log10f@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <log10l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_log10>:
sub    $0x18,%rsp
call   1030 <log10f@plt>
call   1040 <log10@plt>
call   1050 <log10l@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_log10() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @log10f(float %4)
%6 = load double, double* %2
%7 = call i32 @log10(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @log10l(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_log10() {
%1 = tail call i32 @log10f(float undef)
%2 = tail call i32 @log10(double undef)
%3 = tail call i32 @log10l(x86_fp80 undef)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int strcmpptr(const void *p1, const void *p2) {
  return strcmp(*(char **)p1, *(char **)p2);
}


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

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

LLVM IR (-O0):
define i32 @strcmpptr(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 i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strcmpptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ mrotate(double, double *, double **);
int /*<<< orphan*/ mvmul(double *, double **, double *);
void vrotate(double theta, double v[3], double axis[3], double vr[3]) {
  double m[3][3];
  mrotate(theta, axis, m);
  mvmul(v, m, vr);
}


x86 assembly (clang, -O0):
<vrotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <mrotate@plt>
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <mvmul@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrotate>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
call   1030 <mrotate@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <mvmul@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vrotate(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [3 x [3 x double]]
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load double, double* %5
%11 = load double*, double** %7
%12 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%13 = bitcast [3 x double]* %12 to double**
%14 = call i32 @mrotate(double %10, double* %11, double** %13)
%15 = load double*, double** %6
%16 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%17 = bitcast [3 x double]* %16 to double**
%18 = load double*, double** %8
%19 = call i32 @mvmul(double* %15, double** %17, double* %18)
ret void
}

LLVM IR (-O2):
define void @vrotate(double %0, double* %1, double* %2, double* %3) {
%5 = alloca [3 x [3 x double]]
%6 = bitcast [3 x [3 x double]]* %5 to i8*
%7 = bitcast [3 x [3 x double]]* %5 to double**
%8 = call i32 @mrotate(double %0, double* %2, double** %7)
%9 = call i32 @mvmul(double* %1, double** %7, double* %3)
ret void
}
long long uzzu() { return 0x7fff000000007fffLL; }


x86 assembly (clang, -O0):
<uzzu>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff000000007fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uzzu>:
movabs $0x7fff000000007fff,%rax
ret

LLVM IR (-O0):
define i64 @uzzu() {
ret i64 9223090561878097919
}

LLVM IR (-O2):
define i64 @uzzu() {
ret i64 9223090561878097919
}
/* Variables and functions */
float sqrt(int);
float distance(int xDataPt, int yDataPt, int xGrdPt, int yGrdPt) {
  int dx = xDataPt - xGrdPt;
  int dy = yDataPt - yGrdPt;
  return sqrt(dx * dx + dy * dy);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
imul   -0x14(%rbp),%edi
mov    -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %edx,%edi
sub    %ecx,%esi
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = call float @sqrt(i32 %23)
ret float %24
}

LLVM IR (-O2):
define float @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub nsw i32 %1, %3
%7 = mul nsw i32 %5, %5
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %7
%10 = tail call float @sqrt(i32 %9)
ret float %10
}
long get(long x, long y) {
  long m = y / x;
  long i, cnt = 0;
  for (i = 1; i < m; i++) {
  }
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    114e <get+0x4e>
jmp    113d <get+0x3d>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    112a <get+0x2a>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @get(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = sdiv i64 %9, %10
store i64 %11, i64* %6
store i64 0, i64* %8
store i64 1, i64* %7
br label %12
12: ; preds = %17, %2
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i64, i64* %7
%19 = add nsw i64 %18, 1
store i64 %19, i64* %7
br label %12
20: ; preds = %12
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @get(i64 %0, i64 %1) {
ret i64 undef
}
int dim_safe(int i, int max) {
  if (i < 0) {
    return 0;
  }
  if (i > max) {
    return max;
  }
  return i;
}


x86 assembly (clang, -O0):
<dim_safe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <dim_safe+0x20>
movl   $0x0,-0x4(%rbp)
jmp    113d <dim_safe+0x3d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1137 <dim_safe+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <dim_safe+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dim_safe>:
cmp    %esi,%edi
cmovle %edi,%esi
xor    %eax,%eax
test   %edi,%edi
cmovns %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @dim_safe(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
int int_vec_eq(const int *v1, const int *v2, const int n) {
  int i;
  for (i = 0; i < n && v1[i] == v2[i]; i++)
    ;
  return i == n;
}


x86 assembly (clang, -O0):
<int_vec_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    1143 <int_vec_eq+0x43>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1153 <int_vec_eq+0x53>
jmp    1166 <int_vec_eq+0x66>
jmp    1158 <int_vec_eq+0x58>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <int_vec_eq+0x16>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_vec_eq>:
test   %edx,%edx
jle    1126 <int_vec_eq+0x26>
mov    %edx,%r8d
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%eax
cmp    (%rsi,%rcx,4),%eax
jne    1128 <int_vec_eq+0x28>
add    $0x1,%rcx
cmp    %rcx,%r8
jne    1110 <int_vec_eq+0x10>
mov    %r8d,%ecx
jmp    1128 <int_vec_eq+0x28>
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @int_vec_eq(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %17, %22
br label %24
24: ; preds = %12, %8
%25 = phi i1 [ false, %8 ], [ %23, %12 ]
br i1 %25, label %26, label %30
26: ; preds = %24
br label %27
27: ; preds = %26
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %24
%31 = load i32, i32* %7
%32 = load i32, i32* %6
%33 = icmp eq i32 %31, %32
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @int_vec_eq(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %14
%8 = phi i64 [ 0, %5 ], [ %15, %14 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %1, i64 %8
%12 = load i32, i32* %11
%13 = icmp eq i32 %10, %12
br i1 %13, label %14, label %17
14: ; preds = %7
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %19, label %7
17: ; preds = %7
%18 = trunc i64 %8 to i32
br label %19
19: ; preds = %14, %17, %3
%20 = phi i32 [ 0, %3 ], [ %18, %17 ], [ %2, %14 ]
%21 = icmp eq i32 %20, %2
%22 = zext i1 %21 to i32
ret i32 %22
}