xunge/DecIR huggingface dataset:
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
scalar_t__ ip6cmp(struct in6_addr const *, struct in6_addr const *);
__attribute__((always_)) int ip6equal(const struct in6_addr *a,
                                      const struct in6_addr *b) {
  return ip6cmp(a, b) == 0;
}


x86 assembly (clang, -O0):
<ip6equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ip6cmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip6equal>:
push   %rax
call   1030 <ip6cmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @ip6equal(%struct.in6_addr* %0, %struct.in6_addr* %1) {
%3 = alloca %struct.in6_addr*
%4 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %3
store %struct.in6_addr* %1, %struct.in6_addr** %4
%5 = load %struct.in6_addr*, %struct.in6_addr** %3
%6 = load %struct.in6_addr*, %struct.in6_addr** %4
%7 = call i64 @ip6cmp(%struct.in6_addr* %5, %struct.in6_addr* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @ip6equal(%struct.in6_addr* %0, %struct.in6_addr* %1) {
%3 = tail call i64 @ip6cmp(%struct.in6_addr* %0, %struct.in6_addr* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int dfn_ri(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @dfn_ri() {
ret i32 3
}

LLVM IR (-O2):
define i32 @dfn_ri() {
ret i32 3
}
/* Variables and functions */
int convert_3d_indices_to_linear_index_inline(int, int, int, int, int, int);
int convert_3d_indices_to_linear_index(int *index_vector, int nx, int ny,
                                       int nz) {
  return convert_3d_indices_to_linear_index_inline(
      index_vector[0], index_vector[1], index_vector[2], nx, ny, nz);
}


x86 assembly (clang, -O0):
<convert_3d_indices_to_linear_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1030 <convert_3d_indices_to_linear_index_inline@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_3d_indices_to_linear_index>:
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    %eax,%edi
jmp    1030 <convert_3d_indices_to_linear_index_inline@plt>

LLVM IR (-O0):
define i32 @convert_3d_indices_to_linear_index(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 @convert_3d_indices_to_linear_index_inline(i32 %11, i32 %14, i32 %17, i32 %18, i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @convert_3d_indices_to_linear_index(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = tail call i32 @convert_3d_indices_to_linear_index_inline(i32 %5, i32 %7, i32 %9, i32 %1, i32 %2, i32 %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
int main() {
  int n = 1000;
  int i;
  f(n);
  for (i = 0; i < 1; ++i) {
    f(n);
    n = 666;
    &n;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    116c <main+0x4c>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
movl   $0x29a,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <main+0x25>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
call   1030 <f@plt>
mov    $0x3e8,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @f(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %12, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @f(i32 %10)
store i32 666, i32* %2
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1000)
%2 = tail call i32 @f(i32 1000)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void convolution_deriv(double *fld1, double *fld2, double *res, double fac,
                       int jres, int ncols) {
  return;
}


x86 assembly (clang, -O0):
<convolution_deriv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @convolution_deriv(double* nocapture %0, double* nocapture %1, double* nocapture %2, double %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Z_NO_COMPRESSION;
int /*<<< orphan*/ png_write_palette_based2(char const *, unsigned char *,
                                            unsigned int, unsigned int, int,
                                            int /*<<< orphan*/);
void png_write_quick(const char *filename, unsigned char *data, unsigned width,
                     unsigned height) {
  png_write_palette_based2(filename, data, width, height, 257,
                           Z_NO_COMPRESSION);
}


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

x86 assembly (clang, -O2):
<png_write_quick>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%r9d
mov    $0x101,%r8d
jmp    1030 <png_write_palette_based2@plt>

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

LLVM IR (-O2):
@Z_NO_COMPRESSION = global i32 0
define void @png_write_quick(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @Z_NO_COMPRESSION
%6 = tail call i32 @png_write_palette_based2(i8* %0, i8* %1, i32 %2, i32 %3, i32 257, i32 %5)
ret void
}
/* Variables and functions */
int atoi(char *);
int expected_count_get_int(char *expected_count_string) {
  int i;
  i = atoi(expected_count_string);
  if (!i)
    i = 24;
  return i;
}


x86 assembly (clang, -O0):
<expected_count_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1139 <expected_count_get_int+0x29>
movl   $0x18,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expected_count_get_int>:
push   %rax
call   1030 <atoi@plt>
test   %eax,%eax
mov    $0x18,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @expected_count_get_int(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 24, i32 %2
ret i32 %4
}
int test_imm_DAint8_reg(signed char val) {
  return ((val) & (0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAint8_reg>:
test   $0xda,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DAint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 218
%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_DAint8_reg(i8 signext %0) {
%2 = and i8 %0, -38
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float atan2f(float x, float y) {
  float r;
  __asm__ __volatile__("fpatan" : "=t"(r) : "0"(x), "u"(y));
  return r;
}


x86 assembly (clang, -O0):
<atan2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
flds   -0x10(%rbp)
flds   -0x14(%rbp)
fxch   %st(1)
fpatan
fstp   %st(1)
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2f>:
movss  %xmm0,-0x4(%rsp)
movss  %xmm1,-0x8(%rsp)
flds   -0x4(%rsp)
flds   -0x8(%rsp)
fxch   %st(1)
fpatan
fstp   %st(1)
fstps  -0xc(%rsp)
movss  -0xc(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @atan2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float asm sideeffect "fpatan", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @atan2f(float %0, float %1) {
%3 = tail call float asm sideeffect "fpatan", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(float %0, float %1)
ret float %3
}
int count() {
  static int c = 0;
  return c++;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@count.c = internal global i32 0
define i32 @count() {
%1 = load i32, i32* @count.c
%2 = add nsw i32 %1, 1
store i32 %2, i32* @count.c
ret i32 %1
}

LLVM IR (-O2):
@count.c = internal unnamed_addr global i32 0
define i32 @count() {
%1 = load i32, i32* @count.c
%2 = add nsw i32 %1, 1
store i32 %2, i32* @count.c
ret i32 %1
}
/* Type definitions */
struct arg_int {
  int dummy;
};

/* Variables and functions */
struct arg_int *arg_intn(char const *, char const *, char const *, int, int,
                         char const *);
struct arg_int *arg_int1(const char *shortopts, const char *longopts,
                         const char *datatype, const char *glossary) {
  return arg_intn(shortopts, longopts, datatype, 1, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_int1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r9
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <arg_intn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_int1>:
mov    %rcx,%r9
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <arg_intn@plt>

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

LLVM IR (-O2):
%struct.arg_int = type { i32 }
define %struct.arg_int* @arg_int1(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.arg_int* @arg_intn(i8* %0, i8* %1, i8* %2, i32 1, i32 1, i8* %3)
ret %struct.arg_int* %5
}
/* Variables and functions */
void *bar(void *);
int /*<<< orphan*/ foo();
void *thread_third(void *arg) {
  foo();
  return bar(arg);
}


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

x86 assembly (clang, -O2):
<thread_third>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i8* @thread_third(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @foo()
%4 = load i8*, i8** %2
%5 = call i8* @bar(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @thread_third(i8* %0) {
%2 = tail call i32 (...) @foo()
%3 = tail call i8* @bar(i8* %0)
ret i8* %3
}
void _ZTVN5javax8security4auth5login14LoginExceptionE(void) {}


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

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

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

LLVM IR (-O2):
define void @_ZTVN5javax8security4auth5login14LoginExceptionE() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ sleep(int);
void *w_calloc(size_t nmemb, size_t size) {
  void *p;
  do {
    p = calloc(nmemb, size);
    if (!p)
      sleep(1);
  } while (!p);
  return p;
}


x86 assembly (clang, -O0):
<w_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <w_calloc+0x36>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    115b <w_calloc+0x3b>
cmpq   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1130 <w_calloc+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
call   1030 <calloc@plt>
test   %rax,%rax
jne    114c <w_calloc+0x2c>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
jmp    1130 <w_calloc+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @w_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2, %5
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i8* @calloc(i64 %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %5, label %9
9: ; preds = %5, %2
%10 = phi i8* [ %3, %2 ], [ %7, %5 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_dec_d(void) { op_write1(0x15); }


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

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

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

LLVM IR (-O2):
define void @op_enc_dec_d() {
%1 = tail call i32 @op_write1(i32 21)
ret void
}
/* Variables and functions */
char *getenv(char const *);
char const *mpw_strdup(char *);
const char *mpw_getenv(const char *variableName) {
  char *envBuf = getenv(variableName);
  return envBuf ? mpw_strdup(envBuf) : NULL;
}


x86 assembly (clang, -O0):
<mpw_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <mpw_getenv+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <mpw_strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    1161 <mpw_getenv+0x41>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1161 <mpw_getenv+0x41>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpw_getenv>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <mpw_getenv+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <mpw_strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @mpw_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @mpw_strdup(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int voidptr_destructor(void *a) {
  free(a);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @voidptr_destructor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int STR1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @STR1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ explode_badly();
__attribute__((no, noclone)) i_am_pure4(int a) {
  if (a > 50)
    explode_badly();
  return a;
}


x86 assembly (clang, -O0):
<i_am_pure4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jle    112c <i_am_pure4+0x1c>
mov    $0x0,%al
call   1030 <explode_badly@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_am_pure4>:
push   %rbx
mov    %edi,%ebx
cmp    $0x33,%edi
jl     111f <i_am_pure4+0xf>
xor    %eax,%eax
call   1030 <explode_badly@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @i_am_pure4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 50
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @explode_badly()
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @i_am_pure4(i32 returned %0) {
%2 = icmp sgt i32 %0, 50
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @explode_badly()
br label %5
5: ; preds = %3, %1
ret i32 %0
}
/* Variables and functions */
int NSIG;
int /*<<< orphan*/ printf(char *, int, char *);
char *strsignal(int);
void print_signals() {
  int sig = 0;
  for (sig = 1; sig < NSIG; sig++) {
    printf("Signal: %d, Description: %s\n", sig, strsignal(sig));
  }
}


x86 assembly (clang, -O0):
<print_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%eax
jge    1176 <print_signals+0x56>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strsignal@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <print_signals+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_signals>:
push   %r15
push   %r14
push   %rbx
mov    0x2eb4(%rip),%r15
cmpl   $0x2,(%r15)
jl     115c <print_signals+0x3c>
mov    $0x1,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <strsignal@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    (%r15),%ebx
jl     1140 <print_signals+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@NSIG = global i32 0
@.str = [29 x i8] c"Signal: %d, Description: %s\0A\00"
define void @print_signals() {
%1 = load i32, i32* @NSIG
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 1, %0 ]
%5 = tail call i8* @strsignal(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = add nuw nsw i32 %4, 1
%8 = load i32, i32* @NSIG
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret void
}
/* Type definitions */
struct cdrom_subchnl {
  scalar_t__ cdsc_audiostatus;
  int cdsc_trk;
};

/* Variables and functions */
scalar_t__ CDROM_AUDIO_PLAY;
int /*<<< orphan*/ get_subchnl(struct cdrom_subchnl *);
int cd_current_track() {
  struct cdrom_subchnl s;
  get_subchnl(&s);
  if (s.cdsc_audiostatus == CDROM_AUDIO_PLAY)
    return s.cdsc_trk;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cd_current_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
call   1030 <get_subchnl@plt>
mov    -0x18(%rbp),%rax
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%rax
jne    1140 <cd_current_track+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <cd_current_track+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_current_track>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <get_subchnl@plt>
mov    0x8(%rsp),%rcx
mov    0x2eb6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
jne    1135 <cd_current_track+0x25>
mov    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.cdrom_subchnl = type { i64, i32 }
@CDROM_AUDIO_PLAY = global i64 0
define i32 @cd_current_track() {
%1 = alloca i32
%2 = alloca %struct.cdrom_subchnl
%3 = call i32 @get_subchnl(%struct.cdrom_subchnl* %2)
%4 = getelementptr inbounds %struct.cdrom_subchnl, %struct.cdrom_subchnl* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @CDROM_AUDIO_PLAY
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = getelementptr inbounds %struct.cdrom_subchnl, %struct.cdrom_subchnl* %2, i32 0, i32 1
%10 = load i32, i32* %9
store i32 %10, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.cdrom_subchnl = type { i64, i32 }
@CDROM_AUDIO_PLAY = global i64 0
define i32 @cd_current_track() {
%1 = alloca %struct.cdrom_subchnl
%2 = bitcast %struct.cdrom_subchnl* %1 to i8*
%3 = call i32 @get_subchnl(%struct.cdrom_subchnl* %1)
%4 = getelementptr inbounds %struct.cdrom_subchnl, %struct.cdrom_subchnl* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @CDROM_AUDIO_PLAY
%7 = icmp eq i64 %5, %6
%8 = getelementptr inbounds %struct.cdrom_subchnl, %struct.cdrom_subchnl* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = select i1 %7, i32 %9, i32 0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void neq_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a!=b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<neq_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee9(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<neq_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a!=b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @neq_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a!=b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @neq_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
void sighandler(int signo) {
  printf("pid=%d received signal %d, exiting.\n", getpid(), signo);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"pid=%d received signal %d, exiting.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"pid=%d received signal %d, exiting.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
scalar_t__ strcmp(int /*<<< orphan*/ *, char *);
int is_in_launcher() {
  if (getenv("TESTLAUNCHER") != NULL) {
    if (strcmp(getenv("TESTLAUNCHER"), "1") == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_launcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1174 <is_in_launcher+0x54>
lea    0xebb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    116f <is_in_launcher+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    117b <is_in_launcher+0x5b>
jmp    1174 <is_in_launcher+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_launcher>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1146 <is_in_launcher+0x26>
lea    0xed4(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114a <is_in_launcher+0x2a>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"TESTLAUNCHER\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @is_in_launcher() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i32* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
int gcd(int a, int b) {
  while (b != 0) {
    int tmp = a;
    a = b;
    b = tmp % b;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  register void *mblk = malloc(size);
  if (mblk)
    return mblk;
  errx(EX_OSERR, "out of memory");
  return NULL;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <xmalloc+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <xmalloc+0x4e>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <errx@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@EX_OSERR = global i32 0
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i32, i32* @EX_OSERR
%13 = call i32 @errx(i32 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@EX_OSERR = global i32 0
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EX_OSERR
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %4
ret i8* %2
}
int check_if_sorted(double array[], int array_size) {
  int i;
  for (i = 1; i < array_size; i++)
    if (array[i] < array[i - 1])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_if_sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1166 <check_if_sorted+0x66>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1153 <check_if_sorted+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116d <check_if_sorted+0x6d>
jmp    1158 <check_if_sorted+0x58>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <check_if_sorted+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_sorted>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1138 <check_if_sorted+0x38>
mov    %esi,%ecx
movsd  (%rdi),%xmm0
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm0,%xmm1
movsd  (%rdi,%rdx,8),%xmm0
ucomisd %xmm0,%xmm1
ja     1139 <check_if_sorted+0x39>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1120 <check_if_sorted+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_if_sorted(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load double, double* %0
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %5
br i1 %8, label %16, label %9
9: ; preds = %4, %7
%10 = phi double [ %6, %4 ], [ %13, %7 ]
%11 = phi i64 [ 1, %4 ], [ %15, %7 ]
%12 = getelementptr inbounds double, double* %0, i64 %11
%13 = load double, double* %12
%14 = fcmp olt double %13, %10
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %2
%17 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %17
}
long long pass_ll(long long x) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @pass_ll(i64 returned %0) {
ret i64 %0
}
void func2() { printf("\n%s\n", __func__); }


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

x86 assembly (clang, -O2):
<func2>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
@__func__.func2 = [6 x i8] c"func2\00"
define void @func2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.func2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int print_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(21, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<print_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x15,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_system>:
mov    $0x15,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @print_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 21, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @print_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 21, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void handle_36(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_36(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ check_debug_level(unsigned int);
scalar_t__ dont_mute(unsigned int);
bool msg_test(unsigned int flags) {
  return check_debug_level(flags) && dont_mute(flags);
}


x86 assembly (clang, -O0):
<msg_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <check_debug_level@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <msg_test+0x37>
mov    -0x4(%rbp),%edi
call   1030 <dont_mute@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_test>:
push   %rbx
mov    %edi,%ebx
call   1040 <check_debug_level@plt>
test   %rax,%rax
je     1141 <msg_test+0x21>
mov    %ebx,%edi
call   1030 <dont_mute@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @msg_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @check_debug_level(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @dont_mute(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @msg_test(i32 %0) {
%2 = tail call i64 @check_debug_level(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @dont_mute(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate64(int, int /*<<< orphan*/);
int ftruncate(int fd, off_t length) { return ftruncate64(fd, length); }


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

x86 assembly (clang, -O2):
<ftruncate>:
jmp    1030 <ftruncate64@plt>

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

LLVM IR (-O2):
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate64(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
void *alloc_interleaved(size_t, size_t *, int, int *);
void *alloc_onnode(size_t size, int node) {
  return alloc_interleaved(size, &size, 1, &node);
}


x86 assembly (clang, -O0):
<alloc_onnode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
lea    -0xc(%rbp),%rcx
call   1030 <alloc_interleaved@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_onnode>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %esi,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    $0x1,%edx
call   1030 <alloc_interleaved@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i8* @alloc_onnode(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = call i8* @alloc_interleaved(i64 %5, i64* %3, i32 1, i32* %4)
ret i8* %6
}

LLVM IR (-O2):
define i8* @alloc_onnode(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = call i8* @alloc_interleaved(i64 %0, i64* %3, i32 1, i32* %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ indirectl();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
void sbcIndirectLong16(void) { sbc16(readmemw65816(indirectl())); }


x86 assembly (clang, -O0):
<sbcIndirectLong16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirectLong16>:
push   %rax
xor    %eax,%eax
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcIndirectLong16() {
%1 = call i32 (...) @indirectl()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirectLong16() {
%1 = tail call i32 (...) @indirectl()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}