xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_or_to_all(int *target, int *source, int nreduce,
                                int PE_start, int logPE_stride, int PE_size,
                                int *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_int_or_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_or_to_all(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6, i64* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i64*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_or_to_all(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int isprint(int c) { return (c >= 0x20 && c <= 0x7e); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float num;
  scanf("%f", &num);
  printf("%.4e\n", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [6 x i8] c"%.4e\0A\00"
define i32 @main() {
%1 = alloca float
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%3 = load float, float* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [6 x i8] c"%.4e\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %4)
ret i32 0
}
void XtCvtStringToDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToDisplay() {
ret void
}
int fun989() { return 989; }


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

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

LLVM IR (-O0):
define i32 @fun989() {
ret i32 989
}

LLVM IR (-O2):
define i32 @fun989() {
ret i32 989
}
void shift_left(p) register char *p;
{
  do {
    *p = *(p + 1);
    p++;
  } while (*p != 0);
}


x86 assembly (clang, -O0):
<shift_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1108 <shift_left+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_left>:
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi),%eax
mov    %al,-0x1(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1110 <shift_left+0x10>
ret

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

LLVM IR (-O2):
define void @shift_left(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
double softclip(double x, double a) {
  double cse = (2 * a * x - x - a + 1) * x;
  return cse / (cse + (1 - a));
}


x86 assembly (clang, -O0):
<softclip>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe8f(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<softclip>:
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
movsd  0xee4(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
divsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @softclip(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %7, double %8, double %10)
%12 = load double, double* %4
%13 = fsub double %11, %12
%14 = fadd double %13, 1.000000e+00
%15 = load double, double* %3
%16 = fmul double %14, %15
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %5
%19 = load double, double* %4
%20 = fsub double 1.000000e+00, %19
%21 = fadd double %18, %20
%22 = fdiv double %17, %21
ret double %22
}

LLVM IR (-O2):
define double @softclip(double %0, double %1) {
%3 = fmul double %1, 2.000000e+00
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %4)
%6 = fsub double %5, %1
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %7, %0
%9 = fsub double 1.000000e+00, %1
%10 = fadd double %9, %8
%11 = fdiv double %8, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ restorescreen();
int system(char *);
void restoreTerminalAndExit(int dummy) {
  clear();
  restorescreen();
  printf("imacs bids you farewell!\n");
  int ignore = system("stty echo");
  ignore += system("stty sane");
  exit(0);
}


x86 assembly (clang, -O0):
<restoreTerminalAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x0,%al
call   1050 <restorescreen@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <system@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<restoreTerminalAndExit>:
push   %rax
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1050 <restorescreen@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8e(%rip),%rdi
call   1040 <system@plt>
lea    0xe8c(%rip),%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"imacs bids you farewell!\0A\00"
@.str.1 = [10 x i8] c"stty echo\00"
@.str.2 = [10 x i8] c"stty sane\00"
define void @restoreTerminalAndExit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @clear()
%5 = call i32 (...) @restorescreen()
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %3
%8 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"stty echo\00"
@.str.2 = [10 x i8] c"stty sane\00"
@str = [25 x i8] c"imacs bids you farewell!\00"
define void @restoreTerminalAndExit(i32 %0) {
%2 = tail call i32 (...) @clear()
%3 = tail call i32 (...) @restorescreen()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
void gtk_label_get_layout_offsets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_get_layout_offsets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_nodes_fromfile(int /*<<< orphan*/, long);
void fgmvwrite_nodes_fromfile_(char filnam[], long nndes) {
  gmvwrite_nodes_fromfile(fortchartoc(filnam), nndes);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_nodes_fromfile_>:
push   %rbx
mov    %rsi,%rbx
call   1040 <fortchartoc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <gmvwrite_nodes_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_nodes_fromfile_(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @fortchartoc(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @gmvwrite_nodes_fromfile(i32 %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_nodes_fromfile_(i8* %0, i64 %1) {
%3 = tail call i32 @fortchartoc(i8* %0)
%4 = tail call i32 @gmvwrite_nodes_fromfile(i32 %3, i64 %1)
ret void
}
/* Variables and functions */
float dcn_bw_floor2(const float arg, const float significance) {
  if (significance == 0)
    return 0;
  return ((int)(arg / significance)) * significance;
}


x86 assembly (clang, -O0):
<dcn_bw_floor2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1132 <dcn_bw_floor2+0x32>
jp     1132 <dcn_bw_floor2+0x32>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114e <dcn_bw_floor2+0x4e>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcn_bw_floor2>:
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    110e <dcn_bw_floor2+0xe>
jp     110e <dcn_bw_floor2+0xe>
ret
divss  %xmm1,%xmm2
cvttps2dq %xmm2,%xmm0
cvtdq2ps %xmm0,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dcn_bw_floor2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store float 0.000000e+00, float* %3
br label %17
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = fdiv float %10, %11
%13 = fptosi float %12 to i32
%14 = sitofp i32 %13 to float
%15 = load float, float* %5
%16 = fmul float %14, %15
store float %16, float* %3
br label %17
17: ; preds = %9, %8
%18 = load float, float* %3
ret float %18
}

LLVM IR (-O2):
define float @dcn_bw_floor2(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fdiv float %0, %1
%6 = fptosi float %5 to i32
%7 = sitofp i32 %6 to float
%8 = fmul float %7, %1
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ 0.000000e+00, %2 ]
ret float %10
}
long long gdt_create_descriptor_entry(long base, long limit, short flags) {
  long long descriptor;
  descriptor = limit & 0x000F0000;
  descriptor |= (flags << 8) & 0x00F0FF00;
  descriptor |= (base >> 16) & 0x000000FF;
  descriptor |= base & 0xFF000000;
  descriptor <<= 32;
  descriptor |= base << 16;
  descriptor |= limit & 0x0000FFFF;
  return descriptor;
}


x86 assembly (clang, -O0):
<gdt_create_descriptor_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
and    $0xf0000,%rax
mov    %rax,-0x20(%rbp)
movswl -0x12(%rbp),%eax
shl    $0x8,%eax
and    $0xf0ff00,%eax
cltq
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
movabs $0xff000000,%rax
and    -0x8(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_create_descriptor_entry>:
movzwl %si,%eax
mov    %esi,%ecx
and    $0xf0000,%ecx
shl    $0x8,%edx
and    $0xf0ff00,%edx
mov    %edi,%esi
shr    $0x10,%esi
movzbl %sil,%r8d
mov    %edi,%esi
and    $0xff000000,%esi
or     %ecx,%esi
or     %r8d,%esi
or     %edx,%esi
shl    $0x20,%rsi
shl    $0x10,%rdi
or     %rdi,%rax
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @gdt_create_descriptor_entry(i64 %0, i64 %1, i16 signext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i16 %2, i16* %6
%8 = load i64, i64* %5
%9 = and i64 %8, 983040
store i64 %9, i64* %7
%10 = load i16, i16* %6
%11 = sext i16 %10 to i32
%12 = shl i32 %11, 8
%13 = and i32 %12, 15793920
%14 = sext i32 %13 to i64
%15 = load i64, i64* %7
%16 = or i64 %15, %14
store i64 %16, i64* %7
%17 = load i64, i64* %4
%18 = ashr i64 %17, 16
%19 = and i64 %18, 255
%20 = load i64, i64* %7
%21 = or i64 %20, %19
store i64 %21, i64* %7
%22 = load i64, i64* %4
%23 = and i64 %22, 4278190080
%24 = load i64, i64* %7
%25 = or i64 %24, %23
store i64 %25, i64* %7
%26 = load i64, i64* %7
%27 = shl i64 %26, 32
store i64 %27, i64* %7
%28 = load i64, i64* %4
%29 = shl i64 %28, 16
%30 = load i64, i64* %7
%31 = or i64 %30, %29
store i64 %31, i64* %7
%32 = load i64, i64* %5
%33 = and i64 %32, 65535
%34 = load i64, i64* %7
%35 = or i64 %34, %33
store i64 %35, i64* %7
%36 = load i64, i64* %7
ret i64 %36
}

LLVM IR (-O2):
define i64 @gdt_create_descriptor_entry(i64 %0, i64 %1, i16 signext %2) {
%4 = and i64 %1, 983040
%5 = sext i16 %2 to i64
%6 = shl nsw i64 %5, 8
%7 = and i64 %6, 15793920
%8 = lshr i64 %0, 16
%9 = and i64 %8, 255
%10 = and i64 %0, 4278190080
%11 = or i64 %4, %10
%12 = or i64 %11, %9
%13 = or i64 %12, %7
%14 = shl nuw i64 %13, 32
%15 = shl i64 %0, 16
%16 = and i64 %1, 65535
%17 = or i64 %16, %15
%18 = or i64 %17, %14
ret i64 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t _le_64(int64_t l) {
  int64_t ret = l;
  unsigned char *ucptr = (unsigned char *)&ret;
  return (*(int64_t *)ucptr);
}


x86 assembly (clang, -O0):
<_le_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_le_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = bitcast i32* %3 to i8*
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_le_64(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void show_tab(int *tab, int size) {
  int i;
  i = 0;
  for (i = 0; i < size; ++i)
    printf("%d\n", tab[i]);
}


x86 assembly (clang, -O0):
<show_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <show_tab+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <show_tab+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_tab>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <show_tab+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <show_tab+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @show_tab(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ private_log_init();
void logInit() { private_log_init(); }


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

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

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

LLVM IR (-O2):
define void @logInit() {
%1 = tail call i32 (...) @private_log_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(void) {
  printf("strlen(NULL) = %d\n", strlen(""));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"strlen(NULL) = %d\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"strlen(NULL) = %d\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[6];
  int *p;
  printf("%d", sizeof(arr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 24)
ret i32 0
}
/* Variables and functions */
int mfspr(int);
int /*<<< orphan*/ mtspr(int, int);
void gdb_flush_cache(void) { mtspr((17), mfspr((17)) | (1 << 17) | (1 << 18)); }


x86 assembly (clang, -O0):
<gdb_flush_cache>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %eax,%esi
or     $0x20000,%esi
or     $0x40000,%esi
mov    $0x11,%edi
call   1040 <mtspr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_flush_cache>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
or     $0x60000,%eax
mov    $0x11,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @gdb_flush_cache() {
%1 = call i32 @mfspr(i32 17)
%2 = or i32 %1, 131072
%3 = or i32 %2, 262144
%4 = call i32 @mtspr(i32 17, i32 %3)
ret void
}

LLVM IR (-O2):
define void @gdb_flush_cache() {
%1 = tail call i32 @mfspr(i32 17)
%2 = or i32 %1, 393216
%3 = tail call i32 @mtspr(i32 17, i32 %2)
ret void
}
int add_nums(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<add_nums>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_nums>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_nums(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_nums(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct theft_mt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct theft_mt *);
void theft_mt_free(struct theft_mt *mt) { free(mt); }


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

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

LLVM IR (-O0):
%struct.theft_mt = type { i32 }
define void @theft_mt_free(%struct.theft_mt* %0) {
%2 = alloca %struct.theft_mt*
store %struct.theft_mt* %0, %struct.theft_mt** %2
%3 = load %struct.theft_mt*, %struct.theft_mt** %2
%4 = call i32 @free(%struct.theft_mt* %3)
ret void
}

LLVM IR (-O2):
%struct.theft_mt = type { i32 }
define void @theft_mt_free(%struct.theft_mt* nocapture %0) {
%2 = tail call i32 @free(%struct.theft_mt* %0)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t buff2long(const char *buff) {
  unsigned char *p;
  p = (unsigned char *)buff;
  return (((int64_t)(*p)) << 56) | (((int64_t)(*(p + 1))) << 48) |
         (((int64_t)(*(p + 2))) << 40) | (((int64_t)(*(p + 3))) << 32) |
         (((int64_t)(*(p + 4))) << 24) | (((int64_t)(*(p + 5))) << 16) |
         (((int64_t)(*(p + 6))) << 8) | ((int64_t)(*(p + 7)));
}


x86 assembly (clang, -O0):
<buff2long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @buff2long(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 56
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 48
%14 = or i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 40
%20 = or i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 32
%26 = or i32 %20, %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 24
%32 = or i32 %26, %31
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 5
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = shl i32 %36, 16
%38 = or i32 %32, %37
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i64 6
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = shl i32 %42, 8
%44 = or i32 %38, %43
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i64 7
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = or i32 %44, %48
ret i32 %49
}

LLVM IR (-O2):
define i32 @buff2long(i8* nocapture readnone %0) {
ret i32 poison
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
char *strerror(int);
char *soap_strerror(struct soap *soap, int soaperror) {
  return strerror(soaperror);
}


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

x86 assembly (clang, -O2):
<soap_strerror>:
mov    %esi,%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
%struct.soap = type { i32 }
define i8* @soap_strerror(%struct.soap* %0, i32 %1) {
%3 = alloca %struct.soap*
%4 = alloca i32
store %struct.soap* %0, %struct.soap** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i8* @strerror(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.soap = type { i32 }
define i8* @soap_strerror(%struct.soap* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %1)
ret i8* %3
}
/* Variables and functions */
double pow(int, double);
double sqrt(double);
double CE_Activity(double Uionsterkte) {
  return pow(
      10, (-1.0 * (0.5 * sqrt(Uionsterkte) / (sqrt(1.0E3) + sqrt(Uionsterkte)) -
                   0.00015 * Uionsterkte)));
}


x86 assembly (clang, -O0):
<CE_Activity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebd(%rip),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe7f(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe67(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CE_Activity>:
sub    $0x28,%rsp
sqrtsd %xmm0,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movapd %xmm2,%xmm1
movapd %xmm0,0x10(%rsp)
jae    1161 <CE_Activity+0x41>
movapd 0x10(%rsp),%xmm0
movsd  %xmm2,0x8(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm1
movapd 0x10(%rsp),%xmm0
mulsd  0xe97(%rip),%xmm1
ucomisd %xmm3,%xmm0
jae    1190 <CE_Activity+0x70>
movapd 0x10(%rsp),%xmm0
movsd  %xmm1,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
movapd 0x10(%rsp),%xmm0
addsd  0xe70(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  0xe6c(%rip),%xmm0
addsd  %xmm1,%xmm0
xorpd  0xe70(%rip),%xmm0
mov    $0xa,%edi
add    $0x28,%rsp
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @CE_Activity(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
%5 = fmul double 5.000000e-01, %4
%6 = call double @sqrt(double 1.000000e+03)
%7 = load double, double* %2
%8 = call double @sqrt(double %7)
%9 = fadd double %6, %8
%10 = fdiv double %5, %9
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double -1.500000e-04, double %11, double %10)
%13 = fmul double -1.000000e+00, %12
%14 = call double @pow(i32 10, double %13)
ret double %14
}

LLVM IR (-O2):
define double @CE_Activity(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = fmul double %2, 5.000000e-01
%4 = tail call double @sqrt(double %0)
%5 = fadd double %4, 0x403F9F6E4990F227
%6 = fdiv double %3, %5
%7 = tail call double @llvm.fmuladd.f64(double %0, double -1.500000e-04, double %6)
%8 = fneg double %7
%9 = tail call double @pow(i32 10, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ call_method2();
double my_sin(int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  call_method2();
  printf("res %f\n", my_sin(360));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <call_method2@plt>
mov    $0x168,%edi
call   1040 <my_sin@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <call_method2@plt>
mov    $0x168,%edi
call   1040 <my_sin@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"res %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @call_method2()
%3 = call double @my_sin(i32 360)
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"res %f\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @call_method2()
%2 = tail call double @my_sin(i32 360)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
/* Variables and functions */
int rand();
int randInt(int max) { return rand() % max + 1; }


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

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

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

LLVM IR (-O2):
define i32 @randInt(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GL_NEAREST;
int /*<<< orphan*/ GL_REPLACE;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_ENV;
int /*<<< orphan*/ GL_TEXTURE_ENV_MODE;
int /*<<< orphan*/ GL_TEXTURE_MAG_FILTER;
int /*<<< orphan*/ GL_TEXTURE_MIN_FILTER;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glTexEnvi(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void Init(void) {
  printf("Sorry, 3DFX_set_global_palette not supported\n");
  exit(0);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  glEnable(GL_TEXTURE_2D);
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Sorry, 3DFX_set_global_palette not supported\0A\00"
@GL_NEAREST = global i32 0
@GL_REPLACE = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
define void @Init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@GL_NEAREST = global i32 0
@GL_REPLACE = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@str = [45 x i8] c"Sorry, 3DFX_set_global_palette not supported\00"
define void @Init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void emit_backreference(struct processor_explicatory_state *process_state,
                        struct modern_stream *stream, void *stream_state,
                        struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_backreference>:
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)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_backreference(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_backreference(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void bar(void) { puts("bar in u2"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"bar in u2\00"
define void @bar() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"bar in u2\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x90() {
  Assert_real((iscntrl(144) == 0),
              "/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_iscntrl.c",
              725, ("iscntrl should be 0 for 0x90"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x90>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d5,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x90>:
push   %rax
mov    $0x90,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d5,%edx
pop    %rax
jmp    1040 <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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x90\00"
define void @t_iscntrl_0x90() {
%1 = call i64 @iscntrl(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([29 x i8], [29 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x90\00"
define void @t_iscntrl_0x90() {
%1 = tail call i64 @iscntrl(i32 144)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 725, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xa7() {
  Assert_real((isdigit(167) == 0),
              "/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_isdigit.c",
              840, ("isdigit should be 0 for 0xa7"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xa7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa7,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x348,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xa7>:
push   %rax
mov    $0xa7,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x348,%edx
pop    %rax
jmp    1040 <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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa7\00"
define void @t_isdigit_0xa7() {
%1 = call i64 @isdigit(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa7\00"
define void @t_isdigit_0xa7() {
%1 = tail call i64 @isdigit(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
scalar_t__ strlen(char const *);
char *quickcat(const char *str1, const char *str2) {
  char *str;
  str = (char *)malloc(strlen(str1) + strlen(str2) + 1);
  sprintf(str, "%s%s", str1, str2);
  return str;
}


x86 assembly (clang, -O0):
<quickcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @quickcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @quickcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
int not_valid_node_name(const struct dsc$descriptor_s *nodename) { return 0; }


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

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

LLVM IR (-O0):
%"struct.dsc$descriptor_s" = type opaque
define i32 @not_valid_node_name(%"struct.dsc$descriptor_s"* %0) {
%2 = alloca %"struct.dsc$descriptor_s"*
store %"struct.dsc$descriptor_s"* %0, %"struct.dsc$descriptor_s"** %2
ret i32 0
}

LLVM IR (-O2):
%"struct.dsc$descriptor_s" = type opaque
define i32 @not_valid_node_name(%"struct.dsc$descriptor_s"* nocapture readnone %0) {
ret i32 0
}