xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DUART_PUTC(int /*<<< orphan*/);
void puts(const char *s) {
  while (*s)
    DUART_PUTC(*s++);
}


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

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

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @DUART_PUTC(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int /*<<< orphan*/);
void bitmap_init_64(void *bmap) { memset(bmap, 64 >> 3, 0); }


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

x86 assembly (clang, -O2):
<bitmap_init_64>:
mov    $0x8,%esi
xor    %edx,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bitmap_init_64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 8, i32 0)
ret void
}

LLVM IR (-O2):
define void @bitmap_init_64(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_int();
int quot(int /*<<< orphan*/, int /*<<< orphan*/);
int main() { return quot(__VERIFIER_nondet_int(), __VERIFIER_nondet_int()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <quot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <quot@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__VERIFIER_nondet_int()
%3 = call i32 (...) @__VERIFIER_nondet_int()
%4 = call i32 @quot(i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @quot(i32 %1, i32 %2)
ret i32 %3
}
void fsys1(void) { return; }


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

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

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

LLVM IR (-O2):
define void @fsys1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_buf_asm(int, char *);
void non_module_test(void) {
  char buf[4] = {0x83, 0xf8, 0x00, 0xc3};
  int uninit[2];
  int x = 0;
  call_buf_asm(uninit[x], buf);
}


x86 assembly (clang, -O0):
<non_module_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
lea    -0x4(%rbp),%rsi
call   1030 <call_buf_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<non_module_test>:
push   %rax
movl   $0xc300f883,0x4(%rsp)
c3
lea    0x4(%rsp),%rsi
call   1030 <call_buf_asm@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.non_module_test.buf = [4 x i8] c"\83\F8\00\C3"
define void @non_module_test() {
%1 = alloca [4 x i8]
%2 = alloca [2 x i32]
%3 = alloca i32
%4 = bitcast [4 x i8]* %1 to i8*
store i32 0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%10 = call i32 @call_buf_asm(i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @non_module_test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1023346557, i32* %1
%3 = call i32 @call_buf_asm(i32 undef, i8* %2)
ret void
}
void pool_free(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @pool_free(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void setbuf(FILE *__restrict stream, char *__restrict buf) {}


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

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

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

LLVM IR (-O2):
define void @setbuf(i32* noalias nocapture %0, i8* noalias nocapture %1) {
ret void
}
char RTC_IsLeapYear(unsigned int uiYear_) {
  char bLeapYear = 0;
  if ((uiYear_ % 400) == 0) {
    bLeapYear = 1;
  } else if ((uiYear_ % 100) == 0) {
    bLeapYear = 0;
  } else if ((uiYear_ % 4) == 0) {
    bLeapYear = 1;
  }
  return bLeapYear;
}


x86 assembly (clang, -O0):
<RTC_IsLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1129 <RTC_IsLeapYear+0x29>
movb   $0x1,-0x5(%rbp)
jmp    1164 <RTC_IsLeapYear+0x64>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1147 <RTC_IsLeapYear+0x47>
movb   $0x0,-0x5(%rbp)
jmp    115f <RTC_IsLeapYear+0x5f>
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    115a <RTC_IsLeapYear+0x5a>
movb   $0x1,-0x5(%rbp)
jmp    115f <RTC_IsLeapYear+0x5f>
jmp    1164 <RTC_IsLeapYear+0x64>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTC_IsLeapYear>:
imul   $0xc28f5c29,%edi,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     1128 <RTC_IsLeapYear+0x28>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
setae  %cl
test   $0x3,%dil
sete   %al
and    %cl,%al
ret
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @RTC_IsLeapYear(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
%5 = urem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %3
br label %20
8: ; preds = %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 0, i8* %3
br label %19
13: ; preds = %8
%14 = load i32, i32* %2
%15 = urem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 1, i8* %3
br label %18
18: ; preds = %17, %13
br label %19
19: ; preds = %18, %12
br label %20
20: ; preds = %19, %7
%21 = load i8, i8* %3
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @RTC_IsLeapYear(i32 %0) {
%2 = urem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = urem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = and i32 %0, 3
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
%10 = zext i1 %9 to i8
br label %11
11: ; preds = %4, %1
%12 = phi i8 [ 1, %1 ], [ %10, %4 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_si_remove_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_sessinfo@%p::remove (rtpp_si_remove) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_si_remove_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_si_remove_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_sessinfo@%p::remove (rtpp_si_remove) is invoked after destruction\0A\00"
define void @rtpp_si_remove_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_sessinfo@%p::remove (rtpp_si_remove) is invoked after destruction\0A\00"
define void @rtpp_si_remove_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int traceproc_unregister_callbacks(unsigned id) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @traceproc_unregister_callbacks(i32 %0) {
ret i32 1
}
int cmp(int x, int y) { return x - y; }


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

x86 assembly (clang, -O2):
<cmp>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int read_int(char *);
int get_brightness() {
  return read_int("/sys/class/backlight/acpi_video0/brightness");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"/sys/class/backlight/acpi_video0/brightness\00"
define i32 @get_brightness() {
%1 = call i32 @read_int(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [44 x i8] c"/sys/class/backlight/acpi_video0/brightness\00"
define i32 @get_brightness() {
%1 = tail call i32 @read_int(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
double dproduct(double v1[3], double v2[3]) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<dproduct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dproduct>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dproduct(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dproduct(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
long labs(j)
long j;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
ret i64 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
uint64_t tzcnt(uint64_t n) {
  if (n == 0) {
    return (64);
  } else {
    int64_t res;
    __asm__("bsfq %1, %0" : "=r"(res) : "r"(n));
    return (res);
  }
}


x86 assembly (clang, -O0):
<tzcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <tzcnt+0x20>
movq   $0x40,-0x8(%rbp)
jmp    1134 <tzcnt+0x34>
mov    -0x10(%rbp),%rax
bsf    %rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tzcnt>:
test   %rdi,%rdi
je     110a <tzcnt+0xa>
bsf    %rdi,%rax
ret
mov    $0x40,%eax
ret

LLVM IR (-O0):
define i64 @tzcnt(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 64, i64* %2
br label %12
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i64 asm "bsfq $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %9)
store i64 %10, i64* %4
%11 = load i64, i64* %4
store i64 %11, i64* %2
br label %12
12: ; preds = %8, %7
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @tzcnt(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 asm "bsfq $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 64, %1 ]
ret i64 %6
}
int get_ParameterTable(unsigned char *pds) { return pds[3]; }


x86 assembly (clang, -O0):
<get_ParameterTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ParameterTable>:
movzbl 0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_ParameterTable(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
void unsupported(struct nandsim_private *ns) { (void)ns; }


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

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

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

LLVM IR (-O2):
%struct.nandsim_private = type opaque
define void @unsupported(%struct.nandsim_private* nocapture %0) {
ret void
}
int Operand_bs8_decode(unsigned int *valp) {
  *valp = *valp << 3;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_bs8_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bs8_decode>:
shll   $0x3,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_bs8_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 3
store i32 %3, i32* %0
ret i32 0
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Hero_AddBuff(struct Hero *, int /*<<< orphan*/);
int /*<<< orphan*/ ZhenJiXiaBuff_Get();
void ZhenJiXia_add_buff_to_attacker(struct Ability *self, struct Hero *attacker,
                                    struct Hero *target) {
  Hero_AddBuff(attacker, ZhenJiXiaBuff_Get());
}


x86 assembly (clang, -O0):
<ZhenJiXia_add_buff_to_attacker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <ZhenJiXiaBuff_Get@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <Hero_AddBuff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZhenJiXia_add_buff_to_attacker>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <ZhenJiXiaBuff_Get@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Hero_AddBuff@plt>

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define void @ZhenJiXia_add_buff_to_attacker(%struct.Ability* %0, %struct.Hero* %1, %struct.Hero* %2) {
%4 = alloca %struct.Ability*
%5 = alloca %struct.Hero*
%6 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %4
store %struct.Hero* %1, %struct.Hero** %5
store %struct.Hero* %2, %struct.Hero** %6
%7 = load %struct.Hero*, %struct.Hero** %5
%8 = call i32 (...) @ZhenJiXiaBuff_Get()
%9 = call i32 @Hero_AddBuff(%struct.Hero* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define void @ZhenJiXia_add_buff_to_attacker(%struct.Ability* nocapture readnone %0, %struct.Hero* %1, %struct.Hero* nocapture readnone %2) {
%4 = tail call i32 (...) @ZhenJiXiaBuff_Get()
%5 = tail call i32 @Hero_AddBuff(%struct.Hero* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_c4();
int /*<<< orphan*/ take_struct_c4(int /*<<< orphan*/);
void test_struct_c4() { take_struct_c4(return_struct_c4()); }


x86 assembly (clang, -O0):
<test_struct_c4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_c4@plt>
mov    %eax,%edi
call   1030 <take_struct_c4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_c4>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_c4@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_c4@plt>

LLVM IR (-O0):
define void @test_struct_c4() {
%1 = call i32 (...) @return_struct_c4()
%2 = call i32 @take_struct_c4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_c4() {
%1 = tail call i32 (...) @return_struct_c4()
%2 = tail call i32 @take_struct_c4(i32 %1)
ret void
}
void UARTPulseShapingControl(unsigned int baseAdd, unsigned int shapeControl) {
  (*((volatile unsigned int *)(baseAdd + (0x24)))) &= ~((0x00000008u));
  (*((volatile unsigned int *)(baseAdd + (0x24)))) |=
      (shapeControl & (0x00000008u));
}


x86 assembly (clang, -O0):
<UARTPulseShapingControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x8,%edx
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTPulseShapingControl>:
add    $0x24,%edi
andl   $0xfffffff7,(%rdi)
and    $0x8,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTPulseShapingControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 36
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -9
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 8
%13 = load i32, i32* %3
%14 = add i32 %13, 36
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTPulseShapingControl(i32 %0, i32 %1) {
%3 = add i32 %0, 36
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -9
store volatile i32 %7, i32* %5
%8 = and i32 %1, 8
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay_Us(int);
void dynamic_delay_100us(unsigned char delay) {
  for (; delay > 0; delay -= 1)
    Delay_Us(100);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1144 <dynamic_delay_100us+0x34>
mov    $0x64,%edi
call   1030 <Delay_Us@plt>
movzbl -0x1(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    111e <dynamic_delay_100us+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
test   %edi,%edi
je     112f <dynamic_delay_100us+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <Delay_Us@plt>
add    $0xff,%bl
jne    1120 <dynamic_delay_100us+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @dynamic_delay_100us(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %9, %1
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = call i32 @Delay_Us(i32 100)
br label %9
9: ; preds = %7
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = sub nsw i32 %11, 1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @dynamic_delay_100us(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @Delay_Us(i32 100)
%6 = add i8 %4, -1
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
unsigned long CROSS_64KB(void *a, unsigned long s) {
  unsigned long p = (unsigned long)a;
  return ((p + s - 1) ^ p) & ~0xffffUL;
}


x86 assembly (clang, -O0):
<CROSS_64KB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    -0x18(%rbp),%rax
and    $0xffffffffffff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CROSS_64KB>:
lea    (%rsi,%rdi,1),%rax
add    $0xffffffffffffffff,%rax
xor    %rdi,%rax
and    $0xffffffffffff0000,%rax
ret

LLVM IR (-O0):
define i64 @CROSS_64KB(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = add i64 %8, %9
%11 = sub i64 %10, 1
%12 = load i64, i64* %5
%13 = xor i64 %11, %12
%14 = and i64 %13, -65536
ret i64 %14
}

LLVM IR (-O2):
define i64 @CROSS_64KB(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = add i64 %1, -1
%5 = add i64 %4, %3
%6 = xor i64 %5, %3
%7 = and i64 %6, -65536
ret i64 %7
}
/* Type definitions */
struct nlmsghdr {
  int nlmsg_flags;
};

/* Variables and functions */
int NLM_F_ECHO;
int nlmsg_report(const struct nlmsghdr *nlh) {
  return !!(nlh->nlmsg_flags & NLM_F_ECHO);
}


x86 assembly (clang, -O0):
<nlmsg_report>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ed3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_report>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rdi)
setne  %al
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
@NLM_F_ECHO = global i32 0
define i32 @nlmsg_report(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%3 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%4 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @NLM_F_ECHO
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
@NLM_F_ECHO = global i32 0
define i32 @nlmsg_report(%struct.nlmsghdr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @NLM_F_ECHO
%5 = and i32 %4, %3
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void strv_clear(char **l) {
  char **k;
  if (!l)
    return;
  for (k = l; *k; k++)
    free(*k);
  *l = NULL;
}


x86 assembly (clang, -O0):
<strv_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <strv_clear+0x1c>
jmp    116a <strv_clear+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <strv_clear+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <strv_clear+0x24>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_clear>:
test   %rdi,%rdi
je     114f <strv_clear+0x3f>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <strv_clear+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <strv_clear+0x20>
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strv_clear(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @free(i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
store i8* null, i8** %0
br label %14
14: ; preds = %1, %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
void uninit1() {
  int *array = malloc(5 * sizeof(int));
  printf("%d\n", array[2]);
  free(array);
}


x86 assembly (clang, -O0):
<uninit1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninit1>:
push   %rbx
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x8(%rax),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @uninit1() {
%1 = tail call i32* @malloc(i32 20)
%2 = getelementptr inbounds i32, i32* %1, i64 2
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vector_1_x();
int main() {
  vector_1_x();
  exit(0);
}


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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vector_1_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
sub(string1, string2) { return (binstr(strbin(string1) - strbin(string2))); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <strbin@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <strbin@plt>
mov    -0xc(%rbp),%edi
sub    %eax,%edi
mov    $0x0,%al
call   1030 <binstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
xor    %eax,%eax
call   1040 <strbin@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <strbin@plt>
sub    %eax,%ebp
mov    %ebp,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <binstr@plt>

LLVM IR (-O0):
define i32 @sub(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %7)
%9 = sub nsw i32 %6, %8
%10 = call i32 (i32, ...) bitcast (i32 (...)* @binstr to i32 (i32, ...)*)(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %1)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @binstr to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void gl_putc(int c) {
  char ch = (char)(unsigned char)c;
  write(1, &ch, 1);
  if (ch == '\n') {
    ch = '\r';
    write(1, &ch, 1);
  }
}


x86 assembly (clang, -O0):
<gl_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1152 <gl_putc+0x42>
movb   $0xd,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_putc>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xa,%bl
jne    114d <gl_putc+0x3d>
movb   $0xd,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gl_putc(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @write(i32 1, i8* %2, i32 1)
%5 = and i32 %0, 255
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
store i8 13, i8* %2
%8 = call i32 @write(i32 1, i8* %2, i32 1)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int intcelcon_number_of_points_in_cell(int i, int *length) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(749, &i, length, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_number_of_points_in_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2ed,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_number_of_points_in_cell>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2ed,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intcelcon_number_of_points_in_cell(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 749, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @intcelcon_number_of_points_in_cell(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 749, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_eapol_pwk_hsk_usage(void) {
  printf("\nUsage : sys_cfg_eapol_pwk_hsk [<TIMEOUT> <RETRIES>]\n");
  printf("\nIf TIMEOUT and number of RETRIES are both provided, a 'set' is "
         "performed.");
  printf("\nIf no parameter is provided,a 'get' is performed.");
  printf("\nTIMEOUT and number of RETRIES should be greater than or equal to "
         "zero\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_eapol_pwk_hsk_usage>:
push   %rax
lea    0xf56(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf67(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"\0AUsage : sys_cfg_eapol_pwk_hsk [<TIMEOUT> <RETRIES>]\0A\00"
@.str.1 = [75 x i8] c"\0AIf TIMEOUT and number of RETRIES are both provided, a 'set' is performed.\00"
@.str.2 = [51 x i8] c"\0AIf no parameter is provided,a 'get' is performed.\00"
@.str.3 = [72 x i8] c"\0ATIMEOUT and number of RETRIES should be greater than or equal to zero\0A\00"
define void @print_sys_cfg_eapol_pwk_hsk_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [75 x i8] c"\0AIf TIMEOUT and number of RETRIES are both provided, a 'set' is performed.\00"
@.str.2 = [51 x i8] c"\0AIf no parameter is provided,a 'get' is performed.\00"
@str = [53 x i8] c"\0AUsage : sys_cfg_eapol_pwk_hsk [<TIMEOUT> <RETRIES>]\00"
@str.4 = [71 x i8] c"\0ATIMEOUT and number of RETRIES should be greater than or equal to zero\00"
define void @print_sys_cfg_eapol_pwk_hsk_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char const *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *estrdup(const char *s) {
  char *t;
  t = (char *)malloc(strlen(s) + 1);
  if (t == NULL)
    eprintf("estrdup(\"%.20s\") failed:", s);
  strcpy(t, s);
  return t;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1180 <estrdup+0x40>
mov    -0x8(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1060 <eprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116c <estrdup+0x2c>
lea    0xe9c(%rip),%rdi
mov    %r14,%rsi
call   1060 <eprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"estrdup(\22%.20s\22) failed:\00"
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @eprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %1
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [25 x i8] c"estrdup(\22%.20s\22) failed:\00"
define i8* @estrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @eprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
unsigned char f88(unsigned char x, unsigned long int y) {
  return (x << (8 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f88>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f88>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f88(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 8, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = add nsw i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f88(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 8, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = add nsw i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
size_t strlen(char *const);
size_t fts_maxarglen(char *const *argv) {
  size_t len, max;
  for (max = 0; *argv; ++argv)
    if ((len = strlen(*argv)) > max)
      max = len;
  return (max + 1);
}


x86 assembly (clang, -O0):
<fts_maxarglen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     116a <fts_maxarglen+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmp    -0x18(%rbp),%rax
jbe    1154 <fts_maxarglen+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <fts_maxarglen+0x49>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <fts_maxarglen+0x14>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_maxarglen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114e <fts_maxarglen+0x3e>
add    $0x8,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
call   1030 <strlen@plt>
cmp    %r14,%rax
cmova  %rax,%r14
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <fts_maxarglen+0x20>
add    $0x1,%r14
jmp    1154 <fts_maxarglen+0x44>
mov    $0x1,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fts_maxarglen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8** [ %11, %4 ], [ %0, %1 ]
%8 = tail call i64 @strlen(i8* %5)
%9 = icmp ugt i64 %8, %6
%10 = select i1 %9, i64 %8, i64 %6
%11 = getelementptr inbounds i8*, i8** %7, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = add i64 %10, 1
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 1, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SysCtlLDOSleepSet(uint32_t ui32Voltage) {

  ;
  (*((volatile uint32_t *)(0x400FE1B4))) = ui32Voltage;
}


x86 assembly (clang, -O0):
<SysCtlLDOSleepSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe1b4,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDOSleepSet>:
mov    %edi,0x400fe1b4
ret

LLVM IR (-O0):
define void @SysCtlLDOSleepSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074782644 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlLDOSleepSet(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074782644 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
scalar_t__ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/);
pid_t vfork(void) {
  pid_t pid;
  pid = fork();
  if (!pid) {
    return 0;
  } else {
    if (waitpid(pid, NULL, 0) < 0)
      return pid;
  }
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <vfork+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1170 <vfork+0x50>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jge    116b <vfork+0x4b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <vfork+0x50>
jmp    1170 <vfork+0x50>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1139 <vfork+0x19>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @vfork() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @waitpid(i32 %1, i32* null, i32 0)
br label %5
5: ; preds = %3, %0
ret i32 %1
}