xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_set_standard_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 0;
  ptos[1] = 1;
  fail = _ada_use_c2phc(618, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_set_standard_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26a,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_set_standard_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000000,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26a,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_set_standard_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 618, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_set_standard_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 618, i32* %6, i32* %3, double* %1)
ret i32 %8
}
void DeleteDynArray(int **iArray, int iRow) {
  int i;
  for (i = 0; i < iRow; i++)
    free(iArray[i]);
  free(iArray);
}


x86 assembly (clang, -O0):
<DeleteDynArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <DeleteDynArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <DeleteDynArray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteDynArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <DeleteDynArray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <DeleteDynArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DeleteDynArray(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ check_C1(int /*<<< orphan*/ *);
int /*<<< orphan*/ check_T(int /*<<< orphan*/ *);
int check_C(FILE *src) {
  if (!check_T(src)) {
    return 0;
  }
  if (!check_C1(src)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <check_T@plt>
cmp    $0x0,%eax
jne    114a <check_C+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    116f <check_C+0x4f>
mov    -0x10(%rbp),%rdi
call   1040 <check_C1@plt>
cmp    $0x0,%eax
jne    1168 <check_C+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <check_C+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_C>:
push   %rbx
mov    %rdi,%rbx
call   1030 <check_T@plt>
test   %eax,%eax
je     1140 <check_C+0x20>
mov    %rbx,%rdi
call   1040 <check_C1@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_C(i32* %0) {
%2 = tail call i32 @check_T(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @check_C1(i32* %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
double fabs(double x) {
  if (x < 0.0) {
    x = -x;
  }
  return (x);
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1138 <fabs+0x38>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ failUpdate();
int /*<<< orphan*/ mysql_close(int /*<<< orphan*/ *);
int mysql_errno(int /*<<< orphan*/ *);
char *mysql_error(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, int, char *);
void mysqlErrAndExit(MYSQL *dbconn, char *text) {
  printf("MySQL Error, %s: %u: %s\n", text, mysql_errno(dbconn),
         mysql_error(dbconn));
  failUpdate();
  mysql_close(dbconn);
  exit(1);
}


x86 assembly (clang, -O0):
<mysqlErrAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mysql_errno@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <mysql_error@plt>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    %rax,%rcx
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <failUpdate@plt>
mov    -0x8(%rbp),%rdi
call   1060 <mysql_close@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<mysqlErrAndExit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <mysql_errno@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <mysql_error@plt>
lea    0xe80(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %rax,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <failUpdate@plt>
mov    %rbx,%rdi
call   1060 <mysql_close@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"MySQL Error, %s: %u: %s\0A\00"
define void @mysqlErrAndExit(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @mysql_errno(i32* %6)
%8 = load i32*, i32** %3
%9 = call i8* @mysql_error(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7, i8* %9)
%11 = call i32 (...) @failUpdate()
%12 = load i32*, i32** %3
%13 = call i32 @mysql_close(i32* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"MySQL Error, %s: %u: %s\0A\00"
define void @mysqlErrAndExit(i32* %0, i8* %1) {
%3 = tail call i32 @mysql_errno(i32* %0)
%4 = tail call i8* @mysql_error(i32* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3, i8* %4)
%6 = tail call i32 (...) @failUpdate()
%7 = tail call i32 @mysql_close(i32* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sr_sleep(uint64_t ns) {
  struct timespec ts;
  ts.tv_sec = 0;
  ts.tv_nsec = ns;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<sr_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_sleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @sr_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @sr_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
size_t genrandom() {
  double r = (double)rand() / (double)RAND_MAX;
  r *= (10000000 - 1);
  r += 1;
  return (size_t)r;
}


x86 assembly (clang, -O0):
<genrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebd(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrandom>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0xecb(%rip),%xmm0
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xebf(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i64 @genrandom() {
%1 = alloca double
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
store double %6, double* %1
%7 = load double, double* %1
%8 = fmul double %7, 0x416312CFE0000000
store double %8, double* %1
%9 = load double, double* %1
%10 = fadd double %9, 1.000000e+00
store double %10, double* %1
%11 = load double, double* %1
%12 = fptoui double %11 to i64
ret i64 %12
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i64 @genrandom() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
%6 = fmul double %5, 0x416312CFE0000000
%7 = fadd double %6, 1.000000e+00
%8 = fptoui double %7 to i64
ret i64 %8
}
int func(n) {
  int i;
  for (i = 0; i < 10000; i++) {
    long arr[n];
  }
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    1142 <func+0x42>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <func+0x12>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main() {
  write(0, "hello world\n", 12);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
mov    $0xc,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ CG_CenterPrint(int /*<<< orphan*/, int, int);
void CG_CenterPrint_f(void) { CG_CenterPrint(CG_Argv(1), 480 * 0.30, 16); }


x86 assembly (clang, -O0):
<CG_CenterPrint_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <CG_Argv@plt>
mov    %eax,%edi
mov    $0x90,%esi
mov    $0x10,%edx
call   1030 <CG_CenterPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_CenterPrint_f>:
push   %rax
mov    $0x1,%edi
call   1040 <CG_Argv@plt>
mov    %eax,%edi
mov    $0x90,%esi
mov    $0x10,%edx
pop    %rax
jmp    1030 <CG_CenterPrint@plt>

LLVM IR (-O0):
define void @CG_CenterPrint_f() {
%1 = call i32 @CG_Argv(i32 1)
%2 = call i32 @CG_CenterPrint(i32 %1, i32 144, i32 16)
ret void
}

LLVM IR (-O2):
define void @CG_CenterPrint_f() {
%1 = tail call i32 @CG_Argv(i32 1)
%2 = tail call i32 @CG_CenterPrint(i32 %1, i32 144, i32 16)
ret void
}
void set_delete(struct set *set) {}


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

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

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

LLVM IR (-O2):
%struct.set = type opaque
define void @set_delete(%struct.set* nocapture %0) {
ret void
}
unsigned long int hash_djb2(const unsigned char *str) {
  unsigned long int hash;
  int c;
  hash = 5381;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return (hash);
}


x86 assembly (clang, -O0):
<hash_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_djb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash_djb2+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_djb2(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 i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %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 i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
struct cirbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __cirbuf_add_tail(struct cirbuf *, char);
void cirbuf_add_tail(struct cirbuf *cbuf, char c) {
  __cirbuf_add_tail(cbuf, c);
}


x86 assembly (clang, -O0):
<cirbuf_add_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <__cirbuf_add_tail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cirbuf_add_tail>:
jmp    1030 <__cirbuf_add_tail@plt>

LLVM IR (-O0):
%struct.cirbuf = type { i32 }
define void @cirbuf_add_tail(%struct.cirbuf* %0, i8 signext %1) {
%3 = alloca %struct.cirbuf*
%4 = alloca i8
store %struct.cirbuf* %0, %struct.cirbuf** %3
store i8 %1, i8* %4
%5 = load %struct.cirbuf*, %struct.cirbuf** %3
%6 = load i8, i8* %4
%7 = call i32 @__cirbuf_add_tail(%struct.cirbuf* %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
%struct.cirbuf = type { i32 }
define void @cirbuf_add_tail(%struct.cirbuf* %0, i8 signext %1) {
%3 = tail call i32 @__cirbuf_add_tail(%struct.cirbuf* %0, i8 signext %1)
ret void
}
/* Type definitions */
union bpf_attr {
  scalar_t__ kern_version;
  scalar_t__ log_level;
  scalar_t__ log_size;
  scalar_t__ log_buf;
  scalar_t__ license;
  scalar_t__ insns;
  scalar_t__ insn_cnt;
  int /*<<< orphan*/ prog_type;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_LOAD;
int /*<<< orphan*/ BPF_PROG_TYPE_KPROBE;
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int main(void) {
  union bpf_attr attr;
  attr.prog_type = BPF_PROG_TYPE_KPROBE;
  attr.insn_cnt = 0;
  attr.insns = 0;
  attr.license = 0;
  attr.log_buf = 0;
  attr.log_size = 0;
  attr.log_level = 0;
  attr.kern_version = 0;
  return syscall(321, BPF_PROG_LOAD, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x10(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x8,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
@BPF_PROG_TYPE_KPROBE = global i32 0
@BPF_PROG_LOAD = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.bpf_attr
store i32 0, i32* %1
%3 = load i32, i32* @BPF_PROG_TYPE_KPROBE
%4 = bitcast %union.bpf_attr* %2 to i32*
store i32 %3, i32* %4
%5 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %5
%6 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %6
%7 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %7
%8 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %8
%9 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %9
%10 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %10
%11 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %11
%12 = load i32, i32* @BPF_PROG_LOAD
%13 = call i32 @syscall(i32 321, i32 %12, %union.bpf_attr* %2, i32 8)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i64 }
@BPF_PROG_TYPE_KPROBE = global i32 0
@BPF_PROG_LOAD = global i32 0
define i32 @main() {
%1 = alloca %union.bpf_attr
%2 = bitcast %union.bpf_attr* %1 to i8*
%3 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %1, i64 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @BPF_PROG_LOAD
%5 = call i32 @syscall(i32 321, i32 %4, %union.bpf_attr* %1, i32 8)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sys_exit(void) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @sys_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int FLOAT_EQ_FLOAT(float f1, float f2) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
  return (f1 == f2);
#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<FLOAT_EQ_FLOAT>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLOAT_EQ_FLOAT>:
cmpeqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @FLOAT_EQ_FLOAT(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 = fcmp oeq float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @FLOAT_EQ_FLOAT(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int checkoperator(char ch) {
  if (ch == '+' || ch == '-' || ch == '/' || ch == '*' || ch == '^')
    return 2;
  else
    return 1;
}


x86 assembly (clang, -O0):
<checkoperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <checkoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <checkoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114b <checkoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <checkoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1157 <checkoperator+0x57>
movl   $0x2,-0x4(%rbp)
jmp    115e <checkoperator+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkoperator>:
add    $0xd6,%dil
cmp    $0x34,%dil
ja     1124 <checkoperator+0x24>
mov    $0x2,%eax
movzbl %dil,%ecx
movabs $0x1000000000002b,%rdx
bt     %rcx,%rdx
jae    1124 <checkoperator+0x24>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @checkoperator(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 eq i32 %5, 43
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 94
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 2, i32* %2
br label %25
24: ; preds = %19
store i32 1, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @checkoperator(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %3
i8 47, label %3
i8 45, label %3
i8 43, label %3
i8 42, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 2, %1 ], [ 2, %1 ], [ 2, %1 ], [ 2, %1 ], [ 2, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mknod <path> [b|c|u|p] <major> <minor>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [47 x i8] c"usage: mknod <path> [b|c|u|p] <major> <minor>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: mknod <path> [b|c|u|p] <major> <minor>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int lmc_hash(char const *, size_t);
unsigned long ht_hash_key(const char *s, size_t l) {
  return lmc_hash(s, l) % 20731;
}


x86 assembly (clang, -O0):
<ht_hash_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lmc_hash@plt>
mov    $0x50fb,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash_key>:
push   %rax
call   1030 <lmc_hash@plt>
cltq
imul   $0xffffffffca520511,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xe,%ecx
add    %edx,%ecx
imul   $0x50fb,%ecx,%ecx
sub    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ht_hash_key(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @lmc_hash(i8* %5, i64 %6)
%8 = srem i32 %7, 20731
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @ht_hash_key(i8* %0, i64 %1) {
%3 = tail call i32 @lmc_hash(i8* %0, i64 %1)
%4 = srem i32 %3, 20731
%5 = sext i32 %4 to i64
ret i64 %5
}
void lenz_to_nmra(unsigned int lenz, unsigned int *nmra, unsigned char *sub) {
  if (lenz > 0) {
    *sub = (lenz - 1) % 4;
    *nmra = (lenz + 3) >> 2;
  } else {
    *sub = 0;
    *nmra = 0;
  }
}


x86 assembly (clang, -O0):
<lenz_to_nmra>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    113e <lenz_to_nmra+0x3e>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    $0x3,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%ecx
add    $0x3,%ecx
shr    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    114f <lenz_to_nmra+0x4f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenz_to_nmra>:
test   %edi,%edi
je     1114 <lenz_to_nmra+0x14>
lea    -0x1(%rdi),%eax
and    $0x3,%al
mov    %al,(%rdx)
add    $0x3,%edi
shr    $0x2,%edi
mov    %edi,(%rsi)
ret
movb   $0x0,(%rdx)
xor    %edi,%edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @lenz_to_nmra(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %3
%10 = load i32, i32* %4
%11 = sub i32 %10, 1
%12 = urem i32 %11, 4
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %6
store i8 %13, i8* %14
%15 = load i32, i32* %4
%16 = add i32 %15, 3
%17 = lshr i32 %16, 2
%18 = load i32*, i32** %5
store i32 %17, i32* %18
br label %22
19: ; preds = %3
%20 = load i8*, i8** %6
store i8 0, i8* %20
%21 = load i32*, i32** %5
store i32 0, i32* %21
br label %22
22: ; preds = %19, %9
ret void
}

LLVM IR (-O2):
define void @lenz_to_nmra(i32 %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = trunc i32 %0 to i8
%7 = add i8 %6, 3
%8 = and i8 %7, 3
store i8 %8, i8* %2
%9 = add i32 %0, 3
%10 = lshr i32 %9, 2
br label %12
11: ; preds = %3
store i8 0, i8* %2
br label %12
12: ; preds = %11, %5
%13 = phi i32 [ 0, %11 ], [ %10, %5 ]
store i32 %13, i32* %1
ret void
}
/* Variables and functions */
char getchar();
int clean_stdin() {
  while (getchar() != '\n')
    ;
  return 1;
}


x86 assembly (clang, -O0):
<clean_stdin>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clean_stdin+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clean_stdin+0x21>
jmp    1119 <clean_stdin+0x9>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_stdin>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clean_stdin+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clean_stdin() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret i32 1
}

LLVM IR (-O2):
define i32 @clean_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int /*<<< orphan*/);
int main() { malloc(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @malloc(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int tv_sec;
  int tv_usec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
double time() {
  struct rusage ru;
  getrusage(RUSAGE_SELF, &ru);
  return (ru.ru_utime.tv_sec * 1000000 + ru.ru_utime.tv_usec) / 1.e6;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrusage@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrusage@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xec7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
@RUSAGE_SELF = global i32 0
define double @time() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 1.000000e+06
ret double %13
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
@RUSAGE_SELF = global i32 0
define double @time() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+06
ret double %12
}
int bitcount(char x) {
  int idx = 0;
  for (idx = 0; x != 0; idx++)
    x &= (x - 1);
  return idx;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     1143 <bitcount+0x43>
movsbl -0x1(%rbp),%ecx
sub    $0x1,%ecx
movsbl -0x1(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <bitcount+0x18>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %dil,%dil
je     111d <bitcount+0x1d>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %dil,%cl
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i8 [ %7, %3 ], [ %0, %1 ]
%6 = add i8 %5, -1
%7 = and i8 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dh_helper_free(void *opaque, void *address) {
  (void)opaque;
  free(address);
}


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

x86 assembly (clang, -O2):
<dh_helper_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dh_helper_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vprintf(const char *s, va_list l) {
  int retValue = vfprintf(stdout, s, l);
  return retValue;
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @vprintf(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 i32, i32* @stdout
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vfprintf(i32 %6, i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, ...);
void geoip_set_country(const char *country, const char *code, char *loc) {
  if (country && code)
    sprintf(loc, "%s %s", code, country);
  else
    sprintf(loc, "%s", "Unknown");
}


x86 assembly (clang, -O0):
<geoip_set_country>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <geoip_set_country+0x49>
cmpq   $0x0,-0x10(%rbp)
je     1159 <geoip_set_country+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1172 <geoip_set_country+0x62>
mov    -0x18(%rbp),%rdi
lea    0xe9f(%rip),%rsi
lea    0xe9b(%rip),%rdx
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoip_set_country>:
test   %rdi,%rdi
je     1134 <geoip_set_country+0x24>
mov    %rsi,%rax
test   %rsi,%rsi
je     1134 <geoip_set_country+0x24>
mov    %rdi,%rcx
lea    0xed9(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <sprintf@plt>
movabs $0x6e776f6e6b6e55,%rax
mov    %rax,(%rdx)
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
define void @geoip_set_country(i8* %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
br label %11
9: ; preds = %3
%10 = bitcast i8* %2 to i64*
store i64 31093567915781717, i64* %10
br label %11
11: ; preds = %9, %7
ret void
}
int pgdb_major_version(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @pgdb_major_version() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @pgdb_major_version() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("Clean yourself!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Clean yourself!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Clean yourself!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct os_info_type {
  int dummy;
};

/* Variables and functions */
int uname_get_os_info(struct os_info_type *);
int get_os_info(struct os_info_type *os_info) {
  return uname_get_os_info(os_info);
}


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

x86 assembly (clang, -O2):
<get_os_info>:
jmp    1030 <uname_get_os_info@plt>

LLVM IR (-O0):
%struct.os_info_type = type { i32 }
define i32 @get_os_info(%struct.os_info_type* %0) {
%2 = alloca %struct.os_info_type*
store %struct.os_info_type* %0, %struct.os_info_type** %2
%3 = load %struct.os_info_type*, %struct.os_info_type** %2
%4 = call i32 @uname_get_os_info(%struct.os_info_type* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.os_info_type = type { i32 }
define i32 @get_os_info(%struct.os_info_type* %0) {
%2 = tail call i32 @uname_get_os_info(%struct.os_info_type* %0)
ret i32 %2
}
int CallbackOnJsonNode(int type, char *jpath, int jpath_len, int jpath_size,
                       char *nodename, int nodename_len, char *content,
                       int content_len, void *p) {
  return 0;
}


x86 assembly (clang, -O0):
<CallbackOnJsonNode>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CallbackOnJsonNode(i32 %0, i8* %1, i32 %2, i32 %3, i8* %4, i32 %5, i8* %6, i32 %7, i8* %8) {
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8*
store i32 %0, i32* %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i8* %8, i8** %18
ret i32 0
}

LLVM IR (-O2):
define i32 @CallbackOnJsonNode(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3, i8* nocapture readnone %4, i32 %5, i8* nocapture readnone %6, i32 %7, i8* nocapture readnone %8) {
ret i32 0
}
/* Variables and functions */
float __ocml_add_rte_f32(float, float);
float __fadd_rn(float x, float y) { return __ocml_add_rte_f32(x, y); }


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

x86 assembly (clang, -O2):
<__fadd_rn>:
jmp    1030 <__ocml_add_rte_f32@plt>

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

LLVM IR (-O2):
define float @__fadd_rn(float %0, float %1) {
%3 = tail call float @__ocml_add_rte_f32(float %0, float %1)
ret float %3
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
test_manual_help_cmd_parser_release(struct gengetopt_args_info *);
void test_manual_help_cmd_parser_free(struct gengetopt_args_info *args_info) {
  test_manual_help_cmd_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<test_manual_help_cmd_parser_free>:
jmp    1030 <test_manual_help_cmd_parser_release@plt>

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
define void @test_manual_help_cmd_parser_free(%struct.gengetopt_args_info* %0) {
%2 = alloca %struct.gengetopt_args_info*
store %struct.gengetopt_args_info* %0, %struct.gengetopt_args_info** %2
%3 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %2
%4 = call i32 @test_manual_help_cmd_parser_release(%struct.gengetopt_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define void @test_manual_help_cmd_parser_free(%struct.gengetopt_args_info* %0) {
%2 = tail call i32 @test_manual_help_cmd_parser_release(%struct.gengetopt_args_info* %0)
ret void
}