xunge/DecIR huggingface dataset:
int vde_chain_nm10_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 114;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm10_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm10_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm10_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm10_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm10_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x72,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm10_work>:
test   %rdi,%rdi
je     110b <vde_chain_nm10_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm10_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm10_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm10_work+0x2c>
movl   $0x72,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm10_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 114, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_X(int, int, int, int, int, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
void create_balloon(int x, int y, int z, int colour) {
  RCT2_CALLPROC_X(0x006736C7, x, colour << 8, y, z, 0, 0, 0);
}


x86 assembly (clang, -O0):
<create_balloon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
shl    $0x8,%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    $0x6736c7,%edi
xor    %r9d,%r9d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_balloon>:
push   %rax
mov    %edx,%r8d
mov    %esi,%eax
mov    %edi,%esi
shl    $0x8,%ecx
mov    $0x6736c7,%edi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @create_balloon(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = shl i32 %10, 8
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @RCT2_CALLPROC_X(i32 6764231, i32 %9, i32 %11, i32 %12, i32 %13, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @create_balloon(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 8
%6 = tail call i32 @RCT2_CALLPROC_X(i32 6764231, i32 %0, i32 %5, i32 %1, i32 %2, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ listdir(char *);
int main(int argc, char *argv[]) {
  listdir(argv[1]);
  return (0);
}


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
call   1030 <listdir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @listdir(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @listdir(i8* %4)
ret i32 0
}
char _Locale_thousands_sep(struct _Locale_numeric *__DUMMY_PAR) { return ','; }


x86 assembly (clang, -O0):
<_Locale_thousands_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2c,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_thousands_sep>:
mov    $0x2c,%al
ret

LLVM IR (-O0):
%struct._Locale_numeric = type opaque
define signext i8 @_Locale_thousands_sep(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8 44
}

LLVM IR (-O2):
%struct._Locale_numeric = type opaque
define signext i8 @_Locale_thousands_sep(%struct._Locale_numeric* nocapture readnone %0) {
ret i8 44
}
sum(a, b) {
  int z;
  z = a + b;
}


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
ret i32 undef
}
int f_bge_mm1(float *a1, float *a2) {
  return (__builtin_isgreaterequal(*a1, *a2));
}


x86 assembly (clang, -O0):
<f_bge_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bge_mm1>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_bge_mm1(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* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp oge float %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_bge_mm1(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp oge float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Proc0();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  Proc0();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Proc0@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Proc0()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Proc0()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close_log();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ info_log(char *);
void acid_shutdown(int errorlevel) {
  info_log("shutting down\n");
  close_log();
  exit(errorlevel);
}


x86 assembly (clang, -O0):
<acid_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <info_log@plt>
mov    $0x0,%al
call   1030 <close_log@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<acid_shutdown>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <info_log@plt>
xor    %eax,%eax
call   1030 <close_log@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"shutting down\0A\00"
define void @acid_shutdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @info_log(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @close_log()
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"shutting down\0A\00"
define void @acid_shutdown(i32 %0) {
%2 = tail call i32 @info_log(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @close_log()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
size_t __ht_unfold_hash(size_t fhash, int M) {
  fhash &= ~((size_t)1 << ((sizeof(size_t) * 8) - 1));
  fhash = (fhash >> ((sizeof(size_t) * 8) - M - 1)) | (fhash << M);
  return fhash & ~((size_t)1 << ((sizeof(size_t) * 8) - 1));
}


x86 assembly (clang, -O0):
<__ht_unfold_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
mov    $0x40,%ecx
sub    %rdx,%rcx
sub    $0x1,%rcx
shr    %cl,%rax
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
shl    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ht_unfold_hash>:
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
mov    %rdi,%rax
and    %rdx,%rax
mov    $0x3f,%cl
sub    %sil,%cl
shr    %cl,%rax
mov    %esi,%ecx
shl    %cl,%rdi
or     %rdi,%rax
and    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @__ht_unfold_hash(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = and i64 %5, 9223372036854775807
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = sub i64 64, %9
%11 = sub i64 %10, 1
%12 = lshr i64 %7, %11
%13 = load i64, i64* %3
%14 = load i32, i32* %4
%15 = zext i32 %14 to i64
%16 = shl i64 %13, %15
%17 = or i64 %12, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = and i64 %18, 9223372036854775807
ret i64 %19
}

LLVM IR (-O2):
define i64 @__ht_unfold_hash(i64 %0, i32 %1) {
%3 = and i64 %0, 9223372036854775807
%4 = sext i32 %1 to i64
%5 = sub nsw i64 63, %4
%6 = lshr i64 %3, %5
%7 = zext i32 %1 to i64
%8 = shl i64 %0, %7
%9 = or i64 %6, %8
%10 = and i64 %9, 9223372036854775807
ret i64 %10
}
/* Variables and functions */
int abs(int);
int JoyClear(int origVal) {
  if (abs(origVal) < 10)
    return 0;
  else
    return origVal;
}


x86 assembly (clang, -O0):
<JoyClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0xa,%eax
jge    1138 <JoyClear+0x28>
movl   $0x0,-0x4(%rbp)
jmp    113e <JoyClear+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JoyClear>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @JoyClear(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp ult i32 %2, 10
%4 = select i1 %3, i32 0, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void cmp_reg64_reg64(int reg1, int reg2) {
  put8(0x48);
  put8(0x39);
  put8((reg2 << 3) | reg1 | 0xC0);
}


x86 assembly (clang, -O0):
<cmp_reg64_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x39,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     -0x4(%rbp),%edi
or     $0xc0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_reg64_reg64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x39,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_reg64_reg64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 57)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = or i32 %10, 192
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @cmp_reg64_reg64(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 57)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xdc() {
  Assert_real((isalnum(220) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1105, ("isalnum should be 0 for 0xdc"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xdc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdc,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x451,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xdc>:
push   %rax
mov    $0xdc,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x451,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xdc\00"
define void @t_isalnum_0xdc() {
%1 = call i64 @isalnum(i32 220)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xdc\00"
define void @t_isalnum_0xdc() {
%1 = tail call i64 @isalnum(i32 220)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
g(int *p) { return 0 == p; }


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

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @g(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* null, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @g(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
char *Exec(char *soData, int *replylen) {
  printf("\nIn Test.c, SoData : %s\n", soData);
  *replylen = 40;
  char *replystr = (char *)malloc(*replylen);
  sprintf(replystr, "jackettest");
  return replystr;
}


x86 assembly (clang, -O0):
<Exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x28,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exec>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x28,(%rbx)
mov    $0x28,%edi
call   1040 <malloc@plt>
movabs $0x657474656b63616a,%rcx
74 74 65
mov    %rcx,(%rax)
movl   $0x747365,0x7(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0AIn Test.c, SoData : %s\0A\00"
@.str.1 = [11 x i8] c"jackettest\00"
define i8* @Exec(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
store i32 40, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AIn Test.c, SoData : %s\0A\00"
@.str.1 = [11 x i8] c"jackettest\00"
define i8* @Exec(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
store i32 40, i32* %1
%4 = tail call i64 @malloc(i32 40)
%5 = inttoptr i64 %4 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(11) %5, i8* align 1 dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 11, i1 false)
ret i8* %5
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzFalseVariable_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int, int);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_REQDOWN(int);
void BrzFalseVariable_reqdown(struct comp *comp, int port) {
  struct BrzFalseVariable_ *c = (struct BrzFalseVariable_ *)comp;
  if (port == 0) {
    SEND_REQDOWN(1);
  } else {
    SEND_DATAOFF_DELAYED(port, 0);
    SEND_ACKDOWN_DELAYED(port, 1);
  }
}


x86 assembly (clang, -O0):
<BrzFalseVariable_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1160 <BrzFalseVariable_reqdown+0x30>
mov    $0x1,%edi
call   1050 <SEND_REQDOWN@plt>
jmp    1177 <BrzFalseVariable_reqdown+0x47>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzFalseVariable_reqdown>:
test   %esi,%esi
je     114d <BrzFalseVariable_reqdown+0x1d>
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
xor    %esi,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <SEND_ACKDOWN_DELAYED@plt>
mov    $0x1,%edi
jmp    1050 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzFalseVariable_ = type { i32 }
define void @BrzFalseVariable_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzFalseVariable_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzFalseVariable_*
store %struct.BrzFalseVariable_* %7, %struct.BrzFalseVariable_** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @SEND_REQDOWN(i32 1)
br label %17
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @SEND_DATAOFF_DELAYED(i32 %13, i32 0)
%15 = load i32, i32* %4
%16 = call i32 @SEND_ACKDOWN_DELAYED(i32 %15, i32 1)
br label %17
17: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzFalseVariable_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @SEND_REQDOWN(i32 1)
br label %9
6: ; preds = %2
%7 = tail call i32 @SEND_DATAOFF_DELAYED(i32 %1, i32 0)
%8 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 %1, i32 1)
br label %9
9: ; preds = %6, %4
ret void
}
int test5(int a) { return 3 * 3 + (5 % 3 % 2) * 4 * 4; }


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

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

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

LLVM IR (-O2):
define i32 @test5(i32 %0) {
ret i32 9
}
signed long int feed_device_null_write(void *const p_context,
                                       unsigned char const *const p_buf,
                                       unsigned long int const i_buf_len) {
  (void)(p_context);
  (void)(p_buf);
  (void)(i_buf_len);
  return -1;
}


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

x86 assembly (clang, -O2):
<feed_device_null_write>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @feed_device_null_write(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
clrtoeol() { addstr("\e[K"); }


x86 assembly (clang, -O0):
<clrtoeol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <addstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[K\00"
define i32 @clrtoeol() {
%1 = alloca i32
%2 = call i32 @addstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[K\00"
define i32 @clrtoeol() {
%1 = tail call i32 @addstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned int strlen(char *);
scalar_t__ toupper(int);
void upper(char *string) {
  register unsigned int i;
  for (i = 0; i < strlen(string); ++i)
    string[i] = (char)toupper((int)string[i]);
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    1179 <upper+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <upper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
je     1161 <upper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jb     1140 <upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @upper(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp ult i32 %5, %7
br i1 %8, label %9, label %25
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i64 @toupper(i32 %15)
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %9
%23 = load i32, i32* %3
%24 = add i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @upper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i64 @toupper(i32 %8)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %6
%11 = add nuw nsw i64 %5, 1
%12 = tail call i32 @strlen(i8* %0)
%13 = zext i32 %12 to i64
%14 = icmp ult i64 %11, %13
br i1 %14, label %4, label %15
15: ; preds = %4, %1
ret void
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int val = foo();
  if (val != 34) {
    printf("foo () returned %d\n", val);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x22,-0x8(%rbp)
je     115e <main+0x3e>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x22,%eax
je     1142 <main+0x22>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"foo () returned %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 34
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ die(char const *);
int errno;
void die_errnum(const char *msg, int errnum) {
  errno = errnum;
  die(msg);
}


x86 assembly (clang, -O0):
<die_errnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2eb7(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_errnum>:
mov    0x2ec9(%rip),%rax
mov    %esi,(%rax)
jmp    1030 <die@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define void @die_errnum(i8* %0, i32 %1) {
store i32 %1, i32* @errno
%3 = tail call i32 @die(i8* %0)
ret void
}
int main() {
  int i;
  while (1) {
    i = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
store i32 1, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ do_list_rules(int /*<<< orphan*/, int /*<<< orphan*/);
list_all_rules() { do_list_rules(0, 0); }


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

x86 assembly (clang, -O2):
<list_all_rules>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <do_list_rules@plt>

LLVM IR (-O0):
define i32 @list_all_rules() {
%1 = alloca i32
%2 = call i32 @do_list_rules(i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @list_all_rules() {
%1 = tail call i32 @do_list_rules(i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printheader(const char *file) {
  static int first = 1;
  if (first) {
    first = 0;
  } else {
    printf("\n");
  }
  printf("%s:\n", file);
}


x86 assembly (clang, -O0):
<printheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2f05(%rip)
je     1138 <printheader+0x28>
movl   $0x0,0x2ef5(%rip)
jmp    1146 <printheader+0x36>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printheader>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x2f09(%rip)
je     1139 <printheader+0x19>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <printheader+0x20>
movb   $0x1,0x2ef4(%rip)
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@printheader.first = internal unnamed_addr global i1 false
@.str.1 = [5 x i8] c"%s:\0A\00"
define void @printheader(i8* %0) {
%2 = load i1, i1* @printheader.first
br i1 %2, label %4, label %3
3: ; preds = %1
store i1 true, i1* @printheader.first
br label %6
4: ; preds = %1
%5 = tail call i32 @putchar(i32 10)
br label %6
6: ; preds = %4, %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, size_t const);
void *malloc(size_t const);
void *xmalloc(const size_t size) {
  void *tmp = malloc(size);
  if (tmp == NULL) {
    err(100, "Malloc call failed - attempted %zu bytes", size);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <xmalloc+0x39>
mov    -0x8(%rbp),%rdx
mov    $0x64,%edi
lea    0xeac(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <xmalloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x64,%edi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Malloc call failed - attempted %zu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @err(i32 100, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [41 x i8] c"Malloc call failed - attempted %zu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 100, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char *, int);
unsigned int wkd_ctx_get(unsigned char *buf, int reg) {
  unsigned int ret;
  memcpy(&ret, buf + reg, sizeof(ret));
  return ret;
}


x86 assembly (clang, -O0):
<wkd_ctx_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wkd_ctx_get>:
push   %rax
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wkd_ctx_get(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = call i32 @memcpy(i32* %5, i8* %9, i32 4)
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @wkd_ctx_get(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = call i32 @memcpy(i32* %3, i8* %6, i32 4)
%8 = load i32, i32* %3
ret i32 %8
}
int count_number_of_chars(char *o, char d) {
  int c = 0;
  while (*o) {
    if (*o == d)
      c++;
    o++;
  }
  return (c);
}


x86 assembly (clang, -O0):
<count_number_of_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <count_number_of_chars+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <count_number_of_chars+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <count_number_of_chars+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @count_number_of_chars(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ SA1Direct(int);
int /*<<< orphan*/ STY8(int /*<<< orphan*/);
void Op84X1(void) { STY8(SA1Direct(2)); }


x86 assembly (clang, -O0):
<Op84X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
call   1040 <STY8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op84X1>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STY8@plt>

LLVM IR (-O0):
define void @Op84X1() {
%1 = call i32 @SA1Direct(i32 2)
%2 = call i32 @STY8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op84X1() {
%1 = tail call i32 @SA1Direct(i32 2)
%2 = tail call i32 @STY8(i32 %1)
ret void
}
void NV21ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @NV21ToARGB() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *openfile_wt(char *filename) {
  FILE *stream;
  if ((stream = fopen(filename, "wt")) == NULL) {
    fprintf(stderr, "ERROR (write) : opening file: %s \n", filename);
    exit(1);
  }
  return stream;
}


x86 assembly (clang, -O0):
<openfile_wt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117d <openfile_wt+0x4d>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openfile_wt>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <openfile_wt+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wt\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"ERROR (write) : opening file: %s \0A\00"
define i32* @openfile_wt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"wt\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"ERROR (write) : opening file: %s \0A\00"
define noalias i32* @openfile_wt(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ parse_commandline(int, char **);
int /*<<< orphan*/ send();
int main(int argc, char *argv[]) {
  parse_commandline(argc, argv);
  send();
  exit(0);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_commandline@plt>
mov    $0x0,%al
call   1030 <send@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
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 = call i32 @parse_commandline(i32 %6, i8** %7)
%9 = call i32 (...) @send()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_commandline(i32 %0, i8** %1)
%4 = tail call i32 (...) @send()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, char *);
void hrt(double x, double y, char c[]) {
  printf("        <text x=\"%.2fin\" y=\"%.2fin\" font-family=\"Verdana\" "
         "font-size=\"25\">%s</text>\n",
         x + 0.2, y + 0.9, c);
}


x86 assembly (clang, -O0):
<hrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xeda(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrt>:
addsd  0xee8(%rip),%xmm0
mov    %rdi,%rsi
addsd  0xee5(%rip),%xmm1
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [84 x i8] c" <text x=\22%.2fin\22 y=\22%.2fin\22 font-family=\22Verdana\22 font-size=\2225\22>%s</text>\0A\00"
define void @hrt(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = fadd double %7, 2.000000e-01
%9 = load double, double* %5
%10 = fadd double %9, 9.000000e-01
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), double %8, double %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [84 x i8] c" <text x=\22%.2fin\22 y=\22%.2fin\22 font-family=\22Verdana\22 font-size=\2225\22>%s</text>\0A\00"
define void @hrt(double %0, double %1, i8* %2) {
%4 = fadd double %0, 2.000000e-01
%5 = fadd double %1, 9.000000e-01
%6 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), double %4, double %5, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned long);
void mov_reg32_m32(unsigned long reg32, void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x8B);
  put8((reg32 << 3) | 5);
  put32((unsigned long)(m32));
}


x86 assembly (clang, -O0):
<mov_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
or     $0x5,%rdi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x8b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%rdi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg32_m32(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i64 139)
%9 = load i64, i64* %3
%10 = shl i64 %9, 3
%11 = or i64 %10, 5
%12 = call i32 @put8(i64 %11)
%13 = load i64*, i64** %5
%14 = ptrtoint i64* %13 to i64
%15 = call i32 @put32(i64 %14)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_m32(i64 %0, i8* %1) {
%3 = tail call i32 @put8(i64 139)
%4 = shl i64 %0, 3
%5 = or i64 %4, 5
%6 = tail call i32 @put8(i64 %5)
%7 = ptrtoint i8* %1 to i64
%8 = tail call i32 @put32(i64 %7)
ret void
}
void ASN1_item_dup(void) {}


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

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

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

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