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

/* Variables and functions */
int /*<<< orphan*/ I2C_Xfer(int, int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void I2C_Init(void) {
  uint8_t dummybyte;
  (*(volatile unsigned long *)(0xE001C000 + 0x14)) =
      (*(volatile unsigned long *)(0xE001C000 + 0x10)) =
          (5 * 11059200) / (200000) / 2;
  (*(volatile unsigned long *)(0xE001C000 + 0x18)) = 0xff;
  (*(volatile unsigned long *)(0xE001C000 + 0x00)) = (1 << 6);
  I2C_Xfer(0xff, &dummybyte, 0, 1);
}


x86 assembly (clang, -O0):
<I2C_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe001c010,%eax
movq   $0x8a,(%rax)
mov    $0xe001c014,%eax
movq   $0x8a,(%rax)
mov    $0xe001c018,%eax
movq   $0xff,(%rax)
mov    $0xe001c000,%eax
movq   $0x40,(%rax)
mov    $0xff,%edi
lea    -0x4(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <I2C_Xfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_Init>:
push   %rax
mov    $0xe001c000,%eax
movq   $0x8a,0x10(%rax)
movq   $0x8a,0x14(%rax)
movq   $0xff,0x18(%rax)
movq   $0x40,(%rax)
lea    0x4(%rsp),%rsi
mov    $0xff,%edi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <I2C_Xfer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @I2C_Init() {
%1 = alloca i32
store volatile i64 138, i64* inttoptr (i64 3758211088 to i64*)
store volatile i64 138, i64* inttoptr (i64 3758211092 to i64*)
store volatile i64 255, i64* inttoptr (i64 3758211096 to i64*)
store volatile i64 64, i64* inttoptr (i64 3758211072 to i64*)
%2 = call i32 @I2C_Xfer(i32 255, i32* %1, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @I2C_Init() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i64 138, i64* inttoptr (i64 3758211088 to i64*)
store volatile i64 138, i64* inttoptr (i64 3758211092 to i64*)
store volatile i64 255, i64* inttoptr (i64 3758211096 to i64*)
store volatile i64 64, i64* inttoptr (i64 3758211072 to i64*)
%3 = call i32 @I2C_Xfer(i32 255, i32* %1, i32 0, i32 1)
ret void
}
float sqrtf(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759d5 - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return 1.f / x;
}


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759d5,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe9c(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe83(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759d5,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xed3(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597462997, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
%23 = fdiv float 1.000000e+00, %22
ret float %23
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597462997, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
%10 = fdiv float 1.000000e+00, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ peligro(char *, char *);
yyerror(char *mensaje) { peligro(mensaje, (char *)0); }


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

x86 assembly (clang, -O2):
<yyerror>:
xor    %esi,%esi
jmp    1030 <peligro@plt>

LLVM IR (-O0):
define i32 @yyerror(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @peligro(i8* %4, i8* null)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @peligro(i8* %0, i8* null)
ret i32 undef
}
int xisdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<xisdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <xisdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xisdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xisdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int);
int /*<<< orphan*/ siftdown(int *, int);
int /*<<< orphan*/ swap(int *, int /*<<< orphan*/, int);
void heapsort(int arr[], int sz) {
  int i = 0;
  heapify(arr, sz - 1);
  for (i = sz - 1; i >= 0;) {
    swap(arr, 0, i);
    siftdown(arr, --i);
  }
}


x86 assembly (clang, -O0):
<heapsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <heapify@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     118d <heapsort+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1050 <swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x10(%rbp)
call   1030 <siftdown@plt>
jmp    115e <heapsort+0x2e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapsort>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    -0x1(%r15),%ebx
mov    %ebx,%esi
call   1040 <heapify@plt>
test   %r15d,%r15d
jle    1175 <heapsort+0x45>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <swap@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <siftdown@plt>
lea    0x1(%rbx),%eax
add    $0xffffffff,%eax
inc    %ebx
mov    %eax,%ebx
jne    1150 <heapsort+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @heapsort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @heapify(i32* %0, i32 %3)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @swap(i32* %0, i32 0, i32 %7)
%9 = add nsw i32 %7, -1
%10 = tail call i32 @siftdown(i32* %0, i32 %9)
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned long compare_and_swap64(unsigned long volatile *, unsigned long,
                                 unsigned long);
unsigned long compare_and_swap_ptr(volatile void *address, void *old_ptr,
                                   void *new_ptr) {
  return compare_and_swap64((volatile unsigned long *)address,
                            (unsigned long)old_ptr, (unsigned long)new_ptr);
}


x86 assembly (clang, -O0):
<compare_and_swap_ptr>:
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
call   1030 <compare_and_swap64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap_ptr>:
jmp    1030 <compare_and_swap64@plt>

LLVM IR (-O0):
define i64 @compare_and_swap_ptr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = call i64 @compare_and_swap64(i64* %8, i64 %10, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @compare_and_swap_ptr(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = tail call i64 @compare_and_swap64(i64* %4, i64 %5, i64 %6)
ret i64 %7
}
/* Variables and functions */
int INT_MIN;
int test1(int x) { return (x ^ INT_MIN) ^ 0x1234; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
xor    (%rcx),%eax
xor    $0x1234,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT_MIN
%5 = xor i32 %3, %4
%6 = xor i32 %5, 4660
ret i32 %6
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test1(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = xor i32 %2, %0
%4 = xor i32 %3, 4660
ret i32 %4
}
/* Variables and functions */
char *nla_reserve(void **, int, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
void nla_put_string(void **ctx, int type, const char *s) {
  char *dst = nla_reserve(ctx, type, strlen(s) + 1);
  strcpy(dst, s);
}


x86 assembly (clang, -O0):
<nla_put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <nla_reserve@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
call   1050 <nla_reserve@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @nla_put_string(i8** %0, i32 %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i8* @nla_reserve(i8** %8, i32 %9, i64 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %6
%16 = call i32 @strcpy(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @nla_put_string(i8** %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @nla_reserve(i8** %0, i32 %1, i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;
typedef int bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_u_int(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_u_char(XDR *xdrs, u_char *cp) {
  u_int u;
  u = (*cp);
  if (!xdr_u_int(xdrs, &u)) {
    return (0);
  }
  *cp = u;
  return (1);
}


x86 assembly (clang, -O0):
<xdr_u_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <xdr_u_int@plt>
cmp    $0x0,%eax
jne    114b <xdr_u_char+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    115b <xdr_u_char+0x4b>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_u_char>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <xdr_u_int@plt>
test   %eax,%eax
je     1139 <xdr_u_char+0x29>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
jmp    113b <xdr_u_char+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @xdr_u_char(i32* %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %1
store i32 %5, i32* %3
%6 = call i32 @xdr_u_int(i32* %0, i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i32, i32* %3
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __dbg_check_lock();
int /*<<< orphan*/ __stats_start_measure_crit_thd();
int /*<<< orphan*/ port_lock();
void chSysLock(void) {
  port_lock();
  __stats_start_measure_crit_thd();
  __dbg_check_lock();
}


x86 assembly (clang, -O0):
<chSysLock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <port_lock@plt>
mov    $0x0,%al
call   1040 <__stats_start_measure_crit_thd@plt>
mov    $0x0,%al
call   1030 <__dbg_check_lock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chSysLock>:
push   %rax
xor    %eax,%eax
call   1050 <port_lock@plt>
xor    %eax,%eax
call   1040 <__stats_start_measure_crit_thd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__dbg_check_lock@plt>

LLVM IR (-O0):
define void @chSysLock() {
%1 = call i32 (...) @port_lock()
%2 = call i32 (...) @__stats_start_measure_crit_thd()
%3 = call i32 (...) @__dbg_check_lock()
ret void
}

LLVM IR (-O2):
define void @chSysLock() {
%1 = tail call i32 (...) @port_lock()
%2 = tail call i32 (...) @__stats_start_measure_crit_thd()
%3 = tail call i32 (...) @__dbg_check_lock()
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
void removeExtension(char *pathname) {
  char *fname = strrchr(pathname, '.');
  if (fname)
    *fname = 0;
}


x86 assembly (clang, -O0):
<removeExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <removeExtension+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeExtension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1123 <removeExtension+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @removeExtension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @removeExtension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int kexit(int);
int kkexit(int value) { return kexit(value); }


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

x86 assembly (clang, -O2):
<kkexit>:
jmp    1030 <kexit@plt>

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

LLVM IR (-O2):
define i32 @kkexit(i32 %0) {
%2 = tail call i32 @kexit(i32 %0)
ret i32 %2
}
void tegra3_tsensor_init(struct tegra_tsensor_pmu_data *data) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_tsensor_pmu_data = type opaque
define void @tegra3_tsensor_init(%struct.tegra_tsensor_pmu_data* nocapture %0) {
ret void
}
int main(void) {
  int x = 5;
  int y = 6;
  int *restrict p = &x;
  int *restrict q = &x;
  p = q;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void createTypedefForInt32_t(void) {
  if (sizeof(signed int) == 4)
    printf("typedef signed int int32_t;\n");
  else if (sizeof(signed long) == 4)
    printf("typedef signed long int32_t;\n");
  else {
    fprintf(stderr, "Cannot find a 32 bit signed integer type!\n");
    exit(1);
  }
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"typedef signed int int32_t;\0A\00"
@stderr = global i32 0
define void @createTypedefForInt32_t() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@str = [28 x i8] c"typedef signed int int32_t;\00"
define void @createTypedefForInt32_t() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
void rop3_2_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_2_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_2_0_1>:
not    %sil
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_2_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_2_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ tolower(char);
void strtolo(char *s) {
  if (s != 0)
    while (*s) {
      *s = (char)tolower(*s);
      s++;
    }
}


x86 assembly (clang, -O0):
<strtolo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <strtolo+0x53>
jmp    112c <strtolo+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <strtolo+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strtolo+0x1c>
jmp    1163 <strtolo+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolo>:
push   %rbx
test   %rdi,%rdi
je     1146 <strtolo+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <strtolo+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolo+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strtolo(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, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = tail call i64 @tolower(i8 signext %7)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
void foo138() {}


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

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

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

LLVM IR (-O2):
define void @foo138() {
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SSIClockSourceSet(uint32_t ui32Base, uint32_t ui32Source) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000FC8))) = ui32Source;
}


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

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

LLVM IR (-O0):
define void @SSIClockSourceSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @SSIClockSourceSet(i64 %0, i64 %1) {
%3 = add i64 %0, 4040
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
double garan2();
double GARandomDouble(double low, double high) {
  double val = high - low;
  val *= garan2();
  return val + low;
}


x86 assembly (clang, -O0):
<GARandomDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <garan2@plt>
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GARandomDouble>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <garan2@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @GARandomDouble(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
store double %8, double* %5
%9 = call double (...) @garan2()
%10 = load double, double* %5
%11 = fmul double %10, %9
store double %11, double* %5
%12 = load double, double* %5
%13 = load double, double* %3
%14 = fadd double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @GARandomDouble(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @garan2()
%5 = fmul double %3, %4
%6 = fadd double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ logIT(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ reloadConfig();
void sigHupHandler(int signo) {
  logIT(LOG_NOTICE, "%s", "SIGHUP empfangen");
  reloadConfig();
}


x86 assembly (clang, -O0):
<sigHupHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1040 <logIT@plt>
mov    $0x0,%al
call   1030 <reloadConfig@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHupHandler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1040 <logIT@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reloadConfig@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"SIGHUP empfangen\00"
define void @sigHupHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_NOTICE
%4 = call i32 @logIT(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @reloadConfig()
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"SIGHUP empfangen\00"
define void @sigHupHandler(i32 %0) {
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @logIT(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @reloadConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_free_chain();
int /*<<< orphan*/ func1();
int getpid();
int /*<<< orphan*/ mmalloc_cleanup(int);
int /*<<< orphan*/ mmalloc_init();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ srand(int);
int main(int argc, char *argv[]) {
  int k = 0;
  int pid = getpid();
  printf("pid = %d\n", pid);
  srand(pid);
  mmalloc_init();
  func1();
  mmalloc_cleanup(1);
  return 0;
  while (k++ < 200) {
    alloc_free_chain();
  }
  mmalloc_cleanup(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   1070 <mmalloc_init@plt>
mov    $0x0,%al
call   1030 <func1@plt>
mov    $0x1,%edi
call   1080 <mmalloc_cleanup@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebx
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   1070 <mmalloc_init@plt>
xor    %eax,%eax
call   1030 <func1@plt>
mov    $0x1,%edi
call   1080 <mmalloc_cleanup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pid = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 (...) @getpid()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %7
%12 = call i32 @srand(i32 %11)
%13 = call i32 (...) @mmalloc_init()
%14 = call i32 (...) @func1()
%15 = call i32 @mmalloc_cleanup(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"pid = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @srand(i32 %3)
%6 = tail call i32 (...) @mmalloc_init()
%7 = tail call i32 (...) @func1()
%8 = tail call i32 @mmalloc_cleanup(i32 1)
ret i32 0
}
long VMM_IS_ERR(const void *ptr) {
  return (((unsigned long)ptr) &&
          ((unsigned long)((unsigned long)ptr) <= (unsigned long)4095));
}


x86 assembly (clang, -O0):
<VMM_IS_ERR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     112b <VMM_IS_ERR+0x2b>
mov    -0x8(%rbp),%rax
cmp    $0xfff,%rax
setbe  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMM_IS_ERR>:
test   %rdi,%rdi
setne  %al
cmp    $0x1000,%rdi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i64 @VMM_IS_ERR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = icmp ule i64 %8, 4095
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
define i64 @VMM_IS_ERR(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = icmp ult i8* %0, inttoptr (i64 4096 to i8*)
%4 = and i1 %2, %3
%5 = zext i1 %4 to i64
ret i64 %5
}
void dump_xilfatfs_stats() {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @dump_xilfatfs_stats() {
ret void
}
/* Variables and functions */
char *g_malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
extern char *FastCloneString(const char *src, int len) {
  char *dest;
  dest = g_malloc(len + 1);
  memcpy(dest, src, len);
  dest[len] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<FastCloneString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <g_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastCloneString>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <g_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @FastCloneString(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @g_malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @FastCloneString(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @g_malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
void __register_frame() {}


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

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

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

LLVM IR (-O2):
define void @__register_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void __printf_send(void *mydata, const char *data, size_t len) {
  unsigned i;
  (void)mydata;
  for (i = 0; i < len; i++) {
    putchar(data[i]);
  }
}


x86 assembly (clang, -O0):
<__printf_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1156 <__printf_send+0x46>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <__printf_send+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__printf_send>:
push   %r15
push   %r14
push   %rbx
test   %rdx,%rdx
je     1142 <__printf_send+0x32>
mov    %rdx,%r15
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    %r15,%rbx
jb     1130 <__printf_send+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__printf_send(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @putchar(i8 signext %8)
%10 = add nuw nsw i64 %6, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %2
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret void
}
void foo_1_1_2_2_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_2_2_2_2() {
ret void
}
int my_strlen(const char *src) {
  int count = 0;
  while (*src++)
    count++;
  return count;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <my_strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111c <my_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ _PWMFaultIntNumberGet(int /*<<< orphan*/);
void PWMFaultIntRegister(uint32_t ui32Base, void (*pfnIntHandler)(void)) {
  uint32_t ui32Int;
  ;
  ui32Int = _PWMFaultIntNumberGet(ui32Base);
  ;
  IntRegister(ui32Int, pfnIntHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<PWMFaultIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <_PWMFaultIntNumberGet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1050 <_PWMFaultIntNumberGet@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @PWMFaultIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
%5 = alloca i32
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%6 = load i32, i32* %3
%7 = call i32 @_PWMFaultIntNumberGet(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 %8, void (...)* %10)
%12 = load i32, i32* %5
%13 = call i32 @IntEnable(i32 %12)
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntRegister(i32 %0, void ()* %1) {
%3 = tail call i32 @_PWMFaultIntNumberGet(i32 %0)
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @IntRegister(i32 %3, void (...)* %4)
%6 = tail call i32 @IntEnable(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ atof(char const *);
int toInt(const char *str) { return (int)atof(str); }


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

x86 assembly (clang, -O2):
<toInt>:
jmp    1030 <atof@plt>

LLVM IR (-O0):
define i32 @toInt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atof(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @toInt(i8* nocapture %0) {
%2 = tail call i64 @atof(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
unsigned int invert(unsigned int x, int p, int n) {
  unsigned int mask = ~0 << (p - n) ^ ~(~0 << p);
  unsigned int unaffected_part = x & mask;
  unsigned int inverted_part = ~x ^ mask;
  return unaffected_part | inverted_part;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %esi,%ecx
sub    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
xor    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = shl i32 -1, %12
%14 = load i32, i32* %5
%15 = shl i32 -1, %14
%16 = xor i32 %15, -1
%17 = xor i32 %13, %16
store i32 %17, i32* %7
%18 = load i32, i32* %4
%19 = load i32, i32* %7
%20 = and i32 %18, %19
store i32 %20, i32* %8
%21 = load i32, i32* %4
%22 = xor i32 %21, -1
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = or i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = shl nsw i32 -1, %4
%6 = shl nsw i32 -1, %1
%7 = xor i32 %6, %0
%8 = xor i32 %7, %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, void *);
void __attribute__((no_instrument_function))
__cyg_profile_func_enter(void *func, void *caller) {
  printf("e %p %p\n", func, caller);
}


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

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"e %p %p\0A\00"
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int write(int, char *, int);
int write_http(void *connection_data, char *data, int data_length) {
  int *socket = (int *)connection_data;
  return write(*socket, data, data_length);
}


x86 assembly (clang, -O0):
<write_http>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @write_http(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @write(i32 %11, i8* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @write_http(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @write(i32 %5, i8* %1, i32 %2)
ret i32 %6
}