xunge/DecIR huggingface dataset:
void on_sig(int sig) { (void)sig; }


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

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

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

LLVM IR (-O2):
define void @on_sig(i32 %0) {
ret void
}
float fmaxf(float x, float y) {
  float result = y;
  if (x > y) {
    result = x;
  }
  return result;
}


x86 assembly (clang, -O0):
<fmaxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1131 <fmaxf+0x31>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxf>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmaxf(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* %4
store float %6, float* %5
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load float, float* %3
store float %11, float* %5
br label %12
12: ; preds = %10, %2
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @fmaxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ dtrmv_(char *, char *, char *, int *, double *, int *,
                          double *, int *);
void wcc_dtrmv_(char *UPLO, char *TRANS, char *DIAG, int *N, char *A, int *LDA,
                char *X, int *INCX) {
  dtrmv_(UPLO, TRANS, DIAG, N, (double *)A, LDA, (double *)X, INCX);
}


x86 assembly (clang, -O0):
<wcc_dtrmv_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dtrmv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_dtrmv_>:
jmp    1030 <dtrmv_@plt>

LLVM IR (-O0):
define void @wcc_dtrmv_(i8* %0, i8* %1, i8* %2, i32* %3, i8* %4, i32* %5, i8* %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i32*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32* %3, i32** %12
store i8* %4, i8** %13
store i32* %5, i32** %14
store i8* %6, i8** %15
store i32* %7, i32** %16
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = load i32*, i32** %12
%21 = load i8*, i8** %13
%22 = bitcast i8* %21 to double*
%23 = load i32*, i32** %14
%24 = load i8*, i8** %15
%25 = bitcast i8* %24 to double*
%26 = load i32*, i32** %16
%27 = call i32 @dtrmv_(i8* %17, i8* %18, i8* %19, i32* %20, double* %22, i32* %23, double* %25, i32* %26)
ret void
}

LLVM IR (-O2):
define void @wcc_dtrmv_(i8* %0, i8* %1, i8* %2, i32* %3, i8* %4, i32* %5, i8* %6, i32* %7) {
%9 = bitcast i8* %4 to double*
%10 = bitcast i8* %6 to double*
%11 = tail call i32 @dtrmv_(i8* %0, i8* %1, i8* %2, i32* %3, double* %9, i32* %5, double* %10, i32* %7)
ret void
}
int satsb(int x) {
  if (x < -128)
    return -128;
  else if (x > 127)
    return 127;
  else
    return x;
}


x86 assembly (clang, -O0):
<satsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffff80,-0x8(%rbp)
jge    111d <satsb+0x1d>
movl   $0xffffff80,-0x4(%rbp)
jmp    1139 <satsb+0x39>
cmpl   $0x7f,-0x8(%rbp)
jle    1133 <satsb+0x33>
movl   $0x7f,-0x4(%rbp)
jmp    1139 <satsb+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<satsb>:
cmp    $0x7f,%edi
mov    $0x7f,%ecx
cmovl  %edi,%ecx
cmp    $0xffffff81,%ecx
mov    $0xffffff80,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @satsb(i32 %0) {
%2 = icmp slt i32 %0, 127
%3 = select i1 %2, i32 %0, i32 127
%4 = icmp sgt i32 %3, -128
%5 = select i1 %4, i32 %3, i32 -128
ret i32 %5
}
/* Variables and functions */
float const fabsf(float);
int approxf(float a, float b) {
  static const float eps = 1e-8;
  return fabsf(a - b) < eps;
}


x86 assembly (clang, -O0):
<approxf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabsf@plt>
movaps %xmm0,%xmm1
movss  0xec4(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<approxf>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
movss  0xefd(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
@approxf.eps = internal constant float 0x3E45798EE0000000
define i32 @approxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call float @fabsf(float %7)
%9 = fcmp olt float %8, 0x3E45798EE0000000
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @approxf(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = fcmp olt float %4, 0x3E45798EE0000000
%6 = zext i1 %5 to i32
ret i32 %6
}
int HelpItem108(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem108() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int genBitCount_uint8_t(uint8_t v) {
  unsigned c;
  for (c = 0; v; c++)
    v &= v - 1;
  return c;
}


x86 assembly (clang, -O0):
<genBitCount_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <genBitCount_uint8_t+0x38>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <genBitCount_uint8_t+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genBitCount_uint8_t>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <genBitCount_uint8_t+0x1c>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rcx
add    $0x1,%eax
and    %rcx,%rdi
jne    1110 <genBitCount_uint8_t+0x10>
ret

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

LLVM IR (-O2):
define i32 @genBitCount_uint8_t(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = and i64 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
unsigned int __atomic_fetch_sub_4(volatile void *atom, unsigned int value,
                                  int memorder) {
  unsigned int xchg;
  unsigned int cmp;
  __atomic_load((unsigned int *)atom, (unsigned int *)&cmp, 0);
  do {
    xchg = ((cmp - value));
  } while (
      !__atomic_compare_exchange((unsigned int *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_sub_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x21(%rbp)
mov    %ecx,-0x20(%rbp)
test   $0x1,%al
jne    1147 <__atomic_fetch_sub_4+0x47>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1117 <__atomic_fetch_sub_4+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_sub_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%edx
sub    %esi,%edx
lock cmpxchg %edx,(%rdi)
jne    1110 <__atomic_fetch_sub_4+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__atomic_fetch_sub_4(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load atomic i32, i32* %11 monotonic
store i32 %12, i32* %8
br label %13
13: ; preds = %26, %3
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = sub i32 %14, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = cmpxchg weak i32* %19, i32 %20, i32 %21 seq_cst seq_cst
%23 = extractvalue { i32, i1 } %22, 0
%24 = extractvalue { i32, i1 } %22, 1
br i1 %24, label %26, label %25
25: ; preds = %17
store i32 %23, i32* %8
br label %26
26: ; preds = %25, %17
%27 = zext i1 %24 to i8
store i8 %27, i8* %9
%28 = load i8, i8* %9
%29 = trunc i8 %28 to i1
%30 = xor i1 %29, true
br i1 %30, label %13, label %31
31: ; preds = %26
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @__atomic_fetch_sub_4(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load atomic i32, i32* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i32 [ %5, %3 ], [ %11, %6 ]
%8 = sub i32 %7, %1
%9 = cmpxchg weak i32* %4, i32 %7, i32 %8 seq_cst seq_cst
%10 = extractvalue { i32, i1 } %9, 1
%11 = extractvalue { i32, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ video_get_type();
int video_is_cga(void) { return (video_get_type() == 0); }


x86 assembly (clang, -O0):
<video_is_cga>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <video_get_type@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @video_is_cga() {
%1 = call i64 (...) @video_get_type()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @video_is_cga() {
%1 = tail call i64 (...) @video_get_type()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ rand_bool();
short rand_sign() { return rand_bool() ? 1 : -1; }


x86 assembly (clang, -O0):
<rand_sign>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand_bool@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_sign>:
push   %rax
xor    %eax,%eax
call   1030 <rand_bool@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @rand_sign() {
%1 = call i64 (...) @rand_bool()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 -1
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @rand_sign() {
%1 = tail call i64 (...) @rand_bool()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i16 -1, i16 1
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
void bar() {
  int buf[100];
  foo(buf);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rdi
call   1030 <foo@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x198,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @bar() {
%1 = alloca [100 x i32]
%2 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%3 = call i32 @foo(i32* %2)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret void
}
void vnum_result1(int *data) { data[0] = 0; }


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

x86 assembly (clang, -O2):
<vnum_result1>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @vnum_result1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
ret void
}

LLVM IR (-O2):
define void @vnum_result1(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_n_answer(int);
int /*<<< orphan*/ printf(char *, int);
int _Problem045() {
  int n = 40755 + 1;
  while (!is_n_answer(n)) {
    ++n;
  }
  printf("%d", n);
  return 0;
}


x86 assembly (clang, -O0):
<_Problem045>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x9f34,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_n_answer@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114c <_Problem045+0x2c>
jmp    115a <_Problem045+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <_Problem045+0xf>
mov    -0x4(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Problem045>:
push   %rbx
mov    $0x9f33,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <is_n_answer@plt>
test   %eax,%eax
je     1130 <_Problem045+0x10>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @_Problem045() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 40756, %0 ], [ %5, %1 ]
%3 = tail call i32 @is_n_answer(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err(int /*<<< orphan*/, int /*<<< orphan*/ *);
void check_for_null_alloc(void *p) {
  if (NULL == p) {
    err(EXIT_FAILURE, NULL);
  }
}


x86 assembly (clang, -O0):
<check_for_null_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    113a <check_for_null_alloc+0x2a>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_null_alloc>:
test   %rdi,%rdi
je     1116 <check_for_null_alloc+0x6>
ret
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <err@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @check_for_null_alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* null, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @err(i32 %6, i32* null)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @check_for_null_alloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @err(i32 %4, i32* null)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int libaft_internal_surfmeshrefiner_poly_setup(double, double, double, double);
int surface_refine_setup_poly(double minabs, double min, double eps,
                              double eps2) {
  return libaft_internal_surfmeshrefiner_poly_setup(minabs, min, eps, eps2);
}


x86 assembly (clang, -O0):
<surface_refine_setup_poly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <libaft_internal_surfmeshrefiner_poly_setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<surface_refine_setup_poly>:
jmp    1030 <libaft_internal_surfmeshrefiner_poly_setup@plt>

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

LLVM IR (-O2):
define i32 @surface_refine_setup_poly(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @libaft_internal_surfmeshrefiner_poly_setup(double %0, double %1, double %2, double %3)
ret i32 %5
}
void foo240(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo240(i32 %0) {
ret void
}
void push(char stack[], char item, int *top, int max_size) {
  if (*top < max_size - 1) {
    ++(*top);
    stack[*top] = item;
  }
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1145 <push+0x45>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq (%rdx),%rax
add    $0xffffffff,%ecx
cmp    %ecx,%eax
jge    1115 <push+0x15>
lea    0x1(%rax),%rcx
mov    %ecx,(%rdx)
mov    %sil,0x1(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @push(i8* %0, i8 signext %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 i32*, i32** %7
%10 = load i32, i32* %9
%11 = load i32, i32* %8
%12 = sub nsw i32 %11, 1
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %24
14: ; preds = %4
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %15
%18 = load i8, i8* %6
%19 = load i8*, i8** %5
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 %18, i8* %23
br label %24
24: ; preds = %14, %4
ret void
}

LLVM IR (-O2):
define void @push(i8* nocapture writeonly %0, i8 signext %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
%6 = add nsw i32 %3, -1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = add nsw i32 %5, 1
store i32 %9, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %1, i8* %11
br label %12
12: ; preds = %8, %4
ret void
}
int f(int **arr) { return arr[5][25]; }


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

x86 assembly (clang, -O2):
<f>:
mov    0x28(%rdi),%rax
mov    0x64(%rax),%eax
ret

LLVM IR (-O0):
define i32 @f(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = getelementptr inbounds i32*, i32** %3, i64 5
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 25
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32** nocapture %0) {
%2 = getelementptr inbounds i32*, i32** %0, i64 5
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 25
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int print_results_packages(void *dummy, int field_count, char **row,
                           char **fields) {
  (void)dummy;
  (void)field_count;
  (void)fields;
  if (row[1]) {
    puts(row[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_results_packages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1143 <print_results_packages+0x33>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_results_packages>:
push   %rax
mov    0x8(%rdx),%rdi
test   %rdi,%rdi
je     111f <print_results_packages+0xf>
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @print_results_packages(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = getelementptr inbounds i8*, i8** %2, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @puts(i8* %6)
br label %10
10: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ out_putc(int /*<<< orphan*/);
int out_fputs(const char *s) {
  while (*s)
    out_putc(*s++);
  return 0;
}


x86 assembly (clang, -O0):
<out_fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <out_fputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <out_putc@plt>
jmp    111c <out_fputs+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_fputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <out_fputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <out_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <out_fputs+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @out_fputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @out_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int (*)());
int main() {
  printf("&main=%p\n", &main);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"&main=%p\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"&main=%p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double ruspma_rand_decimal() { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<ruspma_rand_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ruspma_rand_decimal>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @ruspma_rand_decimal() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @ruspma_rand_decimal() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Type definitions */
typedef int __feh;

/* Variables and functions */
int read(int, short *, int);
int beread16(int fd, short *c) {
  int r;
  r = read(fd, c, 2);
  do {
    short __feh = *c;
    if (!1)
      *c = *c;
    else
      *c = ((((__feh) >> 8) & 0xff) | (((__feh)&0xff) << 8));
  } while (0);
  return r;
}


x86 assembly (clang, -O0):
<beread16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x16(%rbp)
movswl -0x16(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movswl -0x16(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beread16>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2,%edx
call   1030 <read@plt>
rolw   $0x8,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @beread16(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %3
store i16* %1, i16** %4
%7 = load i32, i32* %3
%8 = load i16*, i16** %4
%9 = call i32 @read(i32 %7, i16* %8, i32 2)
store i32 %9, i32* %5
br label %10
10: ; preds = %2
%11 = load i16*, i16** %4
%12 = load i16, i16* %11
store i16 %12, i16* %6
%13 = load i16, i16* %6
%14 = sext i16 %13 to i32
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i16, i16* %6
%18 = sext i16 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 8
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i16
%23 = load i16*, i16** %4
store i16 %22, i16* %23
br label %24
24: ; preds = %10
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @beread16(i32 %0, i16* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i16* %1, i32 2)
%4 = load i16, i16* %1
%5 = tail call i16 @llvm.bswap.i16(i16 %4)
store i16 %5, i16* %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_scalbnl();
scalar_t__ scalbnl(long double, int);
void test_scalbnl(long double ld, int x) {
  if (scalbnl(ld, x) != scalbnl(ld, x))
    link_failure_scalbnl();
}


x86 assembly (clang, -O0):
<test_scalbnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <scalbnl@plt>
mov    %rax,-0x20(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <scalbnl@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     116c <test_scalbnl+0x4c>
mov    $0x0,%al
call   1030 <link_failure_scalbnl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalbnl>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1040 <scalbnl@plt>
mov    %rax,%r14
fldt   0x1c(%rsp)
fstpt  (%rsp)
mov    %ebx,%edi
call   1040 <scalbnl@plt>
cmp    %rax,%r14
jne    1159 <test_scalbnl+0x39>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
jmp    1030 <link_failure_scalbnl@plt>

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

LLVM IR (-O2):
define void @test_scalbnl(x86_fp80 %0, i32 %1) {
%3 = tail call i64 @scalbnl(x86_fp80 %0, i32 %1)
%4 = tail call i64 @scalbnl(x86_fp80 %0, i32 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_scalbnl()
br label %8
8: ; preds = %6, %2
ret void
}
void vfs_dq_drop(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @vfs_dq_drop(%struct.inode* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
#define SIG_BLOCK 130
#define SIG_SETMASK 129
#define SIG_UNBLOCK 128
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigprocmask(int how, const sigset_t *set, sigset_t *oset) {
  switch (how) {
  case SIG_BLOCK:
  case SIG_UNBLOCK:
  case SIG_SETMASK:
    break;
  default:
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x2,%eax
ja     113c <__sigprocmask+0x2c>
jmp    1137 <__sigprocmask+0x27>
jmp    1156 <__sigprocmask+0x46>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <__sigprocmask+0x5b>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigprocmask>:
push   %rax
add    $0xffffff80,%edi
cmp    $0x3,%edi
jae    1122 <__sigprocmask+0x12>
mov    0x2ec8(%rip),%rax
jmp    1129 <__sigprocmask+0x19>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load i32, i32* %5
switch i32 %8, label %10 [
i32 130, label %9
i32 128, label %9
i32 129, label %9
]
9: ; preds = %3, %3, %3
br label %13
10: ; preds = %3
%11 = load i32, i32* @EINVAL
%12 = call i32 @__set_errno(i32 %11)
store i32 -1, i32* %4
br label %16
13: ; preds = %9
%14 = load i32, i32* @ENOSYS
%15 = call i32 @__set_errno(i32 %14)
store i32 -1, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__sigprocmask(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = add i32 %0, -128
%5 = icmp ult i32 %4, 3
%6 = load i32, i32* @ENOSYS
%7 = load i32, i32* @EINVAL
%8 = select i1 %5, i32 %6, i32 %7
%9 = tail call i32 @__set_errno(i32 %8)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void halt(char *s) {
  printf("Error: %s\n", s);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <halt+0x1c>

x86 assembly (clang, -O2):
<halt>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <halt+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @halt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @halt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ octets;

/* Variables and functions */
int /*<<< orphan*/ format_uuid_rfc4122(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ ptls_openssl_random_bytes(void *, int);
void h2o_generate_uuidv4(char *dst) {
  uint8_t octets[16];
  ptls_openssl_random_bytes((void *)&octets, sizeof(octets));
  format_uuid_rfc4122(dst, octets, 4);
}


x86 assembly (clang, -O0):
<h2o_generate_uuidv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
call   1030 <ptls_openssl_random_bytes@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x4,%edx
call   1040 <format_uuid_rfc4122@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_generate_uuidv4>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <ptls_openssl_random_bytes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <format_uuid_rfc4122@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @h2o_generate_uuidv4(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i32]
store i8* %0, i8** %2
%4 = bitcast [16 x i32]* %3 to i8*
%5 = call i32 @ptls_openssl_random_bytes(i8* %4, i32 64)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%8 = call i32 @format_uuid_rfc4122(i8* %6, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @h2o_generate_uuidv4(i8* %0) {
%2 = alloca [16 x i32]
%3 = bitcast [16 x i32]* %2 to i8*
%4 = call i32 @ptls_openssl_random_bytes(i8* %3, i32 64)
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%6 = call i32 @format_uuid_rfc4122(i8* %0, i32* %5, i32 4)
ret void
}
/* Variables and functions */
int fprint_passwords(char **);
int get_from_name(char **);
scalar_t__ strcmp(char *, char *);
int main(int ac, char **av) {
  (void)(ac);
  if (strcmp(av[1], "fprint_passwords") == 0) {
    return fprint_passwords(av);
  } else {
    return get_from_name(av);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1175 <main+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <fprint_passwords@plt>
mov    %eax,-0x4(%rbp)
jmp    1181 <main+0x51>
mov    -0x10(%rbp),%rdi
call   1050 <get_from_name@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1152 <main+0x22>
pop    %rbx
jmp    1050 <get_from_name@plt>
pop    %rbx
jmp    1030 <fprint_passwords@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"fprint_passwords\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @fprint_passwords(i8** %1)
br label %11
9: ; preds = %2
%10 = tail call i32 @get_from_name(i8** %1)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
call6d(l, f, d, uc, us, ui, ul) long l;
float f;
double d;
unsigned char uc;
unsigned short us;
unsigned int ui;
unsigned long ul;
{
  l = l;
  call6e(f, d, uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edx,%eax
cvtsd2ss %xmm0,%xmm0
mov    %sil,%dl
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %dl,-0x21(%rbp)
mov    %ax,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x20(%rbp),%xmm1
movzbl -0x21(%rbp),%edi
movzwl -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    $0x2,%al
call   1030 <call6e@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6d>:
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movzbl %sil,%edi
movzwl %dx,%esi
mov    %ecx,%edx
mov    %r8,%rcx
mov    $0x2,%al
jmp    1030 <call6e@plt>

LLVM IR (-O0):
define i32 @call6d(i64 %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i64 %6) {
%8 = alloca i32
%9 = alloca i64
%10 = alloca float
%11 = alloca double
%12 = alloca i8
%13 = alloca i16
%14 = alloca i32
%15 = alloca i64
%16 = fptrunc double %1 to float
%17 = trunc i32 %3 to i8
%18 = trunc i32 %4 to i16
store i64 %0, i64* %9
store float %16, float* %10
store double %2, double* %11
store i8 %17, i8* %12
store i16 %18, i16* %13
store i32 %5, i32* %14
store i64 %6, i64* %15
%19 = load i64, i64* %9
store i64 %19, i64* %9
%20 = load float, float* %10
%21 = fpext float %20 to double
%22 = load double, double* %11
%23 = load i8, i8* %12
%24 = zext i8 %23 to i32
%25 = load i16, i16* %13
%26 = zext i16 %25 to i32
%27 = load i32, i32* %14
%28 = load i64, i64* %15
%29 = call i32 (double, double, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6e to i32 (double, double, i32, i32, i32, i64, ...)*)(double %21, double %22, i32 %24, i32 %26, i32 %27, i64 %28)
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @call6d(i64 %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i64 %6) {
%8 = fptrunc double %1 to float
%9 = fpext float %8 to double
%10 = and i32 %3, 255
%11 = and i32 %4, 65535
%12 = tail call i32 (double, double, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call6e to i32 (double, double, i32, i32, i32, i64, ...)*)(double %9, double %2, i32 %10, i32 %11, i32 %5, i64 %6)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function_two() {
  printf("This is function one\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<function_two>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"This is function one\0A\00"
define i32 @function_two() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"This is function one\00"
define i32 @function_two() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char const *, int, unsigned char const *, int,
                        int, int);
unsigned int vp8_sad8x16_c(const unsigned char *src_ptr, int src_stride,
                           const unsigned char *ref_ptr, int ref_stride,
                           int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 16);
}


x86 assembly (clang, -O0):
<vp8_sad8x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
call   1030 <sad_mx_n_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad8x16_c>:
mov    $0x8,%r8d
mov    $0x10,%r9d
jmp    1030 <sad_mx_n_c@plt>

LLVM IR (-O0):
define i32 @vp8_sad8x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = call i32 @sad_mx_n_c(i8* %11, i32 %12, i8* %13, i32 %14, i32 8, i32 16)
ret i32 %15
}

LLVM IR (-O2):
define i32 @vp8_sad8x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 8, i32 16)
ret i32 %6
}
/* Variables and functions */
int foo(int);
int obj5func2(int a) { return foo(a) + 44; }


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

x86 assembly (clang, -O2):
<obj5func2>:
push   %rax
call   1030 <foo@plt>
add    $0x2c,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @obj5func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = add nsw i32 %4, 44
ret i32 %5
}

LLVM IR (-O2):
define i32 @obj5func2(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = add nsw i32 %2, 44
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ return_sense(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void sam_medium_error(uint16_t ascq, uint8_t *sam_stat) {
  return_sense(0x03, ascq, NULL, sam_stat);
}


x86 assembly (clang, -O0):
<sam_medium_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <return_sense@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_medium_error>:
mov    %rsi,%rcx
mov    %edi,%esi
mov    $0x3,%edi
xor    %edx,%edx
jmp    1030 <return_sense@plt>

LLVM IR (-O0):
define void @sam_medium_error(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 @return_sense(i32 3, i32 %5, i32* null, i32* %6)
ret void
}

LLVM IR (-O2):
define void @sam_medium_error(i32 %0, i32* %1) {
%3 = tail call i32 @return_sense(i32 3, i32 %0, i32* null, i32* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint_least64_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint_least64_t(uint_least64_t const k1,
                                             uint_least64_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_uint_least64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_uint_least64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint_least64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint_least64_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned char *zcat(void *a, void *b) {
  strcat((char *)a, (char *)b);
  return a;
}


x86 assembly (clang, -O0):
<zcat>:
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 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zcat>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define i8* @zcat(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}