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

/* Variables and functions */
int /*<<< orphan*/ BigEndianWriteU64(int /*<<< orphan*/, int /*<<< orphan*/ *);
void BigEndianWriteF64(double value, uint8_t *bytes) {
  union {
    double f64;
    uint64_t u64;
  } u;
  u.f64 = value;
  BigEndianWriteU64(u.u64, bytes);
}


x86 assembly (clang, -O0):
<BigEndianWriteF64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <BigEndianWriteU64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigEndianWriteF64>:
mov    %rdi,%rsi
movq   %xmm0,%rdi
jmp    1030 <BigEndianWriteU64@plt>

LLVM IR (-O0):
%union.anon = type { double }
define void @BigEndianWriteF64(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca %union.anon
store double %0, double* %3
store i32* %1, i32** %4
%6 = load double, double* %3
%7 = bitcast %union.anon* %5 to double*
store double %6, double* %7
%8 = bitcast %union.anon* %5 to i32*
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = call i32 @BigEndianWriteU64(i32 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @BigEndianWriteF64(double %0, i32* %1) {
%3 = bitcast double %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @BigEndianWriteU64(i32 %4, i32* %1)
ret void
}
/* Variables and functions */
int isNaN(float);
int /*<<< orphan*/ printf(char *, int, float);
void test(int x) {
  float y = *(float *)&x;
  printf("%d %f\n", isNaN(y), y);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isNaN@plt>
mov    %eax,%esi
movss  -0x8(%rbp),%xmm0
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movd   %edi,%xmm0
movd   %xmm0,0x4(%rsp)
call   1030 <isNaN@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %f\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = bitcast i32* %2 to float*
%5 = load float, float* %4
store float %5, float* %3
%6 = load float, float* %3
%7 = call i32 @isNaN(float %6)
%8 = load float, float* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, float %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %f\0A\00"
define void @test(i32 %0) {
%2 = bitcast i32 %0 to float
%3 = tail call i32 @isNaN(float %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, float %2)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getpeername(int, struct sockaddr *, int /*<<< orphan*/ *);
int test(void) {
  int sockfd = 4;
  struct sockaddr addr;
  socklen_t addrlen;
  return getpeername(sockfd, &addr, &addrlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <getpeername@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = alloca i32
store i32 4, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @getpeername(i32 %4, %struct.sockaddr* %2, i32* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca %struct.sockaddr
%2 = alloca i32
%3 = bitcast %struct.sockaddr* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getpeername(i32 4, %struct.sockaddr* %1, i32* %2)
ret i32 %5
}
void ieee80211_proc_init_interface(struct ieee80211_local *local) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_local = type opaque
define void @ieee80211_proc_init_interface(%struct.ieee80211_local* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void *dlopen(const char *fn, int flag) {
  printk("Write dlopen()\n");
  return 0;
}


x86 assembly (clang, -O0):
<dlopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Write dlopen()\0A\00"
define i8* @dlopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [16 x i8] c"Write dlopen()\0A\00"
define noalias i8* @dlopen(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Wc(char const);
void Ws(const char *s) {
  while (*s) {
    Wc(*s);
    s++;
  }
}


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

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

LLVM IR (-O0):
define void @Ws(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 = load i8, i8* %8
%10 = call i32 @Wc(i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @Ws(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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @Wc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ errn_exit(int, char *);
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void _condwait(pthread_cond_t *c, pthread_mutex_t *l) {
  int n = pthread_cond_wait(c, l);
  if (n)
    errn_exit(n, "_condwait");
}


x86 assembly (clang, -O0):
<_condwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1159 <_condwait+0x39>
mov    -0x14(%rbp),%edi
lea    0xeac(%rip),%rsi
call   1030 <errn_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_condwait>:
push   %rax
call   1040 <pthread_cond_wait@plt>
test   %eax,%eax
je     1139 <_condwait+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errn_exit@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"_condwait\00"
define void @_condwait(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @errn_exit(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int __builtin_rx_revw(int);
int half_word_swap(int arg) { return __builtin_rx_revw(arg); }


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

x86 assembly (clang, -O2):
<half_word_swap>:
jmp    1030 <__builtin_rx_revw@plt>

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

LLVM IR (-O2):
define i32 @half_word_swap(i32 %0) {
%2 = tail call i32 @__builtin_rx_revw(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ deallocate_vm();
void deallocate() { deallocate_vm(); }


x86 assembly (clang, -O0):
<deallocate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <deallocate_vm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deallocate>:
xor    %eax,%eax
jmp    1030 <deallocate_vm@plt>

LLVM IR (-O0):
define void @deallocate() {
%1 = call i32 (...) @deallocate_vm()
ret void
}

LLVM IR (-O2):
define void @deallocate() {
%1 = tail call i32 (...) @deallocate_vm()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t parseDecimal(char c) {
  int32_t result = 0;
  if ((c >= '0') && (c <= '9')) {
    result = (int32_t)(c - '0');
  } else {
    result = -1;
  }
  return result;
}


x86 assembly (clang, -O0):
<parseDecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     113a <parseDecimal+0x3a>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     113a <parseDecimal+0x3a>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <parseDecimal+0x41>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseDecimal>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @parseDecimal(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %3
br label %16
15: ; preds = %7, %1
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @parseDecimal(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
void LedsP$Led1$set(void) { HplAtm128GeneralIOPinP$1$IO$set(); }


x86 assembly (clang, -O0):
<LedsP$Led1$set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplAtm128GeneralIOPinP$1$IO$set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedsP$Led1$set>:
xor    %eax,%eax
jmp    1030 <HplAtm128GeneralIOPinP$1$IO$set@plt>

LLVM IR (-O0):
define void @"LedsP$Led1$set"() {
%1 = call i32 (...) @"HplAtm128GeneralIOPinP$1$IO$set"()
ret void
}

LLVM IR (-O2):
define void @"LedsP$Led1$set"() {
%1 = tail call i32 (...) @"HplAtm128GeneralIOPinP$1$IO$set"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, const char *argv[]) {
  typedef struct {
    int month;
    int day;
    int year;
  } Date;
  Date a = {1, 2, 3};
  printf("%ld,%ld,%ld", a.month, a.day, a.year);
  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)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Date = type { i32, i32, i32 }
@__const.main.a = %struct.Date { i32 1, i32 2, i32 3 }
@.str = [12 x i8] c"%ld,%ld,%ld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Date
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast %struct.Date* %6 to i8*
%8 = getelementptr inbounds %struct.Date, %struct.Date* %6, i32 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.Date, %struct.Date* %6, i32 0, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.Date, %struct.Date* %6, i32 0, i32 2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%ld,%ld,%ld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ type;
};
typedef TYPE_1__ MYSQL_FIELD;

/* Variables and functions */
scalar_t__ IS_NUM(int /*<<< orphan*/);
char *nth_field_type(int i, MYSQL_FIELD *field) {
  if (IS_NUM(field[i].type))
    return "num";
  else
    return "string";
}


x86 assembly (clang, -O0):
<nth_field_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <IS_NUM@plt>
cmp    $0x0,%rax
je     1149 <nth_field_type+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <nth_field_type+0x44>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_field_type>:
push   %rax
movslq %edi,%rax
mov    (%rsi,%rax,4),%edi
call   1030 <IS_NUM@plt>
test   %rax,%rax
lea    0xede(%rip),%rcx
lea    0xed3(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@.str = [4 x i8] c"num\00"
@.str.1 = [7 x i8] c"string\00"
define i8* @nth_field_type(i32 %0, %struct.TYPE_3__* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 %3, i32 0
%5 = load i32, i32* %4
%6 = tail call i64 @IS_NUM(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %8
}
int bitcount(unsigned x) {
  int n = 0;
  while (x != 0) {
    x &= (x - 1);
    ++n;
  }
  return n;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
unsigned int my_imul08(unsigned int a, unsigned int b) {
  char a08, b08;
  short a16;
  a08 = a & 0xFF;
  b08 = b & 0xFF;
  a16 = a08 * b08;
  return (int)a16;
}


x86 assembly (clang, -O0):
<my_imul08>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xa(%rbp)
movsbl -0x9(%rbp),%eax
movsbl -0xa(%rbp),%ecx
imul   %ecx,%eax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_imul08>:
movsbl %dil,%ecx
movsbl %sil,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_imul08(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* %6
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = mul nsw i32 %15, %17
%19 = trunc i32 %18 to i16
store i16 %19, i16* %7
%20 = load i16, i16* %7
%21 = sext i16 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @my_imul08(i32 %0, i32 %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
%7 = mul nsw i32 %6, %4
ret i32 %7
}
char *hash_plugin_summary(void) { return ("wpa \t\tWPA-PSK plugin"); }


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"wpa \09\09WPA-PSK plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"wpa \09\09WPA-PSK plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int SIGPIPE;
int /*<<< orphan*/ printf(char *);
void signalHandle(int sigNum) {
  if (sigNum == SIGPIPE) {
    printf("I got you, sigpipe when the other side closes the connection\n");
  }
}


x86 assembly (clang, -O0):
<signalHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <signalHandle+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandle>:
mov    0x2ec9(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <signalHandle+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGPIPE = global i32 0
@.str = [62 x i8] c"I got you, sigpipe when the other side closes the connection\0A\00"
define void @signalHandle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGPIPE
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@str = [61 x i8] c"I got you, sigpipe when the other side closes the connection\00"
define void @signalHandle(i32 %0) {
%2 = load i32, i32* @SIGPIPE
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B();
void A(void) { B(); }


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <B@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
xor    %eax,%eax
jmp    1030 <B@plt>

LLVM IR (-O0):
define void @A() {
%1 = call i32 (...) @B()
ret void
}

LLVM IR (-O2):
define void @A() {
%1 = tail call i32 (...) @B()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t MUL64x(uint64_t V, uint64_t c) {
  if (V & 0x8000000000000000)
    return (V << 1) ^ c;
  else
    return V << 1;
}


x86 assembly (clang, -O0):
<MUL64x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1136 <MUL64x+0x36>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <MUL64x+0x3f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MUL64x>:
lea    (%rdi,%rdi,1),%eax
sar    $0x1f,%edi
and    %esi,%edi
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @MUL64x(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = icmp slt i32 %0, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = xor i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  int i = 0x0102;
  char *p = (char *)&i;
  printf("Bytes of i: %d, %d\n", p[0], p[1]);
  assert(p[0] == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x102,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xeb8(%rip),%rdi
movsbl %cl,%esi
movsbl 0x1(%rax),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Bytes of i: %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 258, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Bytes of i: %d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext 2, i8 signext 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
OP(dd, c2) { op_c2(); }


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

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_c2@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c2()
ret i32 undef
}
/* Variables and functions */
float func32fd3();
float func783a(float f) { return f * func32fd3(); }


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

x86 assembly (clang, -O2):
<func783a>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <func32fd3@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func783a(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float (...) @func32fd3()
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @func783a(float %0) {
%2 = tail call float (...) @func32fd3()
%3 = fmul float %2, %0
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ cont(double, double);
int /*<<< orphan*/ move(double, double);
void box(double x0, double y0, double x1, double y1) {
  move(x0, y0);
  cont(x0, y1);
  cont(x1, y1);
  cont(x1, y0);
  cont(x0, y0);
}


x86 assembly (clang, -O0):
<box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <move@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <cont@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <cont@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <cont@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <cont@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<box>:
sub    $0x28,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <move@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <cont@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <cont@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1030 <cont@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
add    $0x28,%rsp
jmp    1030 <cont@plt>

LLVM IR (-O0):
define void @box(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call i32 @move(double %9, double %10)
%12 = load double, double* %5
%13 = load double, double* %8
%14 = call i32 @cont(double %12, double %13)
%15 = load double, double* %7
%16 = load double, double* %8
%17 = call i32 @cont(double %15, double %16)
%18 = load double, double* %7
%19 = load double, double* %6
%20 = call i32 @cont(double %18, double %19)
%21 = load double, double* %5
%22 = load double, double* %6
%23 = call i32 @cont(double %21, double %22)
ret void
}

LLVM IR (-O2):
define void @box(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @move(double %0, double %1)
%6 = tail call i32 @cont(double %0, double %3)
%7 = tail call i32 @cont(double %2, double %3)
%8 = tail call i32 @cont(double %2, double %1)
%9 = tail call i32 @cont(double %0, double %1)
ret void
}
/* Variables and functions */
scalar_t__ pow(float, float);
float stbir__srgb_to_linear(float f) {
  if (f <= 0.04045f)
    return f / 12.92f;
  else
    return (float)pow((f + 0.055f) / 1.055f, 2.4f);
}


x86 assembly (clang, -O0):
<stbir__srgb_to_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     114a <stbir__srgb_to_linear+0x3a>
movss  -0x8(%rbp),%xmm0
movss  0xed4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117a <stbir__srgb_to_linear+0x6a>
movss  0xeba(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xea9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe99(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__srgb_to_linear>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1145 <stbir__srgb_to_linear+0x35>
addss  0xee2(%rip),%xmm0
divss  0xede(%rip),%xmm0
movss  0xeda(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret
divss  0xeb7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stbir__srgb_to_linear(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 0x3FA4B5DCC0000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fdiv float %7, 0x4029D70A40000000
store float %8, float* %2
br label %15
9: ; preds = %1
%10 = load float, float* %3
%11 = fadd float %10, 0x3FAC28F5C0000000
%12 = fdiv float %11, 0x3FF0E147A0000000
%13 = call i64 @pow(float %12, float 0x4003333340000000)
%14 = sitofp i64 %13 to float
store float %14, float* %2
br label %15
15: ; preds = %9, %6
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
define float @stbir__srgb_to_linear(float %0) {
%2 = fcmp ugt float %0, 0x3FA4B5DCC0000000
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fdiv float %0, 0x4029D70A40000000
br label %10
5: ; preds = %1
%6 = fadd float %0, 0x3FAC28F5C0000000
%7 = fdiv float %6, 0x3FF0E147A0000000
%8 = tail call i64 @pow(float %7, float 0x4003333340000000)
%9 = sitofp i64 %8 to float
br label %10
10: ; preds = %5, %3
%11 = phi float [ %4, %3 ], [ %9, %5 ]
ret float %11
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int __syscall_statfs(char const *, struct statfs *);
int statfs(const char *path, struct statfs *buf) {
  return __syscall_statfs(path, buf);
}


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

x86 assembly (clang, -O2):
<statfs>:
jmp    1030 <__syscall_statfs@plt>

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

LLVM IR (-O2):
%struct.statfs = type { i32 }
define i32 @statfs(i8* %0, %struct.statfs* %1) {
%3 = tail call i32 @__syscall_statfs(i8* %0, %struct.statfs* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *memMalloc(size_t size) {
  void *ret = malloc(size);
  if (ret == NULL)
    die("Could not allocate enough memory");
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<memMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <memMalloc+0x30>
lea    0xea5(%rip),%rdi
call   1050 <die@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memMalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <memMalloc+0x20>
lea    0xeb5(%rip),%rdi
call   1050 <die@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Could not allocate enough memory\00"
define i8* @memMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [33 x i8] c"Could not allocate enough memory\00"
define i8* @memMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() { system("ls"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int, int, int, int);
int play_attack_defend_n(int, int, int, int, int, int);
int autohelperowl_attackpat176(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(1, -1, move, transformation);
  return play_attack_defend_n((1 + 2 - (color)), 1, 2, move, a, a);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat176>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x3,%edi
sub    -0x14(%rbp),%edi
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <play_attack_defend_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat176>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%ecx
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    $0x3,%edi
sub    %ebx,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <play_attack_defend_n@plt>

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat176(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 1, i32 -1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %9
%19 = sub nsw i32 3, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %11
%22 = load i32, i32* %11
%23 = call i32 @play_attack_defend_n(i32 %19, i32 1, i32 2, i32 %20, i32 %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat176(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 1, i32 -1, i32 %2, i32 %1)
%7 = sub nsw i32 3, %3
%8 = tail call i32 @play_attack_defend_n(i32 %7, i32 1, i32 2, i32 %2, i32 %6, i32 %6)
ret i32 %8
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ traverse(struct TreeNode *, int *, int *);
int rob(struct TreeNode *root) {
  int maxWithRoot = 0;
  int maxWithoutRoot = 0;
  traverse(root, &maxWithRoot, &maxWithoutRoot);
  return ((maxWithRoot) > (maxWithoutRoot) ? (maxWithRoot) : (maxWithoutRoot));
}


x86 assembly (clang, -O0):
<rob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <traverse@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <rob+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <rob+0x48>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rob>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <traverse@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
cmp    %eax,%ecx
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @rob(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
%3 = alloca i32
%4 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load %struct.TreeNode*, %struct.TreeNode** %2
%6 = call i32 @traverse(%struct.TreeNode* %5, i32* %3, i32* %4)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %3
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @rob(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = call i32 @traverse(%struct.TreeNode* %0, i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
%10 = select i1 %9, i32 %7, i32 %8
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t rdz_16(uint32_t addr) { return *((uint16_t *)addr); }


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

x86 assembly (clang, -O2):
<rdz_16>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rdz_16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rdz_16(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  fork();
  printf("Novo processo criado!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Novo processo criado!\0A\00"
define i32 @main() {
%1 = call i32 (...) @fork()
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Novo processo criado!\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509_REQ_OLD;
scalar_t__ i2d_X509_REQ;
int PEM_write_bio_X509_REQ_NEW(BIO *bp, X509_REQ *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_REQ,
                            PEM_STRING_X509_REQ_OLD, bp, x, NULL, NULL, 0, NULL,
                            NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_X509_REQ_NEW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_X509_REQ_NEW>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509_REQ = global i64 0
@PEM_STRING_X509_REQ_OLD = global i32 0
define i32 @PEM_write_bio_X509_REQ_NEW(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509_REQ
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_REQ_OLD
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509_REQ = global i64 0
@PEM_STRING_X509_REQ_OLD = global i32 0
define i32 @PEM_write_bio_X509_REQ_NEW(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509_REQ
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509_REQ_OLD
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int scan(void) {
  int x;
  printf("? ");
  scanf("%d", &x);
  return x;
}


x86 assembly (clang, -O0):
<scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"? \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @scan() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
int /*<<< orphan*/ *ImageToByte(size_t *, char *);
int main(void) {
  uint16_t jpegLength;
  uint8_t *jpegData =
      ImageToByte(&jpegLength, "H:\\eclipse\\workspace\\jpegCheaderExtractor_"
                               "nonavr\\Debug\\nyanNyan.JPG");
  for (uint16_t i = 0; i < jpegLength; i++) {
    uint8_t glaah = jpegData[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <ImageToByte@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <main+0x58>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [68 x i8] c"H:\\eclipse\\workspace\\jpegCheaderExtractor_nonavr\\Debug\\nyanNyan.JPG\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @ImageToByte(i64* %2, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
store i64 0, i64* %4
br label %7
7: ; preds = %16, %0
%8 = load i64, i64* %4
%9 = load i64, i64* %2
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i64, i64* %4
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %5
br label %16
16: ; preds = %11
%17 = load i64, i64* %4
%18 = add i64 %17, 1
store i64 %18, i64* %4
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [68 x i8] c"H:\\eclipse\\workspace\\jpegCheaderExtractor_nonavr\\Debug\\nyanNyan.JPG\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32* @ImageToByte(i64* %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret i32 0
}