xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *p = malloc(nmemb * size);
  if (p)
    memset(p, 0, nmemb * size);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <calloc+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(size_t const);
void *rws_malloc(const size_t size) {
  if (size > 0) {
    void *mem = malloc(size);
    assert(mem);
    return mem;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<rws_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    115a <rws_malloc+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <rws_malloc+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rws_malloc>:
push   %rbx
test   %rdi,%rdi
je     1138 <rws_malloc+0x18>
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
jmp    113a <rws_malloc+0x1a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @rws_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = tail call i32 @assert(i8* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ glTexParameterf(unsigned int, unsigned int, float);
void TexParameterf(unsigned int t, unsigned int p, float prm) {
  glTexParameterf(t, p, prm);
}


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

x86 assembly (clang, -O2):
<TexParameterf>:
jmp    1030 <glTexParameterf@plt>

LLVM IR (-O0):
define void @TexParameterf(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load float, float* %6
%10 = call i32 @glTexParameterf(i32 %7, i32 %8, float %9)
ret void
}

LLVM IR (-O2):
define void @TexParameterf(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @glTexParameterf(i32 %0, i32 %1, float %2)
ret void
}
void testClosureFFFrV(void (*closure)(float, float, float), float a1, float a2,
                      float a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureFFFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFFFrV>:
jmp    *%rdi

LLVM IR (-O0):
define void @testClosureFFFrV(void (float, float, float)* %0, float %1, float %2, float %3) {
%5 = alloca void (float, float, float)*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store void (float, float, float)* %0, void (float, float, float)** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load void (float, float, float)*, void (float, float, float)** %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
ret void
}

LLVM IR (-O2):
define void @testClosureFFFrV(void (float, float, float)* nocapture %0, float %1, float %2, float %3) {
tail call void %0(float %1, float %2, float %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  assume(x < 0);
  while (x < 10) {
    x = x + 1;
  }
  assert(x == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0xa,-0x8(%rbp)
jge    1158 <main+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
adrreg0adr1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= (*((double *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
mov    $0xa98ac7,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <adrreg0adr1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <adrreg0adr1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adr1>:
movsd  0xa98ac7,%xmm0
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm0
04
setae  %al
ret

LLVM IR (-O0):
define i32 @adrreg0adr1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = getelementptr inbounds double, double* %14, i64 10000000
%16 = load double, double* %15
%17 = load double, double* inttoptr (i64 11111111 to double*)
%18 = fcmp ole double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrreg0adr1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = load double, double* inttoptr (i64 11111111 to double*)
%10 = fcmp ole double %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_stop(void) { op_write1(0x10); }


x86 assembly (clang, -O0):
<op_enc_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_stop>:
mov    $0x10,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_stop() {
%1 = call i32 @op_write1(i32 16)
ret void
}

LLVM IR (-O2):
define void @op_enc_stop() {
%1 = tail call i32 @op_write1(i32 16)
ret void
}
/* Variables and functions */
int av_sat_add32_c(int, int);
int av_sat_dadd32_c(int a, int b) {
  return av_sat_add32_c(a, av_sat_add32_c(b, b));
}


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

x86 assembly (clang, -O2):
<av_sat_dadd32_c>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <av_sat_add32_c@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <av_sat_add32_c@plt>

LLVM IR (-O0):
define i32 @av_sat_dadd32_c(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 = load i32, i32* %4
%8 = call i32 @av_sat_add32_c(i32 %6, i32 %7)
%9 = call i32 @av_sat_add32_c(i32 %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @av_sat_dadd32_c(i32 %0, i32 %1) {
%3 = tail call i32 @av_sat_add32_c(i32 %1, i32 %1)
%4 = tail call i32 @av_sat_add32_c(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: mkdir.minix <input file> <directory>\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"usage: mkdir.minix <input file> <directory>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [44 x i8] c"usage: mkdir.minix <input file> <directory>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int nofl_initialize();
int /*<<< orphan*/ nofl_shutdown();
int /*<<< orphan*/ nofl_sign_certificate(char *, char *, char *);
int main(int argc, char *argv[]) {
  int init_status;
  init_status = nofl_initialize();
  nofl_sign_certificate(argv[1], argv[2], argv[3]);
  nofl_shutdown();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nofl_initialize@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1050 <nofl_sign_certificate@plt>
mov    $0x0,%al
call   1040 <nofl_shutdown@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <nofl_initialize@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
mov    0x18(%rbx),%rdx
call   1050 <nofl_sign_certificate@plt>
xor    %eax,%eax
call   1040 <nofl_shutdown@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @nofl_initialize()
store i32 %6, i32* %5
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 3
%15 = load i8*, i8** %14
%16 = call i32 @nofl_sign_certificate(i8* %9, i8* %12, i8* %15)
%17 = call i32 (...) @nofl_shutdown()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @nofl_initialize()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 3
%9 = load i8*, i8** %8
%10 = tail call i32 @nofl_sign_certificate(i8* %5, i8* %7, i8* %9)
%11 = tail call i32 (...) @nofl_shutdown()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void utils_exit() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<utils_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<utils_exit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @utils_exit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
int __attribute__((no)) fast_mod7(int n) {
  n = (unsigned)n * 0x24924924 >> 29;
  return n & ((n - 7) >> 31);
}


x86 assembly (clang, -O0):
<fast_mod7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x24924924,-0x4(%rbp),%eax
shr    $0x1d,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x7,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_mod7>:
imul   $0x24924924,%edi,%ecx
shr    $0x1d,%ecx
xor    %eax,%eax
cmp    $0x7,%ecx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fast_mod7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 613566756
%5 = lshr i32 %4, 29
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 7
%9 = ashr i32 %8, 31
%10 = and i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @fast_mod7(i32 %0) {
%2 = mul i32 %0, 613566756
%3 = lshr i32 %2, 29
%4 = icmp eq i32 %3, 7
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
void ADC_SAR_Seq_SAR_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_SAR_Seq_SAR_SaveConfig() {
ret void
}
void CRYP_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @CRYP_IRQHandler() {
ret void
}
int min(int a, int b, int c) {
  int small;
  if (a <= b && a <= c)
    small = a;
  if (b <= a && b <= c)
    small = b;
  if (c <= a && c <= b)
    small = c;
  return small;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     112b <min+0x2b>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     112b <min+0x2b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1149 <min+0x49>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1149 <min+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1167 <min+0x67>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1167 <min+0x67>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
cmp    %edx,%esi
mov    %esi,%ecx
cmovg  %edi,%ecx
cmp    %edi,%esi
cmovg  %edi,%ecx
cmp    %esi,%edx
mov    %edx,%eax
cmovg  %ecx,%eax
cmp    %edi,%edx
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %1
%8 = icmp sgt i32 %2, %0
%9 = icmp sgt i32 %2, %1
%10 = or i1 %8, %9
%11 = select i1 %10, i32 %7, i32 %2
ret i32 %11
}
void ftrace_special(unsigned long arg1, unsigned long arg2,
                    unsigned long arg3) {}


x86 assembly (clang, -O0):
<ftrace_special>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ftrace_special(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @ftrace_special(i64 %0, i64 %1, i64 %2) {
ret void
}
void f16(a19_1) const struct file *a19_1;
{}


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @f16(%struct.file* nocapture %0) {
ret void
}
int base3() { return 5; }


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

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

LLVM IR (-O0):
define i32 @base3() {
ret i32 5
}

LLVM IR (-O2):
define i32 @base3() {
ret i32 5
}
unsigned int getCode(unsigned char *packet) {
  return (packet[7] << 12) | (packet[8] << 4) | (packet[9] >> 4);
}


x86 assembly (clang, -O0):
<getCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
shl    $0xc,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x8(%rcx),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x9(%rcx),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCode>:
movzbl 0x7(%rdi),%eax
shl    $0xc,%eax
movzbl 0x8(%rdi),%ecx
shl    $0x4,%ecx
or     %eax,%ecx
movzbl 0x9(%rdi),%eax
shr    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getCode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 12
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 4
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 9
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = ashr i32 %17, 4
%19 = or i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @getCode(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 12
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 4
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 9
%12 = load i8, i8* %11
%13 = lshr i8 %12, 4
%14 = zext i8 %13 to i32
%15 = or i32 %10, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ cpuid_level(int);
void dump_cpuid() {
  cpuid_level(0);
  cpuid_level(0x80000000);
}


x86 assembly (clang, -O0):
<dump_cpuid>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <cpuid_level@plt>
mov    $0x80000000,%edi
call   1030 <cpuid_level@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_cpuid>:
push   %rax
xor    %edi,%edi
call   1030 <cpuid_level@plt>
mov    $0x80000000,%edi
pop    %rax
jmp    1030 <cpuid_level@plt>

LLVM IR (-O0):
define void @dump_cpuid() {
%1 = call i32 @cpuid_level(i32 0)
%2 = call i32 @cpuid_level(i32 -2147483648)
ret void
}

LLVM IR (-O2):
define void @dump_cpuid() {
%1 = tail call i32 @cpuid_level(i32 0)
%2 = tail call i32 @cpuid_level(i32 -2147483648)
ret void
}
char *hash_plugin_detailed(void) {
  return (
      "md5md5 - A simple md5(md5(pass)) plugin\n"
      "------------------------\n"
      "Use this module to crack simple md5(md5(pass)) hashes\n"
      "Input should be in form: \'user:hash\' or just \'hash\'\n"
      "Known software that uses this password hashing method:\n"
      "e107 < 0.8, Koobi CMS > 6.0, AVE CMS, DataLife engine, Diferior, etc\n"
      "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [341 x i8] c"md5md5 - A simple md5(md5(pass)) plugin\0A------------------------\0AUse this module to crack simple md5(md5(pass)) hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0Ae107 < 0.8, Koobi CMS > 6.0, AVE CMS, DataLife engine, Diferior, etc\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([341 x i8], [341 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [341 x i8] c"md5md5 - A simple md5(md5(pass)) plugin\0A------------------------\0AUse this module to crack simple md5(md5(pass)) hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0Ae107 < 0.8, Koobi CMS > 6.0, AVE CMS, DataLife engine, Diferior, etc\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([341 x i8], [341 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *strchr(char *, int);
void first_char_pos(int *index, char *haystack, int needle) {
  char *match;
  match = strchr(haystack, needle);
  *index = (int)(match - haystack);
}


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

x86 assembly (clang, -O2):
<first_char_pos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <strchr@plt>
sub    %ebx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @first_char_pos(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @strchr(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @first_char_pos(i32* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %1, i32 %2)
%5 = ptrtoint i8* %4 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %0
ret void
}
IR0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*p0) <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     113c <IR0AX1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <IR0AX1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
mov    (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %8
%10 = load i32, i32* %9
%11 = icmp sle i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ done_macros();
void bt_cleanup(void) { done_macros(); }


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

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

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

LLVM IR (-O2):
define void @bt_cleanup() {
%1 = tail call i32 (...) @done_macros()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today, *datePtr;
  datePtr = &today;
  datePtr->month = 9;
  datePtr->day = 25;
  datePtr->year = 2004;
  printf("Today's date is %i/%i/%.2i\n", datePtr->month, datePtr->day,
         datePtr->year % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x19,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7d4,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x1c(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [28 x i8] c"Today's date is %i/%i/%.2i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
%3 = alloca %struct.date*
store i32 0, i32* %1
store %struct.date* %2, %struct.date** %3
%4 = load %struct.date*, %struct.date** %3
%5 = getelementptr inbounds %struct.date, %struct.date* %4, i32 0, i32 0
store i32 9, i32* %5
%6 = load %struct.date*, %struct.date** %3
%7 = getelementptr inbounds %struct.date, %struct.date* %6, i32 0, i32 1
store i32 25, i32* %7
%8 = load %struct.date*, %struct.date** %3
%9 = getelementptr inbounds %struct.date, %struct.date* %8, i32 0, i32 2
store i32 2004, i32* %9
%10 = load %struct.date*, %struct.date** %3
%11 = getelementptr inbounds %struct.date, %struct.date* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.date*, %struct.date** %3
%14 = getelementptr inbounds %struct.date, %struct.date* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.date*, %struct.date** %3
%17 = getelementptr inbounds %struct.date, %struct.date* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = srem i32 %18, 100
%20 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %19)
ret i32 0
}

LLVM IR (-O2):
%struct.date = type { i32, i32, i32 }
@.str = [28 x i8] c"Today's date is %i/%i/%.2i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 9, i32 25, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgsub(void) { gen("subq\t%rcx,%rax"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"subq\09%rcx,%rax\00"
define void @cgsub() {
%1 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"subq\09%rcx,%rax\00"
define void @cgsub() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand(int, int);
int main() {
  int n = rand(10, 1000);
  n = n;
  while (n > 1) {
    if (n % 2 == 0) {
      n /= 2;
    } else {
      n = 3 * n + 1;
    }
  }
  assert(n == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x3e8,%esi
call   1040 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1187 <main+0x67>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1178 <main+0x58>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1182 <main+0x62>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x3e8,%esi
call   1040 <rand@plt>
cmp    $0x2,%eax
jl     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ecx
shr    %ecx
test   $0x1,%al
lea    0x1(%rax,%rax,2),%eax
cmove  %ecx,%eax
cmp    $0x1,%eax
jg     1140 <main+0x20>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @rand(i32 10, i32 1000)
store i32 %3, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %2
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 2
store i32 %14, i32* %2
br label %19
15: ; preds = %8
%16 = load i32, i32* %2
%17 = mul nsw i32 3, %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %19
19: ; preds = %15, %12
br label %5
20: ; preds = %5
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rand(i32 10, i32 1000)
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %12
3: ; preds = %0, %3
%4 = phi i32 [ %10, %3 ], [ %1, %0 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = lshr i32 %4, 1
%8 = mul nsw i32 %4, 3
%9 = add nsw i32 %8, 1
%10 = select i1 %6, i32 %7, i32 %9
%11 = icmp sgt i32 %10, 1
br i1 %11, label %3, label %12
12: ; preds = %3, %0
%13 = phi i32 [ %1, %0 ], [ %10, %3 ]
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print(char *s) { fprintf(stderr, "%s\n", s); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @print(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct membuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ put_bytes(struct membuffer *, char const *,
                             int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void put_string(struct membuffer *b, const char *str) {
  put_bytes(b, str, strlen(str));
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <put_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put_bytes@plt>

LLVM IR (-O0):
%struct.membuffer = type { i32 }
define void @put_string(%struct.membuffer* %0, i8* %1) {
%3 = alloca %struct.membuffer*
%4 = alloca i8*
store %struct.membuffer* %0, %struct.membuffer** %3
store i8* %1, i8** %4
%5 = load %struct.membuffer*, %struct.membuffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @put_bytes(%struct.membuffer* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.membuffer = type { i32 }
define void @put_string(%struct.membuffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @put_bytes(%struct.membuffer* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_ncurses();
void catch_alarm(int signo) { setup_ncurses(); }


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

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

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

LLVM IR (-O2):
define void @catch_alarm(i32 %0) {
%2 = tail call i32 (...) @setup_ncurses()
ret void
}
/* Variables and functions */
scalar_t__ copysignl(long double, long double);
int /*<<< orphan*/ link_failure_copysignl();
void test_copysignl(long double ld1, long double ld2) {
  if (copysignl(ld1, ld2) != copysignl(ld1, ld2))
    link_failure_copysignl();
}


x86 assembly (clang, -O0):
<test_copysignl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <copysignl@plt>
mov    %rax,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <copysignl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1175 <test_copysignl+0x55>
mov    $0x0,%al
call   1040 <link_failure_copysignl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_copysignl>:
push   %rbx
sub    $0x40,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <copysignl@plt>
mov    %rax,%rbx
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <copysignl@plt>
cmp    %rax,%rbx
jne    1167 <test_copysignl+0x47>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1040 <link_failure_copysignl@plt>

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

LLVM IR (-O2):
define void @test_copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @copysignl(x86_fp80 %0, x86_fp80 %1)
%4 = tail call i64 @copysignl(x86_fp80 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_copysignl()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
double __strtofpmax(char const *, char **, int /*<<< orphan*/);
double strtod(const char *__restrict str, char **__restrict endptr) {
  return __strtofpmax(str, endptr, 0);
}


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

x86 assembly (clang, -O2):
<strtod>:
xor    %edx,%edx
jmp    1030 <__strtofpmax@plt>

LLVM IR (-O0):
define double @strtod(i8* noalias %0, i8** noalias %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call double @__strtofpmax(i8* %5, i8** %6, i32 0)
ret double %7
}

LLVM IR (-O2):
define double @strtod(i8* noalias %0, i8** noalias %1) {
%3 = tail call double @__strtofpmax(i8* %0, i8** %1, i32 0)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
__attribute__((__weak__, __always___)) ssize_t
softboundmpx_read(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<softboundmpx_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @read(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundmpx_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
char *addnslashes(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *addslashes(char *s) { return addnslashes(s, strlen(s)); }


x86 assembly (clang, -O0):
<addslashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <addnslashes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addslashes>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <addnslashes@plt>

LLVM IR (-O0):
define i8* @addslashes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @addnslashes(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @addslashes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @addnslashes(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int isLongBranch(unsigned char *);
int isShortBranch(unsigned char *);
int isBranch(unsigned char *instr) {
  if (((((int)instr & 2) || (((unsigned char *)instr)[0] & 0x80) == 0)
           ? 2
           : 4) == 2)
    return isShortBranch(instr);
  else
    return isLongBranch(instr);
}


x86 assembly (clang, -O0):
<isBranch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
and    $0x2,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1158 <isBranch+0x38>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    $0x4,%eax
mov    $0x2,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
cmp    $0x2,%eax
jne    1185 <isBranch+0x65>
mov    -0x10(%rbp),%rdi
call   1040 <isShortBranch@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <isBranch+0x71>
mov    -0x10(%rbp),%rdi
call   1030 <isLongBranch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBranch>:
test   $0x2,%dil
jne    112b <isBranch+0xb>
cmpb   $0x0,(%rdi)
js     1130 <isBranch+0x10>
jmp    1040 <isShortBranch@plt>
jmp    1030 <isLongBranch@plt>

LLVM IR (-O0):
define i32 @isBranch(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i32
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 %12, 128
%14 = icmp eq i32 %13, 0
br label %15
15: ; preds = %8, %1
%16 = phi i1 [ true, %1 ], [ %14, %8 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 2, i32 4
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = call i32 @isShortBranch(i8* %21)
store i32 %22, i32* %2
br label %26
23: ; preds = %15
%24 = load i8*, i8** %3
%25 = call i32 @isLongBranch(i8* %24)
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @isBranch(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp sgt i8 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1, %5
%9 = tail call i32 @isShortBranch(i8* %0)
br label %12
10: ; preds = %5
%11 = tail call i32 @isLongBranch(i8* %0)
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void error(char *c) {
  printf("ERROR: Expected %s\n", c);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"ERROR: Expected %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int test_imm_57uint32_mem(unsigned int *val) {
  return ((*val) & (0x57 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_57uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 87
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}