xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) {
  printf("Patience, the program takes some time to complete.\n Upon "
         "completion, all results will be printed in a table and graphed.\n");
}


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

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

LLVM IR (-O0):
@.str = [122 x i8] c"Patience, the program takes some time to complete.\0A Upon completion, all results will be printed in a table and graphed.\0A\00"
define void @print_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [121 x i8] c"Patience, the program takes some time to complete.\0A Upon completion, all results will be printed in a table and graphed.\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void pushToOrigin(const char *branchName) {
  printf("git push origin %s\n", branchName);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"git push origin %s\0A\00"
define void @pushToOrigin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"git push origin %s\0A\00"
define void @pushToOrigin(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int SNDDummyReset() { return 0; }


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

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

LLVM IR (-O0):
define i32 @SNDDummyReset() {
ret i32 0
}

LLVM IR (-O2):
define i32 @SNDDummyReset() {
ret i32 0
}
/* Variables and functions */
float exp(float);
float f_exp(float x) { return exp(x); }


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

x86 assembly (clang, -O2):
<f_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define float @f_exp(float %0) {
%2 = tail call float @exp(float %0)
ret float %2
}
int test_imm_61uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x61 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_61uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 97
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void delay(int msec) {
  if (msec == 0) {
    msec = 1;
  }
  struct timespec time1, remain;
  time1.tv_sec = msec / 1000;
  time1.tv_nsec = (msec - (time1.tv_sec * 1000)) * 1000000;
  nanosleep(&time1, &remain);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <delay+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x3e8,-0x10(%rbp),%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
sub    $0x18,%rsp
test   %edi,%edi
mov    $0x1,%eax
cmovne %edi,%eax
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,0x8(%rsp)
imul   $0xfffffc18,%ecx,%ecx
add    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 1000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* %2
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, 1000
%16 = sub nsw i32 %12, %15
%17 = mul nsw i32 %16, 1000000
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %17, i32* %18
%19 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @delay(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 1, i32 %0
%6 = bitcast %struct.timespec* %2 to i8*
%7 = bitcast %struct.timespec* %3 to i8*
%8 = sdiv i32 %5, 1000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %8, i32* %9
%10 = mul nsw i32 %8, -1000
%11 = add i32 %10, %5
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %12, i32* %13
%14 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
/* Variables and functions */
int get_data_int();
int /*<<< orphan*/ send_int_to_srv(int);
int get_rate() {
  send_int_to_srv(0x17);
  return get_data_int();
}


x86 assembly (clang, -O0):
<get_rate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1040 <get_data_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rate>:
push   %rax
mov    $0x17,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_data_int@plt>

LLVM IR (-O0):
define i32 @get_rate() {
%1 = call i32 @send_int_to_srv(i32 23)
%2 = call i32 (...) @get_data_int()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_rate() {
%1 = tail call i32 @send_int_to_srv(i32 23)
%2 = tail call i32 (...) @get_data_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void INT_Excep_PERIB_INTB183(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB183() {
ret void
}
void vectInit(int X[10]) {
  int j;
  for (j = 0; j < 5; j++)
    X[j] = 1;
  for (; j < 10; j++)
    X[j] = 0;
}


x86 assembly (clang, -O0):
<vectInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1136 <vectInit+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <vectInit+0xf>
jmp    113b <vectInit+0x3b>
cmpl   $0xa,-0xc(%rbp)
jge    1162 <vectInit+0x62>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <vectInit+0x3b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectInit>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0x1,0x10(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x14(%rdi)
movl   $0x0,0x24(%rdi)
ret

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

LLVM IR (-O2):
define void @vectInit(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 1, i32* %3
%4 = getelementptr i32, i32* %0, i64 5
%5 = bitcast i32* %4 to i8*
ret void
}
/* Variables and functions */
unsigned int rohc_b2u(const bool boolean) { return (boolean ? 1 : 0); }


x86 assembly (clang, -O0):
<rohc_b2u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rohc_b2u>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @rohc_b2u(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void pn_environ_free(char **environ) {
  char **env;
  for (env = environ; *env; ++env) {
    pn_free(*env);
  }
  pn_free(environ);
}


x86 assembly (clang, -O0):
<pn_environ_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1151 <pn_environ_free+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <pn_free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <pn_environ_free+0x14>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <pn_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_environ_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1143 <pn_environ_free+0x33>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <pn_free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <pn_environ_free+0x20>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pn_free@plt>

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

LLVM IR (-O2):
define void @pn_environ_free(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
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 (i8*, ...) bitcast (i32 (...)* @pn_free to i32 (i8*, ...)*)(i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 (i8**, ...) bitcast (i32 (...)* @pn_free to i32 (i8**, ...)*)(i8** %0)
ret void
}
unsigned char get_lock_config(unsigned char lock_what) {
  unsigned char config = 0;
  config |= lock_what;
  return config;
}


x86 assembly (clang, -O0):
<get_lock_config>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @get_lock_config(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = or i32 %7, %5
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @get_lock_config(i8 returned zeroext %0) {
ret i8 %0
}
void ve_register_nfs_hooks(struct ve_struct *ve) {}


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

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

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

LLVM IR (-O2):
%struct.ve_struct = type opaque
define void @ve_register_nfs_hooks(%struct.ve_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ INADDR_NONE;
int inet_aton(char const *, struct in_addr *);
uint32_t inet_addr(const char *str) {
  struct in_addr a;
  int rv = inet_aton(str, &a);
  return rv ? INADDR_NONE : a.s_addr;
}


x86 assembly (clang, -O0):
<inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <inet_aton@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1147 <inet_addr+0x37>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <inet_addr+0x3d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_addr>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <inet_aton@plt>
test   %eax,%eax
je     112d <inet_addr+0x1d>
mov    0x2ebb(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.in_addr
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @inet_aton(i8* %5, %struct.in_addr* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* @INADDR_NONE
br label %14
11: ; preds = %1
%12 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%13 = load i32, i32* %12
br label %14
14: ; preds = %11, %9
%15 = phi i32 [ %10, %9 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* @INADDR_NONE
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = select i1 %5, i32 %8, i32 %6
ret i32 %9
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time(void) {
  struct timeval timev;
  gettimeofday(&timev, NULL);
  return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ socket_module_init();
int /*<<< orphan*/ sp_module_init();
int /*<<< orphan*/ transport_module_init();
int /*<<< orphan*/ xpoll_module_init();
void __attribute__((constructor)) __modules_init(void) {
  transport_module_init();
  socket_module_init();
  xpoll_module_init();
  sp_module_init();
}


x86 assembly (clang, -O0):
<__modules_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <transport_module_init@plt>
mov    $0x0,%al
call   1030 <socket_module_init@plt>
mov    $0x0,%al
call   1040 <xpoll_module_init@plt>
mov    $0x0,%al
call   1060 <sp_module_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__modules_init>:
push   %rax
xor    %eax,%eax
call   1050 <transport_module_init@plt>
xor    %eax,%eax
call   1030 <socket_module_init@plt>
xor    %eax,%eax
call   1040 <xpoll_module_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <sp_module_init@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__modules_init, i8* null }]
define void @__modules_init() {
%1 = call i32 (...) @transport_module_init()
%2 = call i32 (...) @socket_module_init()
%3 = call i32 (...) @xpoll_module_init()
%4 = call i32 (...) @sp_module_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__modules_init, i8* null }]
define void @__modules_init() {
%1 = tail call i32 (...) @transport_module_init()
%2 = tail call i32 (...) @socket_module_init()
%3 = tail call i32 (...) @xpoll_module_init()
%4 = tail call i32 (...) @sp_module_init()
ret void
}
int prog_max(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<prog_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <prog_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <prog_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @prog_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle1() { kprintf("ISR %d.\n", 1); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle1() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle1() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_print_params(char *);
int /*<<< orphan*/ ft_putchar(char);
int main(int argc, char **argv) {
  int n;
  n = 0;
  while (n < argc) {
    if (n != 0) {
      ft_print_params(argv[n]);
      ft_putchar('\n');
    }
    n++;
  }
  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    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117c <main+0x5c>
cmpl   $0x0,-0x14(%rbp)
je     116e <main+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_print_params@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    115c <main+0x3c>
cmp    $0x1,%edi
je     115c <main+0x3c>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <ft_print_params@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = icmp eq i32 %0, 1
br i1 %6, label %15, label %7
7: ; preds = %4, %7
%8 = phi i64 [ %13, %7 ], [ 1, %4 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @ft_print_params(i8* %10)
%12 = tail call i32 @ft_putchar(i8 signext 10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %7
15: ; preds = %7, %4, %2
ret i32 0
}
char *mote16_Name(void) { return "MOTE16"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"MOTE16\00"
define i8* @mote16_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"MOTE16\00"
define i8* @mote16_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *strtok(char *, char const *);
int wordCount(char *str, const char *delimiter) {
  int result = 0;
  char *token = strtok(str, delimiter);
  if (token != NULL) {
    result++;
    while (strtok(NULL, delimiter) != NULL) {
      result++;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<wordCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1176 <wordCount+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
cmp    $0x0,%rax
je     1171 <wordCount+0x61>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <wordCount+0x3c>
jmp    1176 <wordCount+0x66>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordCount>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <wordCount+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <wordCount+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @wordCount(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 1, %2 ]
%7 = tail call i8* @strtok(i8* null, i8* %1)
%8 = icmp eq i8* %7, null
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %6, %5 ]
ret i32 %11
}
double f3(double x) { return __builtin_sqrt(x); }


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

x86 assembly (clang, -O2):
<f3>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <f3+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @f3(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
void irq_setup_gates(void) {}


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

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

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

LLVM IR (-O2):
define void @irq_setup_gates() {
ret void
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u3(void) { return (rand() & 0x7); }


x86 assembly (clang, -O0):
<mk_rnd_u3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u3>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u3() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 7
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u3() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 7
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ dw_printf(char *);
void morse_tone(int tu) {
  int num_cycles;
  int n;
  for (n = 0; n < tu; n++) {
    dw_printf("#");
  }
}


x86 assembly (clang, -O0):
<morse_tone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <morse_tone+0x38>
lea    0xecb(%rip),%rdi
call   1030 <dw_printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <morse_tone+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morse_tone>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <morse_tone+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <dw_printf@plt>
add    $0xffffffff,%ebx
jne    1130 <morse_tone+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define void @morse_tone(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @dw_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void testOffsetZeroDoubleFree() {
  int *array = malloc(sizeof(int) * 2);
  int *p = &array[0];
  free(p);
  free(&array[0]);
}


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

x86 assembly (clang, -O2):
<testOffsetZeroDoubleFree>:
push   %rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testOffsetZeroDoubleFree() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 8)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @testOffsetZeroDoubleFree() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret void
}
/* Type definitions */
struct state {
  int dummy;
};
struct debug_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reset_state(struct state *);
void cli_reset(struct state *context, struct debug_state *dbg_context,
               char **args) {
  reset_state(context);
}


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

x86 assembly (clang, -O2):
<cli_reset>:
jmp    1030 <reset_state@plt>

LLVM IR (-O0):
%struct.state = type { i32 }
%struct.debug_state = type { i32 }
define void @cli_reset(%struct.state* %0, %struct.debug_state* %1, i8** %2) {
%4 = alloca %struct.state*
%5 = alloca %struct.debug_state*
%6 = alloca i8**
store %struct.state* %0, %struct.state** %4
store %struct.debug_state* %1, %struct.debug_state** %5
store i8** %2, i8*** %6
%7 = load %struct.state*, %struct.state** %4
%8 = call i32 @reset_state(%struct.state* %7)
ret void
}

LLVM IR (-O2):
%struct.state = type { i32 }
%struct.debug_state = type { i32 }
define void @cli_reset(%struct.state* %0, %struct.debug_state* nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @reset_state(%struct.state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, unsigned long);
void mem_set(void *src, char value, unsigned long len) {
  memset(src, value, len);
}


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

x86 assembly (clang, -O2):
<mem_set>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @mem_set(i8* %0, i8 signext %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i64
store i8* %0, i8** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i64, i64* %6
%10 = call i32 @memset(i8* %7, i8 signext %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @mem_set(i8* %0, i8 signext %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext %1, i64 %2)
ret void
}
int main() {
  int *a[2];
  {
    a[0] = __builtin_alloca(sizeof(int) * 8);
    a[0][0] = 2;
  }
  {
    a[1] = __builtin_alloca(sizeof(int) * 8);
    a[1][0] = 5;
  }
  return a[0][0] + a[1][0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
lea    -0x60(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32*]
store i32 0, i32* %1
%3 = alloca i8, i64 32
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
store i32* %4, i32** %5
%6 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 2, i32* %8
%9 = alloca i8, i64 32
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 1
store i32* %10, i32** %11
%12 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 1
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 5, i32* %14
%15 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 1
%20 = load i32*, i32** %19
%21 = getelementptr inbounds i32, i32* %20, i64 0
%22 = load i32, i32* %21
%23 = add nsw i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
ret i32 7
}
int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.vrfb = type opaque
define i32 @omap_vrfb_request_ctx(%struct.vrfb* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergesort(int array[], int p, int r) {
  int q;
  if (r > p) {
    q = (p + r) / 2;
    mergesort(array, p, q);
    mergesort(array, q + 1, r);
    merge(array, p, q, r);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1182 <mergesort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %esi,%edx
jle    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int num;
  int num2;
  scanf("%d %d", &num, &num2);
  printf("you get %d - %d muffins!\n", num, num2);
  return EXIT_SUCCESS;
}


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)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [26 x i8] c"you get %d - %d muffins!\0A\00"
@EXIT_SUCCESS = global i32 0
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
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [26 x i8] c"you get %d - %d muffins!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
scalar_t__ getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ remove(char *);
main() {
  char line[1000];
  while (getline(line, 1000) > 0) {
    if (remove(line) > 0) {
      printf("%s", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
cmp    $0x0,%rax
jle    118b <main+0x5b>
lea    -0x3f0(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jle    1186 <main+0x56>
lea    -0x3f0(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %rax,%rax
jle    118c <main+0x5c>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
jmp    1172 <main+0x42>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %rax,%rax
jle    118c <main+0x5c>
mov    %rbx,%rdi
call   1030 <remove@plt>
test   %rax,%rax
jle    1160 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i64 @getline(i8* %4, i32 1000)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i64 @remove(i8* %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %7
br label %3
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline(i8* %2, i32 1000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = call i64 @remove(i8* %2)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i64 @getline(i8* %2, i32 1000)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
int test_imm_6Euint8_mem(unsigned char *val) {
  return ((*val) & (0x6E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Euint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x6e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Euint8_mem>:
testb  $0x6e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 110
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *mostra(void *p) { return (char *)p; }


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

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

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

LLVM IR (-O2):
define i8* @mostra(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
void f() {
  char const *aa = "Àéîõü";
  char const *a = "ÐÐ¾ÑÐºÐ°";
  wchar_t const *b = L"ÐÐ¾ÑÐºÐ°";
  wchar_t const *b2 = L"\x4f60\x597d\x10300";
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeff(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xf20(%rip),%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"\C3\80\C3\A9\C3\AE\C3\B5\C3\BC\00"
@.str.1 = [21 x i8] c"\C3\90\C2\9A\C3\90\C2\BE\C3\91\C2\88\C3\90\C2\BA\C3\90\C2\B0\00"
@.str.2 = [11 x i32] [i32 208, i32 154, i32 208, i32 190, i32 209, i32 136, i32 208, i32 186, i32 208, i32 176, i32 0]
@.str.3 = [4 x i32] [i32 20320, i32 22909, i32 66304, i32 0]
define void @f() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8* bitcast ([11 x i32]* @.str.2 to i8*), i8** %3
store i8* bitcast ([4 x i32]* @.str.3 to i8*), i8** %4
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}