xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_REQINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_REQINFO_it;
OCSP_REQINFO *d2i_OCSP_REQINFO(OCSP_REQINFO **a, const unsigned char **in,
                               long len) {
  return (OCSP_REQINFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                       &OCSP_REQINFO_it);
}


x86 assembly (clang, -O0):
<d2i_OCSP_REQINFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_OCSP_REQINFO>:
mov    0x2ed9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_REQINFO_it = global i32 0
define i32* @d2i_OCSP_REQINFO(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_REQINFO_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_REQINFO_it = global i32 0
define i32* @d2i_OCSP_REQINFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_REQINFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int atoi(char *);
scalar_t__ isdigit(char);
int parse_cmd(int argc, char *argv[]) {
  int para_num;
  char *num;
  if (argc <= 1) {
    return -1;
  } else {
    num = argv[1] + 1;
    if (isdigit(num[0]) == 0) {
      return -1;
    }
    para_num = atoi(num);
    return para_num;
  }
}


x86 assembly (clang, -O0):
<parse_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1145 <parse_cmd+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <parse_cmd+0x69>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1177 <parse_cmd+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <parse_cmd+0x69>
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_cmd>:
push   %rbx
cmp    $0x2,%edi
jl     1145 <parse_cmd+0x25>
mov    0x8(%rsi),%rbx
movsbl 0x1(%rbx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1145 <parse_cmd+0x25>
add    $0x1,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parse_cmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %26
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = call i64 @isdigit(i8 signext %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %11
store i32 -1, i32* %3
br label %26
22: ; preds = %11
%23 = load i8*, i8** %7
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %6
%25 = load i32, i32* %6
store i32 %25, i32* %3
br label %26
26: ; preds = %22, %21, %10
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @parse_cmd(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = tail call i64 @isdigit(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = tail call i32 @atoi(i8* %7)
br label %13
13: ; preds = %4, %2, %11
%14 = phi i32 [ %12, %11 ], [ -1, %2 ], [ -1, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ call_prom(char *, int, int, char *);
void prom_interpret(char *buf) { call_prom("interpret", 1, 1, buf); }


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

x86 assembly (clang, -O2):
<prom_interpret>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <call_prom@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"interpret\00"
define void @prom_interpret(i8* %0) {
%2 = tail call i32 @call_prom(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i8* %0)
ret void
}
int gpio_set_value(unsigned gpio, int val) { return 0; }


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

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

LLVM IR (-O0):
define i32 @gpio_set_value(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @gpio_set_value(i32 %0, i32 %1) {
ret i32 0
}
void report_Disconnect_Resp(void) {}


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

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

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

LLVM IR (-O2):
define void @report_Disconnect_Resp() {
ret void
}
double __carg(__complex__ double x) { return __atan2(__imag__ x, __real__ x); }


x86 assembly (clang, -O0):
<__carg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1030 <__atan2@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__carg>:
push   %rax
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
mov    $0x2,%al
call   1030 <__atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @__carg(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%9 = load double, double* %8
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @__atan2 to i32 (double, double, ...)*)(double %7, double %9)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @__carg(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @__atan2 to i32 (double, double, ...)*)(double %1, double %0)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ emit_package(int /*<<< orphan*/);
void emit_lua() { emit_package(0); }


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

x86 assembly (clang, -O2):
<emit_lua>:
xor    %edi,%edi
jmp    1030 <emit_package@plt>

LLVM IR (-O0):
define void @emit_lua() {
%1 = call i32 @emit_package(i32 0)
ret void
}

LLVM IR (-O2):
define void @emit_lua() {
%1 = tail call i32 @emit_package(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *emalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "c4: emalloc() - Can't allocate %ld bytes.\n", (long)size);
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<emalloc>:
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    1177 <emalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%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):
<emalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <emalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"c4: emalloc() - Can't allocate %ld bytes.\0A\00"
define i8* @emalloc(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 %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"c4: emalloc() - Can't allocate %ld bytes.\0A\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %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 ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int Q_stricmpn(char const *, char const *, int);
int Q_stricmp(const char *s1, const char *s2) {
  return ((s1 && s2) ? Q_stricmpn(s1, s2, 99999) : -1);
}


x86 assembly (clang, -O0):
<Q_stricmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <Q_stricmp+0x40>
cmpq   $0x0,-0x10(%rbp)
je     1150 <Q_stricmp+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1869f,%edx
call   1030 <Q_stricmpn@plt>
mov    %eax,-0x14(%rbp)
jmp    115d <Q_stricmp+0x4d>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <Q_stricmp+0x4d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_stricmp>:
test   %rdi,%rdi
je     1124 <Q_stricmp+0x14>
test   %rsi,%rsi
je     1124 <Q_stricmp+0x14>
mov    $0x1869f,%edx
jmp    1030 <Q_stricmpn@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Q_stricmp(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @Q_stricmpn(i8* %11, i8* %12, i32 99999)
br label %15
14: ; preds = %7, %2
br label %15
15: ; preds = %14, %10
%16 = phi i32 [ %13, %10 ], [ -1, %14 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @Q_stricmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @Q_stricmpn(i8* %0, i8* %1, i32 99999)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
float sin(double);
int main() {
  float s = sin(2.5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <sin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @sin(double 2.500000e+00)
store float %3, float* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @sin(double 2.500000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reverseArray(int *, int);
void rotate(int nums[], int n, int k) {
  k = k % n;
  reverseArray(nums, n);
  reverseArray(nums, k);
  reverseArray(nums + k, n - k);
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <reverseArray@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <reverseArray@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <reverseArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%eax
mov    %esi,%ebx
mov    %rdi,%r14
cltd
idiv   %esi
mov    %edx,%ebp
call   1030 <reverseArray@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <reverseArray@plt>
movslq %ebp,%rax
lea    (%r14,%rax,4),%rdi
sub    %eax,%ebx
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <reverseArray@plt>

LLVM IR (-O0):
define void @rotate(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = srem i32 %7, %8
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = call i32 @reverseArray(i32* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = call i32 @reverseArray(i32* %13, i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
%23 = call i32 @reverseArray(i32* %19, i32 %22)
ret void
}

LLVM IR (-O2):
define void @rotate(i32* %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = tail call i32 @reverseArray(i32* %0, i32 %1)
%6 = tail call i32 @reverseArray(i32* %0, i32 %4)
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %4
%10 = tail call i32 @reverseArray(i32* %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void spacer(char ch, int f, int a) {
  for (int i = a; i < f; i++)
    fputc(ch, stdout);
}


x86 assembly (clang, -O0):
<spacer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <spacer+0x48>
mov    -0x1(%rbp),%al
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <spacer+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spacer>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edx
jge    113f <spacer+0x2f>
mov    %esi,%ebx
sub    %edx,%ebx
mov    0x2ebd(%rip),%r14
movsbl %dil,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%r14),%esi
mov    %ebp,%edi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1130 <spacer+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @spacer(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %17, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i8, i8* %4
%15 = load i32, i32* @stdout
%16 = call i32 @fputc(i8 signext %14, i32 %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @spacer(i8 signext %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ %2, %3 ]
%8 = load i32, i32* @stdout
%9 = tail call i32 @fputc(i8 signext %0, i32 %8)
%10 = add i32 %7, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_count_cover(char *, int);
float expf(float);
float logf(float);
float HMM_PowerF(float Base, float Exponent) {
  { _hmt_count_cover("HMM_PowerF", 562); };
  float Result = expf(Exponent * logf(Base));
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_PowerF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x232,%esi
call   1030 <_hmt_count_cover@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <logf@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1050 <expf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_PowerF>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
lea    0xebd(%rip),%rdi
mov    $0x232,%esi
call   1030 <_hmt_count_cover@plt>
movss  (%rsp),%xmm0
call   1040 <logf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1050 <expf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"HMM_PowerF\00"
define float @HMM_PowerF(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = call i32 @_hmt_count_cover(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 562)
%7 = load float, float* %4
%8 = load float, float* %3
%9 = call float @logf(float %8)
%10 = fmul float %7, %9
%11 = call float @expf(float %10)
store float %11, float* %5
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"HMM_PowerF\00"
define float @HMM_PowerF(float %0, float %1) {
%3 = tail call i32 @_hmt_count_cover(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 562)
%4 = tail call float @logf(float %0)
%5 = fmul float %4, %1
%6 = tail call float @expf(float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
size_t hlp_path_maxlen(void) { return (size_t)PATH_MAX; }


x86 assembly (clang, -O0):
<hlp_path_maxlen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
movslq (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_path_maxlen>:
mov    0x2ee9(%rip),%rax
movslq (%rax),%rax
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i64 @hlp_path_maxlen() {
%1 = load i32, i32* @PATH_MAX
%2 = sext i32 %1 to i64
ret i64 %2
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i64 @hlp_path_maxlen() {
%1 = load i32, i32* @PATH_MAX
%2 = sext i32 %1 to i64
ret i64 %2
}
double normalize(double edt, int nsta) {
  double fedt;
  fedt = (double)edt;
  return (fedt / (double)nsta);
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @normalize(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
store double %6, double* %5
%7 = load double, double* %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @normalize(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %0, %3
ret double %4
}
int test_imm_E3int64_lowword_reg(long long val) {
  return ((val) & (0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xe3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E3int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 227
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_E3int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 227
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(char const *s) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    i++;
  }
  write(1, s, i);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1146 <ft_putendl+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putendl+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe9d(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rax
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putendl+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xec2(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @write(i32 1, i8* %0, i32 %9)
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void dbgMutexCancelCleanupHdlr(void *pmut) {
  pthread_mutex_unlock((pthread_mutex_t *)pmut);
}


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

x86 assembly (clang, -O2):
<dbgMutexCancelCleanupHdlr>:
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @dbgMutexCancelCleanupHdlr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @pthread_mutex_unlock(i32* %4)
ret void
}

LLVM IR (-O2):
define void @dbgMutexCancelCleanupHdlr(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret void
}
/* Variables and functions */
int close(int);
int libnet_close_raw_sock(int fd) { return (close(fd)); }


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

x86 assembly (clang, -O2):
<libnet_close_raw_sock>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @libnet_close_raw_sock(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dec32le(unsigned char const *);
void range_dec32le(uint32_t *v, size_t num, const void *src) {
  const unsigned char *buf;
  buf = src;
  while (num-- > 0) {
    *v++ = dec32le(buf);
    buf += 4;
  }
}


x86 assembly (clang, -O0):
<range_dec32le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    1172 <range_dec32le+0x62>
mov    -0x20(%rbp),%rdi
call   1030 <dec32le@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <range_dec32le+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_dec32le>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1149 <range_dec32le+0x39>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <dec32le@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x4,%r12
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <range_dec32le+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *const, char *);
void usage(FILE *const out) {
  fprintf(out, "Usage: faces [options] < stl-binary.stl > faces.svg\n"
               "Options:\n"
               " -v | --verbose      Enable verbosity\n"
               " -i | --inset N      Inset mm\n"
               " -r | --radius N     Hole radius mm\n"
               " -I | --input file   Read binary STL from file\n"
               " -O | --output file  Write SVG to file\n"
               "\n");
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xfc,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [253 x i8] c"Usage: faces [options] < stl-binary.stl > faces.svg\0AOptions:\0A -v | --verbose Enable verbosity\0A -i | --inset N Inset mm\0A -r | --radius N Hole radius mm\0A -I | --input file Read binary STL from file\0A -O | --output file Write SVG to file\0A\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [253 x i8] c"Usage: faces [options] < stl-binary.stl > faces.svg\0AOptions:\0A -v | --verbose Enable verbosity\0A -i | --inset N Inset mm\0A -r | --radius N Hole radius mm\0A -I | --input file Read binary STL from file\0A -O | --output file Write SVG to file\0A\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0), i64 252, i64 1, i32* %0)
ret void
}
void print_inst_BICC(char *mnemonic, unsigned int addr) { ; }


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

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

LLVM IR (-O0):
define void @print_inst_BICC(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @print_inst_BICC(i8* nocapture %0, i32 %1) {
ret void
}
int cairo_code_draw_pwrcutLabel_get_height() { return 38; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_pwrcutLabel_get_height() {
ret i32 38
}

LLVM IR (-O2):
define i32 @cairo_code_draw_pwrcutLabel_get_height() {
ret i32 38
}
/* Variables and functions */
scalar_t__ isdigit(char);
char toupper(char);
int hex_to_val(char c) {
  return (isdigit(c) ? c - '0' : (toupper(c) - 'A') + 10) & 0xF;
}


x86 assembly (clang, -O0):
<hex_to_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <hex_to_val+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <hex_to_val+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_val>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
mov    $0xffffffd0,%ecx
test   %rax,%rax
jne    1141 <hex_to_val+0x21>
movsbl %bl,%edi
call   1040 <toupper@plt>
mov    %eax,%ebx
mov    $0xffffffc9,%ecx
movzbl %bl,%eax
add    %ecx,%eax
and    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hex_to_val(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @toupper(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = and i32 %17, 15
ret i32 %18
}

LLVM IR (-O2):
define i32 @hex_to_val(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call signext i8 @toupper(i8 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ %5, %4 ], [ %0, %1 ]
%8 = phi i32 [ -55, %4 ], [ -48, %1 ]
%9 = zext i8 %7 to i32
%10 = add nsw i32 %8, %9
%11 = and i32 %10, 15
ret i32 %11
}
/* Type definitions */
typedef char *u_int32_t;

/* Variables and functions */
u_int32_t ByteSwap32(u_int32_t x) {
  __asm("bswap	%0" : "=r"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @ByteSwap32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap\09$0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ByteSwap32(i8* readnone %0) {
%2 = tail call i8* asm "bswap\09$0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
unsigned f(unsigned i) { return 3 * i; }


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = mul i32 %0, 3
ret i32 %2
}
void glFogx(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFogx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long rul__sql_rollback(void) {
  long sql_status;
  printf("\n Now in routine rul__sql_rollback ... \n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"\0A Now in routine rul__sql_rollback ... \0A\00"
define i64 @rul__sql_rollback() {
%1 = alloca i64
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i64 1
}

LLVM IR (-O2):
@str = [40 x i8] c"\0A Now in routine rul__sql_rollback ... \00"
define i64 @rul__sql_rollback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i64 1
}
int isonum_721(unsigned char *p) {
  return ((p[0] & 0xff) | ((p[1] & 0xff) << 8));
}


x86 assembly (clang, -O0):
<isonum_721>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_721>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @isonum_721(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @isonum_721(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_BIO_strings();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ log_debug(char *);
void ssl_init(void) {
  log_debug("Initializing OpenSSL");
  SSL_load_error_strings();
  ERR_load_BIO_strings();
  SSL_library_init();
}


x86 assembly (clang, -O0):
<ssl_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <log_debug@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1060 <ERR_load_BIO_strings@plt>
mov    $0x0,%al
call   1040 <SSL_library_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_init>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <log_debug@plt>
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1060 <ERR_load_BIO_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <SSL_library_init@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Initializing OpenSSL\00"
define void @ssl_init() {
%1 = call i32 @log_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @SSL_load_error_strings()
%3 = call i32 (...) @ERR_load_BIO_strings()
%4 = call i32 (...) @SSL_library_init()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Initializing OpenSSL\00"
define void @ssl_init() {
%1 = tail call i32 @log_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @SSL_load_error_strings()
%3 = tail call i32 (...) @ERR_load_BIO_strings()
%4 = tail call i32 (...) @SSL_library_init()
ret void
}
/* Variables and functions */
int core_main();
int /*<<< orphan*/ parse_options(int, char **);
int main(int argc, char *argv[]) {
  parse_options(argc, argv);
  return core_main();
}


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_options@plt>
mov    $0x0,%al
call   1030 <core_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <parse_options@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <core_main@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_options(i32 %6, i8** %7)
%9 = call i32 (...) @core_main()
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_options(i32 %0, i8** %1)
%4 = tail call i32 (...) @core_main()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void vt100_erase_line(void) {
  printf("\x1B[2K");
  fflush(stdout);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2K\00"
@stdout = global i32 0
define void @vt100_erase_line() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2K\00"
@stdout = global i32 0
define void @vt100_erase_line() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("I am not matching\n");
  printf("Any strings\n");
  printf("But it is OK\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [19 x i8] c"I am not matching\0A\00"
@.str.2 = [13 x i8] c"Any strings\0A\00"
@.str.3 = [14 x i8] c"But it is OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.4 = [18 x i8] c"I am not matching\00"
@str.5 = [12 x i8] c"Any strings\00"
@str.6 = [13 x i8] c"But it is OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ main_test();
int main(void) {
  main_test();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <main_test@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 (...) @main_test()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_test()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: nm -n kernel.elf | scripts/kallsyms > symbols.S\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 = [56 x i8] c"Usage: nm -n kernel.elf | scripts/kallsyms > symbols.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: nm -n kernel.elf | scripts/kallsyms > symbols.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void kmemleak_ignore(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kmemleak_ignore(i8* nocapture %0) {
ret void
}
_gtty(fildes, arg) char *arg;
{ return _ioctl(fildes, ('t' << 8) | 8, arg); }


x86 assembly (clang, -O0):
<_gtty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x7408,%esi
mov    $0x0,%al
call   1030 <_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gtty>:
mov    %rsi,%rdx
mov    $0x7408,%esi
xor    %eax,%eax
jmp    1030 <_ioctl@plt>

LLVM IR (-O0):
define i32 @_gtty(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @_ioctl to i32 (i32, i32, i8*, ...)*)(i32 %5, i32 29704, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_gtty(i32 %0, i8* %1) {
%3 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @_ioctl to i32 (i32, i32, i8*, ...)*)(i32 %0, i32 29704, i8* %1)
ret i32 %3
}
void tr_change(void *addr, int new_len) {}


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

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

LLVM IR (-O0):
define void @tr_change(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @tr_change(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ check;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t _tcphdr_check_ntohs(struct tcphdr *h) { return ntohs(h->check); }


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

x86 assembly (clang, -O2):
<_tcphdr_check_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_check_ntohs(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_check_ntohs(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}