xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScaled(double, double, double);
int /*<<< orphan*/ glTranslated(double, double, double);
int /*<<< orphan*/ glutSolidCube(double);
void wall(double thickness) {
  glPushMatrix();
  glTranslated(0.5, 0.5 * thickness, 0.5);
  glScaled(1.0, thickness, 1.0);
  glutSolidCube(1.0);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<wall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  0xe9c(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe8f(%rip),%xmm2
movaps %xmm2,%xmm0
call   1070 <glTranslated@plt>
movsd  -0x8(%rbp),%xmm1
movsd  0xe72(%rip),%xmm2
movaps %xmm2,%xmm0
call   1050 <glScaled@plt>
movsd  0xe62(%rip),%xmm0
call   1030 <glutSolidCube@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wall>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  0xe9b(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
call   1070 <glTranslated@plt>
movsd  0xe89(%rip),%xmm0
movsd  (%rsp),%xmm1
movaps %xmm0,%xmm2
call   1050 <glScaled@plt>
movsd  0xe74(%rip),%xmm0
call   1030 <glutSolidCube@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @wall(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @glPushMatrix()
%4 = load double, double* %2
%5 = fmul double 5.000000e-01, %4
%6 = call i32 @glTranslated(double 5.000000e-01, double %5, double 5.000000e-01)
%7 = load double, double* %2
%8 = call i32 @glScaled(double 1.000000e+00, double %7, double 1.000000e+00)
%9 = call i32 @glutSolidCube(double 1.000000e+00)
%10 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @wall(double %0) {
%2 = tail call i32 (...) @glPushMatrix()
%3 = fmul double %0, 5.000000e-01
%4 = tail call i32 @glTranslated(double 5.000000e-01, double %3, double 5.000000e-01)
%5 = tail call i32 @glScaled(double 1.000000e+00, double %0, double 1.000000e+00)
%6 = tail call i32 @glutSolidCube(double 1.000000e+00)
%7 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_BansheeIf_init_toplevel_cvars(struct Cyc_List_List *);
struct Cyc_List_List *Cyc_Interproc_parse_constraint_graph();
int Cyc_Interproc_read_constraint_graph(void) {
  struct Cyc_List_List *cg = Cyc_Interproc_parse_constraint_graph();
  Cyc_BansheeIf_init_toplevel_cvars(cg);
  return 0;
}


x86 assembly (clang, -O0):
<Cyc_Interproc_read_constraint_graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cyc_Interproc_parse_constraint_graph@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Cyc_BansheeIf_init_toplevel_cvars@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Interproc_read_constraint_graph>:
push   %rax
xor    %eax,%eax
call   1030 <Cyc_Interproc_parse_constraint_graph@plt>
mov    %rax,%rdi
call   1040 <Cyc_BansheeIf_init_toplevel_cvars@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_Interproc_read_constraint_graph() {
%1 = alloca %struct.Cyc_List_List*
%2 = call %struct.Cyc_List_List* (...) @Cyc_Interproc_parse_constraint_graph()
store %struct.Cyc_List_List* %2, %struct.Cyc_List_List** %1
%3 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %1
%4 = call i32 @Cyc_BansheeIf_init_toplevel_cvars(%struct.Cyc_List_List* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_Interproc_read_constraint_graph() {
%1 = tail call %struct.Cyc_List_List* (...) @Cyc_Interproc_parse_constraint_graph()
%2 = tail call i32 @Cyc_BansheeIf_init_toplevel_cvars(%struct.Cyc_List_List* %1)
ret i32 0
}
/* Variables and functions */
bool nrf51_errata_6(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_6() {
ret i32 0
}
/* Variables and functions */
long double erfc(long double);
long double erfcl(long double a1) { return erfc(a1); }


x86 assembly (clang, -O0):
<erfcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <erfc@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfcl>:
jmp    1030 <erfc@plt>

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

LLVM IR (-O2):
define x86_fp80 @erfcl(x86_fp80 %0) {
%2 = tail call x86_fp80 @erfc(x86_fp80 %0)
ret x86_fp80 %2
}
void NullFree(void *freeme) {}


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

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

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

LLVM IR (-O2):
define void @NullFree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void fail(const char *test, const char *note) {
  fprintf(stderr, "%s - %s: FAIL (%s)\n", test, note, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    %rax,%r8
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ebp
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea8(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"%s - %s: FAIL (%s)\0A\00"
@errno = global i32 0
define void @fail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7, i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"%s - %s: FAIL (%s)\0A\00"
@errno = global i32 0
define void @fail(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int sd_notify(int, char *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
int sd_notifyf(int unset_environment, const char *format) {
  char *p = NULL;
  char buff[128];
  int r;
  strncpy(buff, format, 128);
  p = buff;
  r = sd_notify(unset_environment, p);
  return r;
}


x86 assembly (clang, -O0):
<sd_notifyf>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x80,%edx
call   1040 <strncpy@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <sd_notify@plt>
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_notifyf>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%edx
call   1040 <strncpy@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <sd_notify@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sd_notifyf(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [128 x i8]
%7 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8* null, i8** %5
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 128)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
store i8* %11, i8** %5
%12 = load i32, i32* %3
%13 = load i8*, i8** %5
%14 = call i32 @sd_notify(i32 %12, i8* %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @sd_notifyf(i32 %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %1, i32 128)
%6 = call i32 @sd_notify(i32 %0, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
double pow(int /*<<< orphan*/, int);
double f3(double x) { return pow(fabs((x - 1)), 3); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
addsd  0xed7(%rip),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
mov    $0x3,%esi
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @f3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
%5 = call i32 @fabs(double %4)
%6 = call double @pow(i32 %5, i32 3)
ret double %6
}

LLVM IR (-O2):
define double @f3(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = tail call i32 @fabs(double %2)
%4 = tail call double @pow(i32 %3, i32 3)
ret double %4
}
int test_imm_E8uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 24
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char toupper(char);
int ishex(char c) {
  char uc;
  uc = toupper(c);
  if (((uc >= '0') && (uc <= '9')) || ((uc >= 'A') && (uc <= 'F')))
    return (!0);
  else
    return 0;
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x30,%eax
jl     1144 <ishex+0x34>
movsbl -0x6(%rbp),%eax
cmp    $0x39,%eax
jle    115e <ishex+0x4e>
movsbl -0x6(%rbp),%eax
cmp    $0x41,%eax
jl     116a <ishex+0x5a>
movsbl -0x6(%rbp),%eax
cmp    $0x46,%eax
jg     116a <ishex+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <ishex+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
push   %rax
call   1030 <toupper@plt>
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
setb   %cl
add    $0xbf,%al
cmp    $0x6,%al
setb   %al
or     %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ishex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = call signext i8 @toupper(i8 signext %5)
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br i1 %13, label %22, label %14
14: ; preds = %10, %1
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 70
br i1 %21, label %22, label %23
22: ; preds = %18, %10
store i32 1, i32* %2
br label %24
23: ; preds = %18, %14
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 signext %0)
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
%5 = add i8 %2, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_negative(float *, float *);
__attribute__((always_)) struct mat3 *psmat3_negative(struct mat3 *result,
                                                      struct mat3 *m) {
  mat3_negative((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat3_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_negative(%struct.mat3* %0, %struct.mat3* %1) {
%3 = alloca %struct.mat3*
%4 = alloca %struct.mat3*
store %struct.mat3* %0, %struct.mat3** %3
store %struct.mat3* %1, %struct.mat3** %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load %struct.mat3*, %struct.mat3** %4
%8 = bitcast %struct.mat3* %7 to float*
%9 = call i32 @mat3_negative(float* %6, float* %8)
%10 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %10
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_negative(%struct.mat3* returned %0, %struct.mat3* %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = bitcast %struct.mat3* %1 to float*
%5 = tail call i32 @mat3_negative(float* %3, float* %4)
ret %struct.mat3* %0
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_10(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_10>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_10+0xb>

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

LLVM IR (-O0):
define void @task_10() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_10() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
float abs(float);
int /*<<< orphan*/ printf(char *, char *);
void segno(float num) {
  if (abs(num) == num)
    printf("%s\n", "positivo");
  else
    printf("%s\n", "negativo");
}


x86 assembly (clang, -O0):
<segno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <abs@plt>
ucomiss -0x4(%rbp),%xmm0
jne    115f <segno+0x3f>
jp     115f <segno+0x3f>
lea    0xeb2(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <printf@plt>
jmp    1172 <segno+0x52>
lea    0xe9a(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<segno>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <abs@plt>
ucomiss 0x4(%rsp),%xmm0
lea    0xed5(%rip),%rax
lea    0xec5(%rip),%rsi
cmovne %rax,%rsi
cmovp  %rax,%rsi
lea    0xeb2(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"positivo\00"
@.str.2 = [9 x i8] c"negativo\00"
define void @segno(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @abs(float %3)
%5 = load float, float* %2
%6 = fcmp oeq float %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"positivo\00"
@.str.2 = [9 x i8] c"negativo\00"
define void @segno(float %0) {
%2 = tail call float @abs(float %0)
%3 = fcmp oeq float %2, %0
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ siftDown(double *, int, int);
void makeHeap(double heaps[], int count) {
  for (int start = (count - 2) / 2; start >= 0; start--) {
    siftDown(heaps, start, count);
  }
}


x86 assembly (clang, -O0):
<makeHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <makeHeap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <siftDown@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <makeHeap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeHeap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1141 <makeHeap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x2(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xfffffffe,%ebp
sar    %ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <siftDown@plt>
add    $0xffffffff,%ebp
jb     1130 <makeHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @makeHeap(double* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -2
%6 = sdiv i32 %5, 2
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ %6, %4 ]
%10 = tail call i32 @siftDown(double* %0, i32 %9, i32 %1)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %7, label %8
}
/* Variables and functions */
int PAPI_remove_events(int, int *, int);
void PAPIF_REMOVE_EVENTS(int *EventSet, int *Events, int *number, int *check) {
  *check = PAPI_remove_events(*EventSet, Events, *number);
}


x86 assembly (clang, -O0):
<PAPIF_REMOVE_EVENTS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <PAPI_remove_events@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_REMOVE_EVENTS>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <PAPI_remove_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_REMOVE_EVENTS(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call i32 @PAPI_remove_events(i32 %10, i32* %11, i32 %13)
%15 = load i32*, i32** %8
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @PAPIF_REMOVE_EVENTS(i32* nocapture %0, i32* %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call i32 @PAPI_remove_events(i32 %5, i32* %1, i32 %6)
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutFullScreen();
void s2winFullScreen(void) { glutFullScreen(); }


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

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

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

LLVM IR (-O2):
define void @s2winFullScreen() {
%1 = tail call i32 (...) @glutFullScreen()
ret void
}
int vde_chain_nm7_free(void *mem) {
  (void)mem;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @vde_chain_nm7_free(i8* nocapture readnone %0) {
ret i32 0
}
void multiplication_float(struct multiplication_options_float *options,
                          float *in0, float *in1, float *out0) {
  *out0 = *in0 * *in1;
}


x86 assembly (clang, -O0):
<multiplication_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplication_float>:
movss  (%rsi),%xmm0
mulss  (%rdx),%xmm0
movss  %xmm0,(%rcx)
ret

LLVM IR (-O0):
%struct.multiplication_options_float = type opaque
define void @multiplication_float(%struct.multiplication_options_float* %0, float* %1, float* %2, float* %3) {
%5 = alloca %struct.multiplication_options_float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store %struct.multiplication_options_float* %0, %struct.multiplication_options_float** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float*, float** %6
%10 = load float, float* %9
%11 = load float*, float** %7
%12 = load float, float* %11
%13 = fmul float %10, %12
%14 = load float*, float** %8
store float %13, float* %14
ret void
}

LLVM IR (-O2):
%struct.multiplication_options_float = type opaque
define void @multiplication_float(%struct.multiplication_options_float* nocapture readnone %0, float* nocapture %1, float* nocapture %2, float* nocapture writeonly %3) {
%5 = load float, float* %1
%6 = load float, float* %2
%7 = fmul float %5, %6
store float %7, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PostfixEvaluation() { printf("hey i am PostfixEvaluation"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"hey i am PostfixEvaluation\00"
define void @PostfixEvaluation() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"hey i am PostfixEvaluation\00"
define void @PostfixEvaluation() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int pgcd(unsigned int a, unsigned int b) {
  unsigned int tmp;
  while (b) {
    tmp = a;
    a = b, b = tmp % b;
  }
  return a;
}


x86 assembly (clang, -O0):
<pgcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <pgcd+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    110a <pgcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <pgcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <pgcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pgcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = urem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int callee_flat_u_abs(unsigned int);
unsigned caller_flat_u_aa(unsigned bla) { return callee_flat_u_abs(bla); }


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

x86 assembly (clang, -O2):
<caller_flat_u_aa>:
jmp    1030 <callee_flat_u_abs@plt>

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

LLVM IR (-O2):
define i32 @caller_flat_u_aa(i32 %0) {
%2 = tail call i32 @callee_flat_u_abs(i32 %0)
ret i32 %2
}
void flip(int arr[], int n) {
  int temp, start = 0;
  while (start < n) {
    temp = arr[start];
    arr[start] = arr[n];
    arr[n] = temp;
    start++;
    n--;
  }
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <flip+0x67>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <flip+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
test   %esi,%esi
jle    112e <flip+0x2e>
mov    %esi,%eax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rdi,%rcx,4),%edx
mov    (%rdi,%rax,4),%esi
mov    %esi,-0x4(%rdi,%rcx,4)
mov    %edx,(%rdi,%rax,4)
add    $0xffffffffffffffff,%rax
lea    0x1(%rcx),%rdx
cmp    %rax,%rcx
mov    %rdx,%rcx
jl     1110 <flip+0x10>
ret

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

LLVM IR (-O2):
define void @flip(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %14, %6 ]
%8 = phi i64 [ 0, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 %7
%12 = load i32, i32* %11
store i32 %12, i32* %9
store i32 %10, i32* %11
%13 = add nuw nsw i64 %8, 1
%14 = add nsw i64 %7, -1
%15 = icmp slt i64 %13, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %2
ret void
}
void PDO_DBG_ENTER(char *func_name) {}


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

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

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

LLVM IR (-O2):
define void @PDO_DBG_ENTER(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void **realloc(void **, int);
void add_nbr_point(int *n, const void ***nbr, const void *p) {
  *n += 1;
  *nbr = realloc((void **)(*nbr), *n * sizeof(const void *));
  (*nbr)[*n - 1] = p;
}


x86 assembly (clang, -O0):
<add_nbr_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_nbr_point>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%rdi
lea    0x8(,%rax,8),%esi
call   1030 <realloc@plt>
mov    %rax,(%r15)
movslq (%rbx),%rcx
mov    %r14,-0x8(%rax,%rcx,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @add_nbr_point(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 i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i8***, i8**** %5
%11 = load i8**, i8*** %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i8** @realloc(i8** %11, i32 %16)
%18 = load i8***, i8**** %5
store i8** %17, i8*** %18
%19 = load i8*, i8** %6
%20 = load i8***, i8**** %5
%21 = load i8**, i8*** %20
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %21, i64 %25
store i8* %19, i8** %26
ret void
}

LLVM IR (-O2):
define void @add_nbr_point(i32* nocapture %0, i8*** nocapture %1, i8* %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
store i32 %5, i32* %0
%6 = load i8**, i8*** %1
%7 = shl i32 %5, 3
%8 = tail call i8** @realloc(i8** %6, i32 %7)
store i8** %8, i8*** %1
%9 = load i32, i32* %0
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %8, i64 %11
store i8* %2, i8** %12
ret void
}
int is_alphanumeric_char(char val) {
  if (val >= 'a' && val <= 'z') {
    return 1;
  }
  if (val >= 'A' && val <= 'Z') {
    return 1;
  }
  if (val >= '0' && val <= '9') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_alphanumeric_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_alphanumeric_char+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_alphanumeric_char+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_alphanumeric_char+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_alphanumeric_char+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <is_alphanumeric_char+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_alphanumeric_char+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117c <is_alphanumeric_char+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117c <is_alphanumeric_char+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_alphanumeric_char+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphanumeric_char>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_alphanumeric_char(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x3c() {
  Assert_real((isgraph(60)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              305, ("isgraph should be 1 for <"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x3c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x131,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x3c>:
push   %rax
mov    $0x3c,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x131,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for <\00"
define void @t_isgraph_0x3c() {
%1 = call i32 @isgraph(i32 60)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for <\00"
define void @t_isgraph_0x3c() {
%1 = tail call i32 @isgraph(i32 60)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_codecvt {
  int dummy;
};
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t _WLocale_mbtowc(struct _Locale_codecvt *lcodecvt, wchar_t *to,
                       const char *from, size_t n, mbstate_t *st) {
  *to = *from;
  return 1;
}


x86 assembly (clang, -O0):
<_WLocale_mbtowc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_WLocale_mbtowc>:
mov    (%rdx),%al
mov    %al,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_mbtowc(%struct._Locale_codecvt* %0, i8* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca %struct._Locale_codecvt*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
store %struct._Locale_codecvt* %0, %struct._Locale_codecvt** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i8*, i8** %8
%12 = load i8, i8* %11
%13 = load i8*, i8** %7
store i8 %12, i8* %13
ret i64 1
}

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_mbtowc(%struct._Locale_codecvt* nocapture readnone %0, i8* nocapture writeonly %1, i8* nocapture %2, i64 %3, i32* nocapture readnone %4) {
%6 = load i8, i8* %2
store i8 %6, i8* %1
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end(void) { printf("2\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"2\00"
define void @end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int ***);
int main() {
  int a[3][3][2];
  f(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x [3 x [2 x i32]]]
%2 = getelementptr inbounds [3 x [3 x [2 x i32]]], [3 x [3 x [2 x i32]]]* %1, i64 0, i64 0
%3 = bitcast [3 x [2 x i32]]* %2 to i32***
%4 = call i32 @f(i32*** %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [3 x [2 x i32]]]
%2 = bitcast [3 x [3 x [2 x i32]]]* %1 to i8*
%3 = bitcast [3 x [3 x [2 x i32]]]* %1 to i32***
%4 = call i32 @f(i32*** %3)
ret i32 0
}
char scmp(char *a, char *b) {
  int i;
  for (i = 0; a[i] != '\0'; i++)
    if (a[i] != b[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<scmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <scmp+0x64>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1151 <scmp+0x51>
movb   $0x0,-0x1(%rbp)
jmp    1168 <scmp+0x68>
jmp    1156 <scmp+0x56>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <scmp+0x13>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmp>:
mov    (%rdi),%cl
mov    $0x1,%al
test   %cl,%cl
je     1122 <scmp+0x22>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    (%rsi,%rdx,1),%cl
jne    1123 <scmp+0x23>
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <scmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %15
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %15, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, %13
%15 = add nuw i64 %10, 1
br i1 %14, label %5, label %16
16: ; preds = %9, %5, %2
%17 = phi i8 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i8 %17
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int plat_get_ticks_ms(void) {
  struct timeval tv;
  unsigned int ret;
  gettimeofday(&tv, NULL);
  ret = (unsigned)tv.tv_sec * 1000;
  ret += ((unsigned)tv.tv_usec * 4195) >> 22;
  return ret;
}


x86 assembly (clang, -O0):
<plat_get_ticks_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x1063,%eax,%eax
shr    $0x16,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_get_ticks_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
imul   $0x1063,0x8(%rsp),%eax
shr    $0x16,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @plat_get_ticks_ms() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, 1000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul i32 %10, 4195
%12 = lshr i32 %11, 22
%13 = load i32, i32* %2
%14 = add i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @plat_get_ticks_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul i32 %10, 4195
%12 = lshr i32 %11, 22
%13 = add i32 %12, %7
ret i32 %13
}
int keybyte(const unsigned char *key, int keybytes, int index) {
  return ((int)key[index % keybytes]);
}


x86 assembly (clang, -O0):
<keybyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x18(%rbp),%rax
movslq %edx,%rcx
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keybyte>:
mov    %edx,%eax
cltd
idiv   %esi
movslq %edx,%rax
movzbl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @keybyte(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = srem i32 %8, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @keybyte(i8* nocapture %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
ret i32 %8
}
int uipprintf(const char *fmt, ...) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @uipprintf(i8* nocapture readnone %0, ...) {
ret i32 0
}
int MYstrlen(char *source) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MYstrlen(i8* nocapture readnone %0) {
ret i32 0
}