xunge/DecIR huggingface dataset:
/* Variables and functions */
char *allouerchaine(int);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *chaine1 = allouerchaine(4);
  char *chaine2 = allouerchaine(8);
  scanf("%s", chaine1);
  scanf("%s", chaine2);
  printf("%s %s \n", chaine1, chaine2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <allouerchaine@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1040 <allouerchaine@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x4,%edi
call   1040 <allouerchaine@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1040 <allouerchaine@plt>
mov    %rax,%rbx
lea    0xeaa(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xe90(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"%s %s \0A\00"
define i32 @main() {
%1 = tail call i8* @allouerchaine(i32 4)
%2 = tail call i8* @allouerchaine(i32 8)
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_header(FILE *out) {
  fprintf(out, "/*\n *  File generated by cres\n */\n\n"
               "#include <stdio.h>\n\n");
}


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

x86 assembly (clang, -O2):
<write_header>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x37,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"/*\0A * File generated by cres\0A */\0A\0A#include <stdio.h>\0A\0A\00"
define void @write_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"/*\0A * File generated by cres\0A */\0A\0A#include <stdio.h>\0A\0A\00"
define void @write_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 55, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EMACPowerManagementControlSet(uint32_t ui32Base, uint32_t ui32Flags) {
  uint32_t ui32Value;
  ;

  ;
  ui32Value = (*((volatile uint32_t *)(ui32Base + 0x0000002C)));
  ui32Value &= ~(0x00000200 | 0x00000004 | 0x00000002 | 0x00000001);
  ui32Value |= ui32Flags;
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) = ui32Value;
}


x86 assembly (clang, -O0):
<EMACPowerManagementControlSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffdf8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACPowerManagementControlSet>:
movslq %edi,%rax
mov    $0xfffffdf8,%ecx
and    0x2c(%rax),%ecx
or     %esi,%ecx
mov    %ecx,0x2c(%rax)
ret

LLVM IR (-O0):
define void @EMACPowerManagementControlSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 44
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = and i32 %11, -520
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = or i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 44
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
ret void
}

LLVM IR (-O2):
define void @EMACPowerManagementControlSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 44
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -520
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ random1(int, int);
int /*<<< orphan*/ random2(int, int);
int main(int argc, char **argv) {
  int length = 10;
  random1(length, 100);
  random2(length, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x64,%esi
call   1030 <random1@plt>
mov    -0x14(%rbp),%edi
mov    $0x64,%esi
call   1040 <random2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x64,%esi
call   1030 <random1@plt>
mov    $0xa,%edi
mov    $0x64,%esi
call   1040 <random2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @random1(i32 %7, i32 100)
%9 = load i32, i32* %6
%10 = call i32 @random2(i32 %9, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @random1(i32 10, i32 100)
%4 = tail call i32 @random2(i32 10, i32 100)
ret i32 0
}
int nfs4_reset_recoverydir(char *recdir) { return 0; }


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

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

LLVM IR (-O0):
define i32 @nfs4_reset_recoverydir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @nfs4_reset_recoverydir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double exp(scalar_t__);
scalar_t__ lgamma(int);
int log(int);
double log_poisson_d(int k, int lambda) {
  return exp((k * log(lambda)) - lambda - lgamma(k + 1));
}


x86 assembly (clang, -O0):
<log_poisson_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <log@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
sub    -0x8(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <lgamma@plt>
mov    -0x10(%rbp),%rdi
sub    %rax,%rdi
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_poisson_d>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1050 <log@plt>
imul   %ebp,%eax
sub    %ebx,%eax
movslq %eax,%rbx
add    $0x1,%ebp
mov    %ebp,%edi
call   1040 <lgamma@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @log_poisson_d(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @log(i32 %6)
%8 = mul nsw i32 %5, %7
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = call i64 @lgamma(i32 %13)
%15 = sub nsw i64 %11, %14
%16 = call double @exp(i64 %15)
ret double %16
}

LLVM IR (-O2):
define double @log_poisson_d(i32 %0, i32 %1) {
%3 = tail call i32 @log(i32 %1)
%4 = mul nsw i32 %3, %0
%5 = sub nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = add nsw i32 %0, 1
%8 = tail call i64 @lgamma(i32 %7)
%9 = sub nsw i64 %6, %8
%10 = tail call double @exp(i64 %9)
ret double %10
}
/* Variables and functions */
scalar_t__ next_utf8(char const *, int *);
unsigned int strlen_utf8(const char *text) {
  int pos = 0;
  while (next_utf8(text, &pos) != 0)
    ;
  return (pos - 1);
}


x86 assembly (clang, -O0):
<strlen_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x0,%rax
je     113f <strlen_utf8+0x2f>
jmp    1123 <strlen_utf8+0x13>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_utf8>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <next_utf8@plt>
test   %rax,%rax
jne    1130 <strlen_utf8+0x20>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @strlen_utf8(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = call i64 @next_utf8(i8* %0, i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main(int argc, char *argv[]) {
  test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
ret i32 0
}
int gg_normalize_float2int(float x, float a) { return ((int)(0.5 + x / a)); }


x86 assembly (clang, -O0):
<gg_normalize_float2int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xedc(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_normalize_float2int>:
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xef0(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @gg_normalize_float2int(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 = load float, float* %4
%7 = fdiv float %5, %6
%8 = fpext float %7 to double
%9 = fadd double 5.000000e-01, %8
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @gg_normalize_float2int(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}
const struct genlist *datafile_list_base(const struct datafile_list *tthis) {
  return ((struct genlist *)(tthis));
}


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

x86 assembly (clang, -O2):
<datafile_list_base>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.genlist = type opaque
%struct.datafile_list = type opaque
define %struct.genlist* @datafile_list_base(%struct.datafile_list* %0) {
%2 = alloca %struct.datafile_list*
store %struct.datafile_list* %0, %struct.datafile_list** %2
%3 = load %struct.datafile_list*, %struct.datafile_list** %2
%4 = bitcast %struct.datafile_list* %3 to %struct.genlist*
ret %struct.genlist* %4
}

LLVM IR (-O2):
%struct.genlist = type opaque
%struct.datafile_list = type opaque
define %struct.genlist* @datafile_list_base(%struct.datafile_list* readnone %0) {
%2 = bitcast %struct.datafile_list* %0 to %struct.genlist*
ret %struct.genlist* %2
}
int is_sorted(int *a, int n) {
  for (int i = 0; i < n - 1; i++)
    if (a[i] > 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1154 <is_sorted+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    1141 <is_sorted+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <is_sorted+0x5b>
jmp    1146 <is_sorted+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <is_sorted+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sorted>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1111 <is_sorted+0x11>
xor    %eax,%eax
cmpl   $0x0,(%rdi)
jle    1112 <is_sorted+0x12>
ret
add    $0xffffffff,%esi
mov    %esi,%ecx
mov    $0x1,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
cmp    %rax,%rcx
je     1132 <is_sorted+0x32>
lea    0x1(%rdx),%rax
cmpl   $0x0,(%rdi,%rdx,4)
jle    1120 <is_sorted+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setae  %al
ret

LLVM IR (-O0):
define i32 @is_sorted(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %24
12: ; preds = %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 0, i32* %3
br label %25
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %7
24: ; preds = %7
store i32 1, i32* %3
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_sorted(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %21
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = zext i32 %3 to i64
%8 = load i32, i32* %0
%9 = icmp sgt i32 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %0, i64 %11
%15 = load i32, i32* %14
%16 = icmp sgt i32 %15, 0
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp uge i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %2
%22 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ fp32_to_hex(float, unsigned char *);
void nfp32_to_hex(float *dataf, unsigned char *datahex, int n) {
  for (int i = 0; i < n; ++i) {
    fp32_to_hex(dataf[i], &datahex[i * 4]);
  }
}


x86 assembly (clang, -O0):
<nfp32_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1165 <nfp32_to_hex+0x55>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%rdi
call   1030 <fp32_to_hex@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <nfp32_to_hex+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfp32_to_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1148 <nfp32_to_hex+0x38>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
shl    $0x2,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movss  (%r15,%rbx,1),%xmm0
lea    (%r14,%rbx,1),%rdi
call   1030 <fp32_to_hex@plt>
add    $0x4,%rbx
cmp    %rbx,%r12
jne    1130 <nfp32_to_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @nfp32_to_hex(float* %0, i8* %1, i32 %2) {
%4 = alloca float*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store float* %0, float** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load float*, float** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = load i8*, i8** %5
%19 = load i32, i32* %7
%20 = mul nsw i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
%23 = call i32 @fp32_to_hex(float %17, i8* %22)
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @nfp32_to_hex(float* nocapture %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %15, %8 ]
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = load float, float* %10
%12 = shl nsw i64 %9, 2
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = tail call i32 @fp32_to_hex(float %11, i8* %13)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %8
}
int is_eq(char a, char b) { return a == b; }


x86 assembly (clang, -O0):
<is_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_eq>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_eq(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_eq(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int, size_t);
void *mycalloc(size_t nmemb, size_t size) {
  void *Result = NULL;
  Result = malloc(nmemb * size);
  if (NULL != Result) {
    memset(Result, 0x00, nmemb * size);
  }
  return Result;
}


x86 assembly (clang, -O0):
<mycalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     116a <mycalloc+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <mycalloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mycalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* null, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = call i32 @memset(i8* %13, i32 0, i64 %16)
br label %18
18: ; preds = %12, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @mycalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int Cyc_AssnDef_termcmp(void *, void *);
int Cyc_AssnDef_inv_termcmp(void *t1, void *t2) {
  int _T0;
  int _T1;
  _T0 = Cyc_AssnDef_termcmp(t1, t2);
  _T1 = -_T0;
  return _T1;
}


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

x86 assembly (clang, -O2):
<Cyc_AssnDef_inv_termcmp>:
push   %rax
call   1030 <Cyc_AssnDef_termcmp@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Cyc_AssnDef_inv_termcmp(i8* %0, i8* %1) {
%3 = tail call i32 @Cyc_AssnDef_termcmp(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
void Library_Foo(void) {}


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

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

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

LLVM IR (-O2):
define void @Library_Foo() {
ret void
}
unsigned xrop3_144_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_144_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    $0xffffff00,%eax
and    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_144_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = and i32 %6, %7
ret i32 %8
}
int my_float_compare_descending(const void *xv, const void *yv) {
  float *x, *y;
  x = (float *)xv;
  y = (float *)yv;
  if (*x == *y)
    return 0;
  else if (*x < *y)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<my_float_compare_descending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jne    1143 <my_float_compare_descending+0x43>
jp     1143 <my_float_compare_descending+0x43>
movl   $0x0,-0x4(%rbp)
jmp    116f <my_float_compare_descending+0x6f>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1168 <my_float_compare_descending+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <my_float_compare_descending+0x6f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_float_compare_descending>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
xor    %eax,%eax
ucomiss %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_float_compare_descending(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
%8 = fcmp olt float %5, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
void __attribute__((always_)) __attribute__((noreturn)) halt(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <halt+0x9>
jmp    1109 <halt+0x9>

x86 assembly (clang, -O2):
<halt>:
jmp    1100 <halt>

LLVM IR (-O0):
define void @halt() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @halt() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *s, const char *b) {
  static char *under_rock;
  return strtok_r(s, b, &under_rock);
}


x86 assembly (clang, -O0):
<strtok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f01(%rip),%rdx
call   1030 <strtok_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.under_rock = internal global i8* null
define i8* @strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.under_rock)
ret i8* %7
}

LLVM IR (-O2):
@strtok.under_rock = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.under_rock)
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
float *CreateArrayIntensity(float red0, float green0, float blue0) {
  float *TabIntensity;
  TabIntensity = (float *)malloc(3 * sizeof(float));
  TabIntensity[0] = red0;
  TabIntensity[1] = green0;
  TabIntensity[2] = blue0;
  return TabIntensity;
}


x86 assembly (clang, -O0):
<CreateArrayIntensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateArrayIntensity>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    $0xc,%edi
call   1030 <malloc@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,(%rax)
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x4(%rax)
movss  0x14(%rsp),%xmm0
movss  %xmm0,0x8(%rax)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float* @CreateArrayIntensity(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = call i64 @malloc(i32 12)
%9 = inttoptr i64 %8 to float*
store float* %9, float** %7
%10 = load float, float* %4
%11 = load float*, float** %7
%12 = getelementptr inbounds float, float* %11, i64 0
store float %10, float* %12
%13 = load float, float* %5
%14 = load float*, float** %7
%15 = getelementptr inbounds float, float* %14, i64 1
store float %13, float* %15
%16 = load float, float* %6
%17 = load float*, float** %7
%18 = getelementptr inbounds float, float* %17, i64 2
store float %16, float* %18
%19 = load float*, float** %7
ret float* %19
}

LLVM IR (-O2):
define float* @CreateArrayIntensity(float %0, float %1, float %2) {
%4 = tail call i64 @malloc(i32 12)
%5 = inttoptr i64 %4 to float*
store float %0, float* %5
%6 = getelementptr inbounds float, float* %5, i64 1
store float %1, float* %6
%7 = getelementptr inbounds float, float* %5, i64 2
store float %2, float* %7
ret float* %5
}
/* Variables and functions */
double logarithm(double, int /*<<< orphan*/);
double log(double x) { return logarithm(x, 0); }


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <logarithm@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @log(double %0) {
%2 = tail call double @logarithm(double %0, i32 0)
ret double %2
}
/* Variables and functions */
int square(int);
int complex_abs_squared(int real, int imag) {
  return square(real) + square(imag);
}


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

x86 assembly (clang, -O2):
<complex_abs_squared>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <square@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <square@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @complex_abs_squared(i32 %0, i32 %1) {
%3 = tail call i32 @square(i32 %0)
%4 = tail call i32 @square(i32 %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
char i2cf(char c) {
  switch (c) {
  case 0:
    return '-';
  case 1:
    return '0';
  case 2:
    return '1';
  case 3:
    return '2';
  case 4:
    return '3';
  case 5:
    return '4';
  case 6:
    return '5';
  case 7:
    return '6';
  case 8:
    return '7';
  case 9:
    return '8';
  case 10:
    return '9';
  }
  return '-';
}


x86 assembly (clang, -O0):
<i2cf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xa,%eax
ja     1194 <i2cf+0x94>
mov    -0x10(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x2d,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x30,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x31,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x32,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x33,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x34,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x35,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x36,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x37,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x38,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x39,-0x1(%rbp)
jmp    1198 <i2cf+0x98>
movb   $0x2d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cf>:
add    $0xffffffff,%edi
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
movzbl %al,%ecx
mov    $0x2d,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @i2cf(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %17 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
]
6: ; preds = %1
store i8 45, i8* %2
br label %18
7: ; preds = %1
store i8 48, i8* %2
br label %18
8: ; preds = %1
store i8 49, i8* %2
br label %18
9: ; preds = %1
store i8 50, i8* %2
br label %18
10: ; preds = %1
store i8 51, i8* %2
br label %18
11: ; preds = %1
store i8 52, i8* %2
br label %18
12: ; preds = %1
store i8 53, i8* %2
br label %18
13: ; preds = %1
store i8 54, i8* %2
br label %18
14: ; preds = %1
store i8 55, i8* %2
br label %18
15: ; preds = %1
store i8 56, i8* %2
br label %18
16: ; preds = %1
store i8 57, i8* %2
br label %18
17: ; preds = %1
store i8 45, i8* %2
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @i2cf(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 10
%5 = trunc i32 %3 to i8
%6 = add i8 %5, 48
%7 = select i1 %4, i8 %6, i8 45
ret i8 %7
}
/* Type definitions */
typedef unsigned long long __u64;
typedef unsigned long long __u32;

/* Variables and functions */
__u32 hea_get_u32_bits(__u32 val, int start, int end) {
  return ((((__u64)(val)) &
           ((~0ULL << (63 - (end + 32))) & (~0ULL >> (start + 32)))) >>
          (63 - (end + 32)));
}


x86 assembly (clang, -O0):
<hea_get_u32_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%edx
add    $0x20,%edx
mov    $0x3f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x20,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shr    %cl,%rdx
mov    -0x18(%rbp),%rcx
and    %rdx,%rcx
and    %rcx,%rax
mov    -0x10(%rbp),%edx
add    $0x20,%edx
mov    $0x3f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_get_u32_bits>:
mov    %rdi,%rax
lea    0x20(%rsi),%ecx
shl    %cl,%rax
mov    $0x1f,%sil
shr    %cl,%rax
sub    %dl,%sil
mov    %esi,%ecx
shr    %cl,%rax
shl    %cl,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @hea_get_u32_bits(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 32
%10 = sub nsw i32 63, %9
%11 = zext i32 %10 to i64
%12 = shl i64 -1, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 32
%15 = zext i32 %14 to i64
%16 = lshr i64 -1, %15
%17 = and i64 %12, %16
%18 = and i64 %7, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 32
%21 = sub nsw i32 63, %20
%22 = zext i32 %21 to i64
%23 = lshr i64 %18, %22
ret i64 %23
}

LLVM IR (-O2):
define i64 @hea_get_u32_bits(i64 %0, i32 %1, i32 %2) {
%4 = sub i32 31, %2
%5 = zext i32 %4 to i64
%6 = shl nsw i64 -1, %5
%7 = add nsw i32 %1, 32
%8 = zext i32 %7 to i64
%9 = lshr i64 -1, %8
%10 = and i64 %9, %0
%11 = and i64 %10, %6
%12 = lshr i64 %11, %5
ret i64 %12
}
int cmp_uchar_gt(const void *a, const void *b) {
  unsigned char a_ = *(unsigned char *)a;
  unsigned char b_ = *(unsigned char *)b;
  if (a_ > b_)
    return -1;
  if (a_ < b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_uchar_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    113a <cmp_uchar_gt+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_uchar_gt+0x5d>
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    1156 <cmp_uchar_gt+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <cmp_uchar_gt+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uchar_gt>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_uchar_gt(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ugt i8 %3, %4
%6 = icmp ult i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ darray;

/* Variables and functions */
int darray_size(void *darray) {
  return darray != NULL ? (((int *)(darray)-2)[1]) : 0;
}


x86 assembly (clang, -O0):
<darray_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <darray_size+0x22>
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    112c <darray_size+0x2c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <darray_size+0x2c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<darray_size>:
test   %rdi,%rdi
je     1109 <darray_size+0x9>
mov    -0x4(%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @darray_size(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void flipScreen(void) { refresh(); }


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

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

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

LLVM IR (-O2):
define void @flipScreen() {
%1 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int i2c_send_byte_3(int, int, char, char);
int OLED_wrcmd_db(char cmd1, char cmd2) {
  return i2c_send_byte_3(0x3C, 0x00, cmd1, cmd2);
}


x86 assembly (clang, -O0):
<OLED_wrcmd_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x3c,%edi
xor    %esi,%esi
movsbl %al,%edx
movsbl -0x2(%rbp),%ecx
call   1030 <i2c_send_byte_3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OLED_wrcmd_db>:
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x3c,%edi
xor    %esi,%esi
jmp    1030 <i2c_send_byte_3@plt>

LLVM IR (-O0):
define i32 @OLED_wrcmd_db(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @i2c_send_byte_3(i32 60, i32 0, i8 signext %5, i8 signext %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @OLED_wrcmd_db(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @i2c_send_byte_3(i32 60, i32 0, i8 signext %0, i8 signext %1)
ret i32 %3
}
void clock_usec_delay(int usecs) {}


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

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

LLVM IR (-O0):
define void @clock_usec_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @clock_usec_delay(i32 %0) {
ret void
}
int test_imm_E8int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15204352
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int atoi(char *);
int cmp_ad();
int /*<<< orphan*/ compare(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int cmpad, size;
  if (!argv[1]) {
    printf("no compare size given! \n", size);
  } else {
    size = atoi(argv[1]);
    cmpad = cmp_ad();
    compare(cmpad, size);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1179 <main+0x39>
mov    -0x18(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <cmp_ad@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <compare@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1163 <main+0x23>
call   1040 <atoi@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <cmp_ad@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <compare@plt>
jmp    116f <main+0x2f>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"no compare size given! \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %24
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %7
%20 = call i32 (...) @cmp_ad()
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @compare(i32 %21, i32 %22)
br label %24
24: ; preds = %15, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"no compare size given! \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 undef)
br label %12
8: ; preds = %2
%9 = tail call i32 @atoi(i8* %4)
%10 = tail call i32 (...) @cmp_ad()
%11 = tail call i32 @compare(i32 %10, i32 %9)
br label %12
12: ; preds = %8, %6
ret i32 0
}