xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ closeTCPsocket();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void error(const char *msg) {
  perror(msg);
  closeTCPsocket();
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <closeTCPsocket@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <perror@plt>
xor    %eax,%eax
call   1030 <closeTCPsocket@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 (...) @closeTCPsocket()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 (...) @closeTCPsocket()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void WoodDensity(double mass, double volume) {
  if (volume > 0 && mass > 0) {
    printf("Objetosc wynosi: %lf g/cm^3\n\n", mass / volume);
  } else {
    printf("Zle wartosci! \n\n");
  }
}


x86 assembly (clang, -O0):
<WoodDensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1163 <WoodDensity+0x53>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1163 <WoodDensity+0x53>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1171 <WoodDensity+0x61>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WoodDensity>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jbe    1142 <WoodDensity+0x22>
ucomisd %xmm2,%xmm1
jbe    1142 <WoodDensity+0x22>
divsd  %xmm1,%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
jmp    1040 <printf@plt>
lea    0xed5(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Objetosc wynosi: %lf g/cm^3\0A\0A\00"
@.str.1 = [17 x i8] c"Zle wartosci! \0A\0A\00"
define void @WoodDensity(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fdiv double %11, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %13)
br label %17
15: ; preds = %7, %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Objetosc wynosi: %lf g/cm^3\0A\0A\00"
@str = [16 x i8] c"Zle wartosci! \0A\00"
define void @WoodDensity(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
%4 = fcmp ogt double %0, 0.000000e+00
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = fdiv double %0, %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %7)
br label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x, n;
  x = 1;
  for (n = 1; n <= 10; n++) {
    x = x * n;
  }
  printf("%d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     114f <main+0x3f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int simple(int /*<<< orphan*/, int);
int main() { printf("1 + 2 + ... + 10 = %d\n", simple(0, 10)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xa,%esi
call   1040 <simple@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"1 + 2 + ... + 10 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @simple(i32 0, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unmap_domain_page(void *);
void hap_unmap_domain_page(void *p) { unmap_domain_page(p); }


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

x86 assembly (clang, -O2):
<hap_unmap_domain_page>:
jmp    1030 <unmap_domain_page@plt>

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

LLVM IR (-O2):
define void @hap_unmap_domain_page(i8* %0) {
%2 = tail call i32 @unmap_domain_page(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opt_number(void *);
int /*<<< orphan*/ optlongname_n(int /*<<< orphan*/, char *);
void optlongname(void *v, char *longname) {
  optlongname_n(opt_number(v), longname);
}


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

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

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

LLVM IR (-O2):
define void @optlongname(i8* %0, i8* %1) {
%3 = tail call i32 @opt_number(i8* %0)
%4 = tail call i32 @optlongname_n(i32 %3, i8* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ nchars;
};
typedef TYPE_1__ XTextItem;

/* Variables and functions */
int get_XTextItem_nchars(void *_p) { return (int)((XTextItem *)_p)->nchars; }


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

x86 assembly (clang, -O2):
<get_XTextItem_nchars>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XTextItem_nchars(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XTextItem_nchars(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int checkForError(char *error) {
  if (error != NULL) {
    printf("ERROR: %s\n", error);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkForError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1143 <checkForError+0x33>
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    114a <checkForError+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForError>:
test   %rdi,%rdi
je     112f <checkForError+0x1f>
push   %rax
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define i32 @checkForError(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %6
}
int test_imm_1Dint8_mem(signed char *val) {
  return ((*val) & (-0x1D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Dint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -29
%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_1Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -29
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char const *spx_php_global_array_get(char *, char const *);
const char *source_handler_http_query_string(const char *parameter) {
  return spx_php_global_array_get("_GET", parameter);
}


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

x86 assembly (clang, -O2):
<source_handler_http_query_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <spx_php_global_array_get@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_GET\00"
define i8* @source_handler_http_query_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @spx_php_global_array_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"_GET\00"
define i8* @source_handler_http_query_string(i8* %0) {
%2 = tail call i8* @spx_php_global_array_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
float max(float, float);
float min(float, float);
float positiveWeight(float h1, float h2) { return min(h1, h2) / max(h1, h2); }


x86 assembly (clang, -O0):
<positiveWeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <max@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<positiveWeight>:
sub    $0x18,%rsp
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
call   1030 <min@plt>
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   1040 <max@plt>
movss  0x14(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @positiveWeight(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @min(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call float @max(float %8, float %9)
%11 = fdiv float %7, %10
ret float %11
}

LLVM IR (-O2):
define float @positiveWeight(float %0, float %1) {
%3 = tail call float @min(float %0, float %1)
%4 = tail call float @max(float %0, float %1)
%5 = fdiv float %3, %4
ret float %5
}
/* Variables and functions */
char *intToRoman(int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  printf("%s\n", intToRoman(1));
  printf("%s\n", intToRoman(234));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rsi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xea,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1030 <intToRoman@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0xea,%edi
call   1030 <intToRoman@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @intToRoman(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @intToRoman(i32 234)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void vfs_dq_init(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @vfs_dq_init(%struct.inode* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M226_f(char *s) {
  debug("M226_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M226_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M226_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M226_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M226_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M226_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M226_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ addToList(int);
int /*<<< orphan*/ detectCycle();
int /*<<< orphan*/ makeCycle(int);
int /*<<< orphan*/ printList();
int main() {
  for (int i = 0; i < 10; i++) {
    addToList(i + 100);
  }
  printList();
  detectCycle();
  makeCycle(4);
  detectCycle();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1179 <main+0x39>
mov    -0x8(%rbp),%edi
add    $0x64,%edi
call   1030 <addToList@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x16>
mov    $0x0,%al
call   1060 <printList@plt>
mov    $0x0,%al
call   1050 <detectCycle@plt>
mov    $0x4,%edi
call   1040 <makeCycle@plt>
mov    $0x0,%al
call   1050 <detectCycle@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <addToList@plt>
mov    $0x65,%edi
call   1030 <addToList@plt>
mov    $0x66,%edi
call   1030 <addToList@plt>
mov    $0x67,%edi
call   1030 <addToList@plt>
mov    $0x68,%edi
call   1030 <addToList@plt>
mov    $0x69,%edi
call   1030 <addToList@plt>
mov    $0x6a,%edi
call   1030 <addToList@plt>
mov    $0x6b,%edi
call   1030 <addToList@plt>
mov    $0x6c,%edi
call   1030 <addToList@plt>
mov    $0x6d,%edi
call   1030 <addToList@plt>
xor    %eax,%eax
call   1060 <printList@plt>
xor    %eax,%eax
call   1050 <detectCycle@plt>
mov    $0x4,%edi
call   1040 <makeCycle@plt>
xor    %eax,%eax
call   1050 <detectCycle@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 100
%9 = call i32 @addToList(i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = call i32 (...) @printList()
%15 = call i32 (...) @detectCycle()
%16 = call i32 @makeCycle(i32 4)
%17 = call i32 (...) @detectCycle()
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @addToList(i32 100)
%2 = tail call i32 @addToList(i32 101)
%3 = tail call i32 @addToList(i32 102)
%4 = tail call i32 @addToList(i32 103)
%5 = tail call i32 @addToList(i32 104)
%6 = tail call i32 @addToList(i32 105)
%7 = tail call i32 @addToList(i32 106)
%8 = tail call i32 @addToList(i32 107)
%9 = tail call i32 @addToList(i32 108)
%10 = tail call i32 @addToList(i32 109)
%11 = tail call i32 (...) @printList()
%12 = tail call i32 (...) @detectCycle()
%13 = tail call i32 @makeCycle(i32 4)
%14 = tail call i32 (...) @detectCycle()
ret i32 0
}
int imin(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, long);
void dup_uivector(uint *src, long nl, long nh, uint *dst) {
  long len = nh - nl + 1;
  static long size = sizeof(uint);
  memcpy(dst + nl, src + nl, len * size);
}


x86 assembly (clang, -O0):
<dup_uivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
imul   0x2ec6(%rip),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_uivector>:
sub    %rsi,%rdx
lea    (%rcx,%rsi,4),%rax
lea    (%rdi,%rsi,4),%rsi
lea    0x4(,%rdx,4),%rdx
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@dup_uivector.size = internal global i64 4
define void @dup_uivector(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = sub nsw i64 %10, %11
%13 = add nsw i64 %12, 1
store i64 %13, i64* %9
%14 = load i32*, i32** %8
%15 = load i64, i64* %6
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32*, i32** %5
%18 = load i64, i64* %6
%19 = getelementptr inbounds i32, i32* %17, i64 %18
%20 = load i64, i64* %9
%21 = load i64, i64* @dup_uivector.size
%22 = mul nsw i64 %20, %21
%23 = call i32 @memcpy(i32* %16, i32* %19, i64 %22)
ret void
}

LLVM IR (-O2):
define void @dup_uivector(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = sub nsw i64 %2, %1
%6 = getelementptr inbounds i32, i32* %3, i64 %1
%7 = getelementptr inbounds i32, i32* %0, i64 %1
%8 = shl i64 %5, 2
%9 = add i64 %8, 4
%10 = tail call i32 @memcpy(i32* %6, i32* %7, i64 %9)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ S_IROTH;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fchmod(int, int /*<<< orphan*/);
int open(char *, int);
int /*<<< orphan*/ write(int, int *, int);
void write_port_file(int *_port) {
  int file_h = open("/var/tmp/xonaru1d.port", O_WRONLY | O_CREAT);
  write(file_h, _port, sizeof(int));
  fchmod(file_h, S_IROTH);
  close(file_h);
}


x86 assembly (clang, -O0):
<write_port_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
or     (%rax),%esi
lea    0xe9b(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
mov    0x2e50(%rip),%rax
mov    (%rax),%esi
call   1050 <fchmod@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_port_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e7b(%rip),%rax
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xea1(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1050 <fchmod@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/var/tmp/xonaru1d.port\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@S_IROTH = global i32 0
define void @write_port_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = call i32 @open(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @write(i32 %8, i32* %9, i32 4)
%11 = load i32, i32* %3
%12 = load i32, i32* @S_IROTH
%13 = call i32 @fchmod(i32 %11, i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/var/tmp/xonaru1d.port\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@S_IROTH = global i32 0
define void @write_port_file(i32* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @write(i32 %5, i32* %0, i32 4)
%7 = load i32, i32* @S_IROTH
%8 = tail call i32 @fchmod(i32 %5, i32 %7)
%9 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_f4();
int /*<<< orphan*/ take_struct_f4(int /*<<< orphan*/);
void test_struct_f4() { take_struct_f4(return_struct_f4()); }


x86 assembly (clang, -O0):
<test_struct_f4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_f4@plt>
mov    %eax,%edi
call   1040 <take_struct_f4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_f4>:
push   %rax
xor    %eax,%eax
call   1030 <return_struct_f4@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_struct_f4@plt>

LLVM IR (-O0):
define void @test_struct_f4() {
%1 = call i32 (...) @return_struct_f4()
%2 = call i32 @take_struct_f4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_f4() {
%1 = tail call i32 (...) @return_struct_f4()
%2 = tail call i32 @take_struct_f4(i32 %1)
ret void
}
int sys_eventfd2(unsigned int initval, int flags) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sys_eventfd2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sys_eventfd2(i32 %0, i32 %1) {
ret i32 0
}
char or_gate(char a, char b) {
  if (a == '0' && b == '0') {
    return '0';
  } else {
    return '1';
  }
}


x86 assembly (clang, -O0):
<or_gate>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jne    1133 <or_gate+0x33>
movsbl -0x3(%rbp),%eax
cmp    $0x30,%eax
jne    1133 <or_gate+0x33>
movb   $0x30,-0x1(%rbp)
jmp    1137 <or_gate+0x37>
movb   $0x31,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_gate>:
xor    $0x30,%dil
xor    $0x30,%sil
or     %dil,%sil
sete   %al
xor    $0x31,%al
ret

LLVM IR (-O0):
define signext i8 @or_gate(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 48, i8* %3
br label %15
14: ; preds = %9, %2
store i8 49, i8* %3
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @or_gate(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 48
%4 = icmp eq i8 %1, 48
%5 = and i1 %3, %4
%6 = select i1 %5, i8 48, i8 49
ret i8 %6
}
void UARTClockSourceSet(unsigned long ulBase, unsigned long ulSource) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000FC8))) = ulSource;
}


x86 assembly (clang, -O0):
<UARTClockSourceSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xfc8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTClockSourceSet>:
mov    %rsi,0xfc8(%rdi)
ret

LLVM IR (-O0):
define void @UARTClockSourceSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTClockSourceSet(i64 %0, i64 %1) {
%3 = add i64 %0, 4040
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperDisable(void) {
  (*((volatile unsigned long *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC400))) &= ~0x00000001;
  _HibernateWriteComplete();
  (*((volatile unsigned long *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc360,%eax
mov    $0xa3359554,%ecx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc400,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x400fc400,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperDisable>:
push   %rax
mov    $0xa3359554,%eax
mov    %rax,0x400fc360
40
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
andq   $0xfffffffffffffffe,0x400fc400
40 fe
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movq   $0x0,0x400fc360
xor    %eax,%eax
pop    %rcx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperDisable() {
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%1 = call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i64, i64* inttoptr (i64 1074775040 to i64*)
%3 = and i64 %2, -2
store volatile i64 %3, i64* inttoptr (i64 1074775040 to i64*)
%4 = call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%5 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperDisable() {
store volatile i64 2738197844, i64* inttoptr (i64 1074774880 to i64*)
%1 = tail call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i64, i64* inttoptr (i64 1074775040 to i64*)
%3 = and i64 %2, -2
store volatile i64 %3, i64* inttoptr (i64 1074775040 to i64*)
%4 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i64 0, i64* inttoptr (i64 1074774880 to i64*)
%5 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sub_a_n();
void opcode_d6() { sub_a_n(); }


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

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

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

LLVM IR (-O2):
define void @opcode_d6() {
%1 = tail call i32 (...) @sub_a_n()
ret void
}
int cairo_code_draw_lushGraphXBound_get_height() { return 21; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushGraphXBound_get_height() {
ret i32 21
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushGraphXBound_get_height() {
ret i32 21
}
void ft_ultimate_div_mod(int *a, int *b) {
  int temp;
  if (b != 0) {
    temp = *a;
    *a = *a / *b;
    *b = temp % *b;
  }
}


x86 assembly (clang, -O0):
<ft_ultimate_div_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <ft_ultimate_div_mod+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ultimate_div_mod>:
test   %rsi,%rsi
je     1115 <ft_ultimate_div_mod+0x15>
mov    (%rdi),%ecx
mov    %ecx,%eax
cltd
idivl  (%rsi)
mov    %eax,(%rdi)
mov    %ecx,%eax
cltd
idivl  (%rsi)
mov    %edx,(%rsi)
ret

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

LLVM IR (-O2):
define void @ft_ultimate_div_mod(i32* nocapture %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = sdiv i32 %5, %6
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = srem i32 %5, %8
store i32 %9, i32* %1
br label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fail(const char *why) {
  fprintf(stderr, "ERROR: %s\n", why);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  static int a = 3;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2f0f(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.a = internal global i32 3
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @main.a
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
int save(char const *recp __attribute__((unused)),
         int reclen __attribute__((unused)), char *buf __attribute__((unused)),
         int bufsize __attribute__((unused)),
         char const *udata __attribute__((unused)),
         int uleng __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<save>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @save(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @save(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i32 %5) {
ret i32 0
}
void enumerate_ht_chain(void) {}


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

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

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

LLVM IR (-O2):
define void @enumerate_ht_chain() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void usage(char *pname) {
  printf("\n\n"
         "usage: %s [-x xtnum] <list of FITS files>\n"
         "usage: %s [-x xtnum] -\n"
         "\n"
         "The former version expects file names.\n"
         "The latter expects data coming in from stdin.\n"
         "\n"
         "-x xtnum specifies the extension header to print\n"
         "-x 0     specifies main header + all extensions\n"
         "\n\n",
         pname, pname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [254 x i8] c"\0A\0Ausage: %s [-x xtnum] <list of FITS files>\0Ausage: %s [-x xtnum] -\0A\0AThe former version expects file names.\0AThe latter expects data coming in from stdin.\0A\0A-x xtnum specifies the extension header to print\0A-x 0 specifies main header + all extensions\0A\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [254 x i8] c"\0A\0Ausage: %s [-x xtnum] <list of FITS files>\0Ausage: %s [-x xtnum] -\0A\0AThe former version expects file names.\0AThe latter expects data coming in from stdin.\0A\0A-x xtnum specifies the extension header to print\0A-x 0 specifies main header + all extensions\0A\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
char *OC_mkDotStr(char *, char *);
char *OC_mkVarDec(char *, char *);
int /*<<< orphan*/ free(char *);
char *OC_mkKindVarDec(char *kindVarName) {
  char *kindType = OC_mkDotStr("Absyn", "akind");
  char *dec = OC_mkVarDec(kindVarName, kindType);
  free(kindType);
  return dec;
}


x86 assembly (clang, -O0):
<OC_mkKindVarDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <OC_mkDotStr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <OC_mkVarDec@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkKindVarDec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <OC_mkDotStr@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <OC_mkVarDec@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [6 x i8] c"akind\00"
define i8* @OC_mkKindVarDec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i8* @OC_mkVarDec(i8* %6, i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [6 x i8] c"akind\00"
define i8* @OC_mkKindVarDec(i8* %0) {
%2 = tail call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @OC_mkVarDec(i8* %0, i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}
int sockopt_reuseport(int sock) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sockopt_reuseport(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ critical_enter();
void __critical_enter(void *data) { critical_enter(); }


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

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

LLVM IR (-O0):
define void @__critical_enter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @critical_enter()
ret void
}

LLVM IR (-O2):
define void @__critical_enter(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @critical_enter()
ret void
}
void zerotapeinfo(void) {}


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

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

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

LLVM IR (-O2):
define void @zerotapeinfo() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_y(void *_p, int _v) {
  ((XEvent *)_p)->xcrossing.y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcrossing_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcrossing_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
char *my_alloc2(int, int);
int test4(int len) {
  int i;
  char *p = my_alloc2(16, len);
  return ((long int)p) & 15;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x10,%edi
call   1030 <my_alloc2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xf,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
mov    %edi,%esi
mov    $0x10,%edi
call   1030 <my_alloc2@plt>
and    $0xf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @my_alloc2(i32 16, i32 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = and i64 %8, 15
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = tail call i8* @my_alloc2(i32 16, i32 %0)
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 15
ret i32 %5
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_get_vt(const char *session, unsigned *vtnr) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_session_get_vt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_session_get_vt>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_get_vt(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_get_vt(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}