xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
uint64_t tv_delta_us(const struct timeval *new, const struct timeval *old) {
  return (((new->tv_sec - old->tv_sec) * 1000000) +
          (new->tv_usec - old->tv_usec));
}


x86 assembly (clang, -O0):
<tv_delta_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x10(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_delta_us>:
movslq (%rdi),%rax
movslq (%rsi),%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rcx
mov    0x8(%rdi),%rax
sub    0x8(%rsi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @tv_delta_us(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = sext i32 %12 to i64
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = add nsw i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @tv_delta_us(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add nsw i64 %14, %9
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ Write32(void *, int, int);
void omap_beagle_init(void) {
  Write32(((void *)0x48310000), 0x034, 0xfefffedf);
  Write32(((void *)0x48310000), 0x094, 0x01000120);
}


x86 assembly (clang, -O0):
<omap_beagle_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48310000,%edi
mov    $0x34,%esi
mov    $0xfefffedf,%edx
call   1030 <Write32@plt>
mov    $0x48310000,%edi
mov    $0x94,%esi
mov    $0x1000120,%edx
call   1030 <Write32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap_beagle_init>:
push   %rax
mov    $0x48310000,%edi
mov    $0x34,%esi
mov    $0xfefffedf,%edx
call   1030 <Write32@plt>
mov    $0x48310000,%edi
mov    $0x94,%esi
mov    $0x1000120,%edx
pop    %rax
jmp    1030 <Write32@plt>

LLVM IR (-O0):
define void @omap_beagle_init() {
%1 = call i32 @Write32(i8* inttoptr (i64 1211170816 to i8*), i32 52, i32 -16777505)
%2 = call i32 @Write32(i8* inttoptr (i64 1211170816 to i8*), i32 148, i32 16777504)
ret void
}

LLVM IR (-O2):
define void @omap_beagle_init() {
%1 = tail call i32 @Write32(i8* inttoptr (i64 1211170816 to i8*), i32 52, i32 -16777505)
%2 = tail call i32 @Write32(i8* inttoptr (i64 1211170816 to i8*), i32 148, i32 16777504)
ret void
}
int main() {
  int x;
  x = 1;
  for (x = 10; x; x = x - 1)
    ;
  if (x)
    return 1;
  x = 10;
  for (; x;)
    x = x - 1;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1136 <main+0x36>
jmp    1128 <main+0x28>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
cmpl   $0x0,-0x8(%rbp)
je     114c <main+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1171 <main+0x71>
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116b <main+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
float CombinedShannonEntropy(int const *, int const *);
float PredictionCostSpatial(int const *, int, double const);
float PredictionCostCrossColor(const int accumulated[256],
                               const int counts[256]) {
  static const double kExpValue = 2.4;
  return CombinedShannonEntropy(counts, accumulated) +
         PredictionCostSpatial(counts, 3, kExpValue);
}


x86 assembly (clang, -O0):
<PredictionCostCrossColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <CombinedShannonEntropy@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
movsd  0xead(%rip),%xmm0
call   1040 <PredictionCostSpatial@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PredictionCostCrossColor>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <CombinedShannonEntropy@plt>
movss  %xmm0,0xc(%rsp)
movsd  0xebf(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <PredictionCostSpatial@plt>
addss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PredictionCostCrossColor.kExpValue = internal constant double 2.400000e+00
define float @PredictionCostCrossColor(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32*, i32** %3
%7 = call float @CombinedShannonEntropy(i32* %5, i32* %6)
%8 = load i32*, i32** %4
%9 = call float @PredictionCostSpatial(i32* %8, i32 3, double 2.400000e+00)
%10 = fadd float %7, %9
ret float %10
}

LLVM IR (-O2):
define float @PredictionCostCrossColor(i32* %0, i32* %1) {
%3 = tail call float @CombinedShannonEntropy(i32* %1, i32* %0)
%4 = tail call float @PredictionCostSpatial(i32* %1, i32 3, double 2.400000e+00)
%5 = fadd float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ CC2420ControlP__StartupTimer__fired();
int /*<<< orphan*/ CC2420TransmitP__BackoffTimer__fired();
void TransformAlarmC__1__Alarm__fired(void) {
  CC2420TransmitP__BackoffTimer__fired();
  CC2420ControlP__StartupTimer__fired();
}


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

x86 assembly (clang, -O2):
<TransformAlarmC__1__Alarm__fired>:
push   %rax
xor    %eax,%eax
call   1040 <CC2420TransmitP__BackoffTimer__fired@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CC2420ControlP__StartupTimer__fired@plt>

LLVM IR (-O0):
define void @TransformAlarmC__1__Alarm__fired() {
%1 = call i32 (...) @CC2420TransmitP__BackoffTimer__fired()
%2 = call i32 (...) @CC2420ControlP__StartupTimer__fired()
ret void
}

LLVM IR (-O2):
define void @TransformAlarmC__1__Alarm__fired() {
%1 = tail call i32 (...) @CC2420TransmitP__BackoffTimer__fired()
%2 = tail call i32 (...) @CC2420ControlP__StartupTimer__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ acc_free(void *);
void *acc_malloc(int const);
int main(int argc, char **argv) {
  const int N = 512;
  void *d;
  d = acc_malloc(N);
  if (d == NULL)
    abort();
  acc_free((void *)((uintptr_t)d + (uintptr_t)(N >> 1)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x200,-0x14(%rbp)
mov    $0x200,%edi
call   1040 <acc_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116d <main+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rdi
add    $0x100,%rdi
call   1050 <acc_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x200,%edi
call   1040 <acc_malloc@plt>
test   %rax,%rax
je     1152 <main+0x22>
add    $0x100,%rax
mov    %rax,%rdi
call   1050 <acc_free@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 512, i32* %6
%8 = call i8* @acc_malloc(i32 512)
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %7
%15 = ptrtoint i8* %14 to i64
%16 = add i64 %15, 256
%17 = inttoptr i64 %16 to i8*
%18 = call i32 @acc_free(i8* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @acc_malloc(i32 512)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = add i64 %8, 256
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @acc_free(i8* %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_abs_d(double *, double);
double xil_fpo_abs_d(double a) {
  double res_d;
  xip_fpo_abs_d(&res_d, a);
  return res_d;
}


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

x86 assembly (clang, -O2):
<xil_fpo_abs_d>:
push   %rax
mov    %rsp,%rdi
call   1030 <xip_fpo_abs_d@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xil_fpo_abs_d(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @xip_fpo_abs_d(double* %3, double %4)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @xil_fpo_abs_d(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @xip_fpo_abs_d(double* %2, double %0)
%5 = load double, double* %2
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setresgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setresgid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setresgid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setresgid(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void gtk_input_dialog_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_input_dialog_get_type() {
ret void
}
unsigned hashCrc(char *string) {
  unsigned char *us = (unsigned char *)string;
  unsigned char c;
  unsigned shiftAcc = 0;
  unsigned addAcc = 0;
  while ((c = *us++) != 0) {
    shiftAcc <<= 2;
    shiftAcc += c;
    addAcc += c;
  }
  return shiftAcc + addAcc;
}


x86 assembly (clang, -O0):
<hashCrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     1160 <hashCrc+0x60>
mov    -0x18(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x18(%rbp)
movzbl -0x11(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
movzbl -0x11(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <hashCrc+0x1e>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashCrc>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <hashCrc+0x26>
add    $0x1,%rdi
xor    %eax,%eax
xor    %edx,%edx
xchg   %ax,%ax
movzbl %cl,%ecx
lea    (%rcx,%rdx,4),%edx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashCrc+0x10>
add    %edx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hashCrc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
store i8* %7, i8** %3
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %14, %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
store i8 %11, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %8
%15 = load i32, i32* %5
%16 = shl i32 %15, 2
store i32 %16, i32* %5
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = load i32, i32* %5
%20 = add i32 %19, %18
store i32 %20, i32* %5
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = load i32, i32* %6
%24 = add i32 %23, %22
store i32 %24, i32* %6
br label %8
25: ; preds = %8
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = add i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @hashCrc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = phi i8* [ %10, %4 ], [ %0, %1 ]
%9 = zext i8 %5 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = shl i32 %7, 2
%12 = add i32 %11, %9
%13 = add i32 %6, %9
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = add i32 %13, %12
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ %17, %16 ], [ 0, %1 ]
ret i32 %19
}
void gtk_entry_completion_insert_action_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_insert_action_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void test4_heap_overflow(char *buff1) {
  strcpy(buff1, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBB");
}


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

x86 assembly (clang, -O2):
<test4_heap_overflow>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBB\00"
define void @test4_heap_overflow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBB\00"
define void @test4_heap_overflow(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void del_ivec(int *p) {
  free(p);
  p = NULL;
}


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

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

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

LLVM IR (-O2):
define void @del_ivec(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
int checkChar(char character) {
  return character == 'A' || character == 'G' || character == 'C' ||
         character == 'T';
}


x86 assembly (clang, -O0):
<checkChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
je     114d <checkChar+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x47,%ecx
mov    %al,-0x2(%rbp)
je     114d <checkChar+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x43,%ecx
mov    %al,-0x2(%rbp)
je     114d <checkChar+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x54,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkChar>:
lea    -0x41(%rdi),%ecx
cmp    $0x6,%cl
ja     111b <checkChar+0x1b>
mov    $0x1,%eax
movzbl %cl,%ecx
mov    $0x45,%edx
bt     %ecx,%edx
jae    111b <checkChar+0x1b>
ret
xor    %eax,%eax
cmp    $0x54,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @checkChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 65
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 71
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 67
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 84
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @checkChar(i8 signext %0) {
switch i8 %0, label %2 [
i8 71, label %5
i8 67, label %5
i8 65, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 84
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nbom dia, ola mundo\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0Abom dia, ola mundo\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"\0Abom dia, ola mundo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ eeprom_read_byte(scalar_t__ *);
int /*<<< orphan*/ eeprom_write_byte(scalar_t__ *, scalar_t__);
void eeprom_update_byte(uint8_t *addr, uint8_t value) {
  uint8_t orig = eeprom_read_byte(addr);
  if (orig != value) {
    eeprom_write_byte(addr, value);
  }
}


x86 assembly (clang, -O0):
<eeprom_update_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <eeprom_read_byte@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1158 <eeprom_update_byte+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <eeprom_write_byte@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_update_byte>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <eeprom_read_byte@plt>
cmp    %r14,%rax
jne    113c <eeprom_update_byte+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <eeprom_write_byte@plt>

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

LLVM IR (-O2):
define void @eeprom_update_byte(i64* %0, i64 %1) {
%3 = tail call i64 @eeprom_read_byte(i64* %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @eeprom_write_byte(i64* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
float fSum(float, float);
float fDiff(float a, float b) { return fSum(a, -b); }


x86 assembly (clang, -O0):
<fDiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
call   1030 <fSum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fDiff>:
xorps  0xee9(%rip),%xmm1
jmp    1030 <fSum@plt>

LLVM IR (-O0):
define float @fDiff(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 = fneg float %6
%8 = call float @fSum(float %5, float %7)
ret float %8
}

LLVM IR (-O2):
define float @fDiff(float %0, float %1) {
%3 = fneg float %1
%4 = tail call float @fSum(float %0, float %3)
ret float %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmapping_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmapping.serial = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xmapping_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
float platform_randomf(float min, float max) { return 0.0f; }


x86 assembly (clang, -O0):
<platform_randomf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_randomf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @platform_randomf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @platform_randomf(float %0, float %1) {
ret float 0.000000e+00
}
const char *alsophila_get_version(void) {
  static const char *const str = "SVN";
  return str;
}


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

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

LLVM IR (-O0):
@alsophila_get_version.str = internal constant i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
@.str = [4 x i8] c"SVN\00"
define i8* @alsophila_get_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"SVN\00"
define i8* @alsophila_get_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int test10(int a) { return a >= 0 ? 0x7FFFFFFF : 0x80000000; }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x80000000,%eax
mov    $0x7fffffff,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
shr    $0x1f,%edi
lea    0x7fffffff(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 2147483647, i32 -2147483648
ret i32 %6
}

LLVM IR (-O2):
define i32 @test10(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 2147483647, i32 -2147483648
ret i32 %3
}
int argc_count(char *opts) {
  int i = 0;
  while (*opts != '\0') {
    if (*opts++ == ' ') {
      i++;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<argc_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <argc_count+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1143 <argc_count+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <argc_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argc_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <argc_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x20,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <argc_count+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @argc_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %9
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @argc_count(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 32
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
struct json_object *json_object_from_file(char *filename) {
  struct printbuf *pb;
  struct json_object *obj;
  char buf[4096];
  int fd, ret;
  return obj;
}


x86 assembly (clang, -O0):
<json_object_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfb0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.json_object = type opaque
%struct.printbuf = type opaque
define %struct.json_object* @json_object_from_file(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.printbuf*
%4 = alloca %struct.json_object*
%5 = alloca [4096 x i8]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
%8 = load %struct.json_object*, %struct.json_object** %4
ret %struct.json_object* %8
}

LLVM IR (-O2):
%struct.json_object = type opaque
%struct.printbuf = type opaque
define noalias %struct.json_object* @json_object_from_file(i8* nocapture readnone %0) {
ret %struct.json_object* undef
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOW;
int /*<<< orphan*/ *dlopen(char *, int /*<<< orphan*/);
bool foo() { return (dlopen("./libbar.dylib", RTLD_NOW) != NULL); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <dlopen@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <dlopen@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"./libbar.dylib\00"
@RTLD_NOW = global i32 0
define i32 @foo() {
%1 = load i32, i32* @RTLD_NOW
%2 = call i32* @dlopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"./libbar.dylib\00"
@RTLD_NOW = global i32 0
define i32 @foo() {
%1 = load i32, i32* @RTLD_NOW
%2 = tail call i32* @dlopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int open(char const *, int, int);
int /*<<< orphan*/ printf(char *, char const *);
int my_open(const char *__filename, int flag, int mode) {
  printf("CALLWATCH: "
         "Open %s \n",
         __filename);
  return open(__filename, flag, mode);
}


x86 assembly (clang, -O0):
<my_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_open>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <open@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"CALLWATCH: Open %s \0A\00"
define i32 @my_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @open(i8* %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [21 x i8] c"CALLWATCH: Open %s \0A\00"
define i32 @my_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int number_width(int);
int u_str_width(char const *);
int tab_title_width(int number, const char *filename) {
  return 3 + number_width(number) + u_str_width(filename);
}


x86 assembly (clang, -O0):
<tab_title_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <number_width@plt>
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <u_str_width@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tab_title_width>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <number_width@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <u_str_width@plt>
add    %r14d,%eax
add    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @tab_title_width(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @number_width(i32 %5)
%7 = add nsw i32 3, %6
%8 = load i8*, i8** %4
%9 = call i32 @u_str_width(i8* %8)
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @tab_title_width(i32 %0, i8* %1) {
%3 = tail call i32 @number_width(i32 %0)
%4 = add nsw i32 %3, 3
%5 = tail call i32 @u_str_width(i8* %1)
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void time_out() {
  int cas = 3;
  sleep(cas);
  kill(getppid(), SIGTERM);
  exit(-1);
}


x86 assembly (clang, -O0):
<time_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1040 <getppid@plt>
mov    %eax,%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<time_out>:
push   %rax
mov    $0x3,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1040 <getppid@plt>
mov    0x2e8f(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1030 <kill@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @time_out() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @sleep(i32 %2)
%4 = call i32 (...) @getppid()
%5 = load i32, i32* @SIGTERM
%6 = call i32 @kill(i32 %4, i32 %5)
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @time_out() {
%1 = tail call i32 @sleep(i32 3)
%2 = tail call i32 (...) @getppid()
%3 = load i32, i32* @SIGTERM
%4 = tail call i32 @kill(i32 %2, i32 %3)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: discard\n", stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Usage: discard\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"Usage: discard\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
double castToDouble(long num) {
  double a;
  a = (double)num;
  return (a);
}


x86 assembly (clang, -O0):
<castToDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<castToDouble>:
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @castToDouble(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @castToDouble(i64 %0) {
%2 = sitofp i64 %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void local_error() {
  fprintf(stderr, "Number too large, or invalid option. \n");
  exit(1);
}


x86 assembly (clang, -O0):
<local_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<local_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Number too large, or invalid option. \0A\00"
define void @local_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Number too large, or invalid option. \0A\00"
define void @local_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Inner(int x) {
  printf("Bar: x=%d\n", x);
  if (x == 10)
    Inner(12);
}


x86 assembly (clang, -O0):
<Inner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0xa,-0x4(%rbp)
jne    114e <Inner+0x2e>
mov    $0xc,%edi
call   1030 <Inner@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inner>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0xa,%ebx
jne    1138 <Inner+0x28>
lea    0xed3(%rip),%rdi
mov    $0xc,%esi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Bar: x=%d\0A\00"
define void @Inner(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i32 %0, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 12)
br label %6
6: ; preds = %4, %1
ret void
}
int output_frames_src_48_to_16(int input_frames) {
  if ((input_frames % 3) != 0 || input_frames > 960)
    return -1;
  return input_frames / 3;
}


x86 assembly (clang, -O0):
<output_frames_src_48_to_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1128 <output_frames_src_48_to_16+0x28>
cmpl   $0x3c0,-0x8(%rbp)
jle    1134 <output_frames_src_48_to_16+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <output_frames_src_48_to_16+0x42>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_frames_src_48_to_16>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%edx
cmp    %edx,%ecx
mov    $0xffffffff,%edx
cmovne %edx,%eax
cmp    $0x3c1,%ecx
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @output_frames_src_48_to_16(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = icmp sgt i32 %0, 960
%5 = or i1 %4, %3
%6 = sdiv i32 %0, 3
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
int numeric(const char c) {
  if (c >= '0' && c <= '9') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <numeric+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <numeric+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <numeric+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr_fd(char const *, int);
void ft_putendl_fd(char const *s, int fd) {
  ft_putstr_fd(s, fd);
  ft_putstr_fd("\n", fd);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ft_putstr_fd@plt>
mov    -0xc(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <ft_putstr_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbx
mov    %esi,%ebx
call   1030 <ft_putstr_fd@plt>
lea    0xee1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <ft_putstr_fd@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @ft_putstr_fd(i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @ft_putstr_fd(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_putstr_fd(i8* %0, i32 %1)
%4 = tail call i32 @ft_putstr_fd(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int japi_getheight(int);
int j_getheight(int arg0) { return (japi_getheight(arg0)); }


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

x86 assembly (clang, -O2):
<j_getheight>:
jmp    1030 <japi_getheight@plt>

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

LLVM IR (-O2):
define i32 @j_getheight(i32 %0) {
%2 = tail call i32 @japi_getheight(i32 %0)
ret i32 %2
}
int strcoll(const char *str1, const char *str2) {
  (void)str1;
  (void)str2;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @strcoll(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
ret i32 0
}

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigalrm_handler() { exit(0); }


x86 assembly (clang, -O0):
<sigalrm_handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigalrm_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigalrm_handler() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigalrm_handler() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shmdt(void **);
void cleanUp(void **sharedMemPtr) {
  printf("Detaching from shared memory\n");
  shmdt(sharedMemPtr);
}


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

x86 assembly (clang, -O2):
<cleanUp>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <shmdt@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Detaching from shared memory\0A\00"
define void @cleanUp(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = call i32 @shmdt(i8** %4)
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Detaching from shared memory\00"
define void @cleanUp(i8** %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @shmdt(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR54_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR54_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR54_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}