xunge/DecIR huggingface dataset:
char *mygets(void *arg, char *buffer, int len) { return buffer; }


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

x86 assembly (clang, -O2):
<mygets>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @mygets(i8* nocapture readnone %0, i8* readnone returned %1, i32 %2) {
ret i8* %1
}
/* Variables and functions */
float App_Get_Kl();
int /*<<< orphan*/ File_Fifo_Respond(char *);
int /*<<< orphan*/ sprintf(char *, char *, float);
void File_Fifo_Get_I_Limit(void) {
  char buffer[50];
  float limit;
  limit = App_Get_Kl();
  sprintf(buffer, "1\n%4.2f\n", limit);
  File_Fifo_Respond(buffer);
}


x86 assembly (clang, -O0):
<File_Fifo_Get_I_Limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1040 <App_Get_Kl@plt>
movss  %xmm0,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x44(%rbp),%xmm0
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <File_Fifo_Respond@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_Fifo_Get_I_Limit>:
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1040 <App_Get_Kl@plt>
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <File_Fifo_Respond@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1\0A%4.2f\0A\00"
define void @File_Fifo_Get_I_Limit() {
%1 = alloca [50 x i8]
%2 = alloca float
%3 = call float (...) @App_Get_Kl()
store float %3, float* %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = load float, float* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = call i32 @File_Fifo_Respond(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"1\0A%4.2f\0A\00"
define void @File_Fifo_Get_I_Limit() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call float (...) @App_Get_Kl()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %3)
%5 = call i32 @File_Fifo_Respond(i8* %2)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int, int);
int sum(int);
int main(int argc, char *argv[]) {
  int input = atoi("10");
  int result = sum(input);
  printf("sum(%d)==%d\n", input, result);
  return result;
}


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    0xeb3(%rip),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <sum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <sum@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%rdi
mov    $0xa,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c"sum(%d)==%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %3)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
uint64_t udiv64(uint64_t a, uint64_t b) {
  uint64_t r;
  if (b == 0) {
    fprintf(stderr, "Should not happen\n");
    exit(EXIT_FAILURE);
  }
  r = a / b;
  return r;
}


x86 assembly (clang, -O0):
<udiv64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <udiv64+0x3b>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udiv64>:
test   %esi,%esi
je     112a <udiv64+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @udiv64(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* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @udiv64(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = sdiv i32 %0, %1
ret i32 %10
}
/* Type definitions */
struct varmap {
  int dummy;
};

/* Variables and functions */
int O_CREAT;
int O_RDWR;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
struct varmap *varmap_init2(char *, int, int);
struct varmap *varmap_init(char *filename) {
  return varmap_init2(filename, O_RDWR | O_CREAT,
                      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
}


x86 assembly (clang, -O0):
<varmap_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    0x2e96(%rip),%rax
or     (%rax),%edx
mov    0x2e7d(%rip),%rax
or     (%rax),%edx
mov    0x2e6c(%rip),%rax
or     (%rax),%edx
call   1030 <varmap_init2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varmap_init>:
mov    0x2ec9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e8d(%rip),%rax
or     (%rax),%edx
mov    0x2e7c(%rip),%rax
or     (%rax),%edx
jmp    1030 <varmap_init2@plt>

LLVM IR (-O0):
%struct.varmap = type { i32 }
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define %struct.varmap* @varmap_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRUSR
%8 = load i32, i32* @S_IWUSR
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IRGRP
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IROTH
%13 = or i32 %11, %12
%14 = call %struct.varmap* @varmap_init2(i8* %3, i32 %6, i32 %13)
ret %struct.varmap* %14
}

LLVM IR (-O2):
%struct.varmap = type { i32 }
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define %struct.varmap* @varmap_init(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IRGRP
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IROTH
%11 = or i32 %9, %10
%12 = tail call %struct.varmap* @varmap_init2(i8* %0, i32 %4, i32 %11)
ret %struct.varmap* %12
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __down_write(struct rw_semaphore *);
void down_write(struct rw_semaphore *sem) {
  ;
  __down_write(sem);
  ;
}


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

x86 assembly (clang, -O2):
<down_write>:
jmp    1030 <__down_write@plt>

LLVM IR (-O0):
%struct.rw_semaphore = type { i32 }
define void @down_write(%struct.rw_semaphore* %0) {
%2 = alloca %struct.rw_semaphore*
store %struct.rw_semaphore* %0, %struct.rw_semaphore** %2
%3 = load %struct.rw_semaphore*, %struct.rw_semaphore** %2
%4 = call i32 @__down_write(%struct.rw_semaphore* %3)
ret void
}

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @down_write(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__down_write(%struct.rw_semaphore* %0)
ret void
}
int set_mode(int cur, int set) {
  cur = 0;
  return cur | set;
}


x86 assembly (clang, -O0):
<set_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_mode(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
void *__ioremap(unsigned long, unsigned long, int /*<<< orphan*/);
extern void *ioremap_fullcache(unsigned long physaddr, unsigned long size) {
  return __ioremap(physaddr, size, 0);
}


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

x86 assembly (clang, -O2):
<ioremap_fullcache>:
xor    %edx,%edx
jmp    1030 <__ioremap@plt>

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

LLVM IR (-O2):
define i8* @ioremap_fullcache(i64 %0, i64 %1) {
%3 = tail call i8* @__ioremap(i64 %0, i64 %1, i32 0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ lm_create_response(int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/ *);
void ntlm_create_response(const uint8_t ntlm[16], const uint8_t challenge[8],
                          uint8_t result[24]) {
  lm_create_response(ntlm, challenge, result);
}


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

x86 assembly (clang, -O2):
<ntlm_create_response>:
jmp    1030 <lm_create_response@plt>

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

LLVM IR (-O2):
define void @ntlm_create_response(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @lm_create_response(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int next_char(int /*<<< orphan*/ *);
void skip_line(FILE *f) {
  int c;
  while ((c = next_char(f)) && c != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<skip_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1159 <skip_line+0x49>
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1159 <skip_line+0x49>
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1169 <skip_line+0x59>
jmp    116e <skip_line+0x5e>
jmp    111c <skip_line+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <next_char@plt>
test   %eax,%eax
je     1136 <skip_line+0x26>
cmp    $0xa,%eax
je     1136 <skip_line+0x26>
cmp    (%r14),%eax
jne    1120 <skip_line+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_line(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %17, %1
%5 = load i32*, i32** %2
%6 = call i32 @next_char(i32* %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
br label %15
15: ; preds = %11, %8, %4
%16 = phi i1 [ false, %8 ], [ false, %4 ], [ %14, %11 ]
br i1 %16, label %17, label %18
17: ; preds = %15
br label %4
18: ; preds = %15
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_line(i32* %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 @next_char(i32* %0)
switch i32 %3, label %4 [
i32 10, label %7
i32 0, label %7
]
4: ; preds = %2
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %3, %5
br i1 %6, label %7, label %2
7: ; preds = %2, %2, %4
ret void
}
/* Variables and functions */
int search_in_file(char *, char *);
int octopus_check_convergence(char *output_file) {
  return search_in_file(output_file, "SCF converged in");
}


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

x86 assembly (clang, -O2):
<octopus_check_convergence>:
lea    0xee9(%rip),%rsi
jmp    1030 <search_in_file@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"SCF converged in\00"
define i32 @octopus_check_convergence(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @search_in_file(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"SCF converged in\00"
define i32 @octopus_check_convergence(i8* %0) {
%2 = tail call i32 @search_in_file(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ WStoSPI(int /*<<< orphan*/ *, int /*<<< orphan*/);
void WSSetLEDRed(uint8_t *pi8SPILEDs, uint16_t ui16LED, uint8_t ui8Color) {
  WStoSPI(pi8SPILEDs + (3 * 8 * ui16LED) + (8 * 1), ui8Color);
}


x86 assembly (clang, -O0):
<WSSetLEDRed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0x18,-0xc(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%esi
call   1030 <WStoSPI@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WSSetLEDRed>:
shl    $0x3,%esi
lea    (%rsi,%rsi,2),%eax
cltq
lea    (%rdi,%rax,4),%rdi
add    $0x20,%rdi
mov    %edx,%esi
jmp    1030 <WStoSPI@plt>

LLVM IR (-O0):
define void @WSSetLEDRed(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = mul nsw i32 24, %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = getelementptr inbounds i32, i32* %11, i64 8
%13 = load i32, i32* %6
%14 = call i32 @WStoSPI(i32* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @WSSetLEDRed(i32* %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 24
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 8
%8 = tail call i32 @WStoSPI(i32* %7, i32 %2)
ret void
}
int test_imm_EDint16_reg(short val) {
  return ((val) & (0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xed,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EDint16_reg(i16 signext %0) {
%2 = and i16 %0, 237
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
gid_t getegid(void) {
  if (getenv("LIBFAKE_EGID_ROOT") != NULL)
    return 0;
  else
    return 100;
}


x86 assembly (clang, -O0):
<getegid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     113a <getegid+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <getegid+0x31>
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getegid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x64,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"LIBFAKE_EGID_ROOT\00"
define i32 @getegid() {
%1 = alloca i32
%2 = call i32* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 100, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"LIBFAKE_EGID_ROOT\00"
define i32 @getegid() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i32 100, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ps();
int main() { ps(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ps@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ps()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ps()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int build_niquery(int /*<<< orphan*/ *, struct in6_addr *, int);
int send_probe(int, int /*<<< orphan*/ *, struct in6_addr *, int,
               int /*<<< orphan*/);
int query_addr(int sock, uint8_t *buf, struct in6_addr *addr) {
  int cc;
  cc = build_niquery(buf, addr, 3);
  return send_probe(sock, buf, addr, cc, 0);
}


x86 assembly (clang, -O0):
<query_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x3,%edx
call   1040 <build_niquery@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <send_probe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_addr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x3,%edx
call   1040 <build_niquery@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <send_probe@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @query_addr(i32 %0, i32* %1, %struct.in6_addr* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.in6_addr*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.in6_addr* %2, %struct.in6_addr** %6
%8 = load i32*, i32** %5
%9 = load %struct.in6_addr*, %struct.in6_addr** %6
%10 = call i32 @build_niquery(i32* %8, %struct.in6_addr* %9, i32 3)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
%13 = load %struct.in6_addr*, %struct.in6_addr** %6
%14 = load i32, i32* %7
%15 = call i32 @send_probe(i32 %11, i32* %12, %struct.in6_addr* %13, i32 %14, i32 0)
ret i32 %15
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @query_addr(i32 %0, i32* %1, %struct.in6_addr* %2) {
%4 = tail call i32 @build_niquery(i32* %1, %struct.in6_addr* %2, i32 3)
%5 = tail call i32 @send_probe(i32 %0, i32* %1, %struct.in6_addr* %2, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void AT91F_DataAbort() {
  puts("IDA");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<AT91F_DataAbort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1120 <AT91F_DataAbort+0x10>

x86 assembly (clang, -O2):
<AT91F_DataAbort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <AT91F_DataAbort+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"IDA\00"
define void @AT91F_DataAbort() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"IDA\00"
define void @AT91F_DataAbort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
int dasm_imm12(unsigned int n) {
  if ((n >> 12) == 0)
    return n;
  else if ((n & 0xff000fff) == 0)
    return (n >> 12) | 0x1000;
  else
    return -1;
}


x86 assembly (clang, -O0):
<dasm_imm12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
cmp    $0x0,%eax
jne    1121 <dasm_imm12+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <dasm_imm12+0x4c>
mov    -0x8(%rbp),%eax
and    $0xff000fff,%eax
cmp    $0x0,%eax
jne    1145 <dasm_imm12+0x45>
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
or     $0x1000,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <dasm_imm12+0x4c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dasm_imm12>:
mov    %edi,%ecx
shr    $0xc,%ecx
mov    %edi,%eax
and    $0xff000fff,%eax
neg    %eax
sbb    %eax,%eax
or     %ecx,%eax
or     $0x1000,%eax
cmp    $0x1000,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @dasm_imm12(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = lshr i32 %4, 12
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %18
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, -16773121
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %3
%15 = lshr i32 %14, 12
%16 = or i32 %15, 4096
store i32 %16, i32* %2
br label %18
17: ; preds = %9
store i32 -1, i32* %2
br label %18
18: ; preds = %17, %13, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @dasm_imm12(i32 %0) {
%2 = lshr i32 %0, 12
%3 = icmp ult i32 %0, 4096
%4 = and i32 %0, -16773121
%5 = icmp eq i32 %4, 0
%6 = or i32 %2, 4096
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printEnvironments(char *envp[]) {
  printf("\n\n\n\n\n environments are \n");
  printf("shashi::%s\n", envp[0]);
}


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

x86 assembly (clang, -O2):
<printEnvironments>:
push   %rbx
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0A\0A\0A\0A environments are \0A\00"
@.str.1 = [12 x i8] c"shashi::%s\0A\00"
define void @printEnvironments(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"shashi::%s\0A\00"
@str = [24 x i8] c"\0A\0A\0A\0A\0A environments are \00"
define void @printEnvironments(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
void Act_PutO(void) { ArgItem(); }


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

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

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

LLVM IR (-O2):
define void @Act_PutO() {
%1 = tail call i32 (...) @ArgItem()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NETX_PFIFO_FILL_LEVEL(int);
int readl(int /*<<< orphan*/);
int pfifo_fill_level(int no) { return readl(NETX_PFIFO_FILL_LEVEL(no)); }


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

x86 assembly (clang, -O2):
<pfifo_fill_level>:
push   %rax
call   1040 <NETX_PFIFO_FILL_LEVEL@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <readl@plt>

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

LLVM IR (-O2):
define i32 @pfifo_fill_level(i32 %0) {
%2 = tail call i32 @NETX_PFIFO_FILL_LEVEL(i32 %0)
%3 = tail call i32 @readl(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PIC_sendEOI(int);
void atapio_irq_handler() { PIC_sendEOI(0x70 + 0x0E); }


x86 assembly (clang, -O0):
<atapio_irq_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e,%edi
call   1030 <PIC_sendEOI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atapio_irq_handler>:
mov    $0x7e,%edi
jmp    1030 <PIC_sendEOI@plt>

LLVM IR (-O0):
define void @atapio_irq_handler() {
%1 = call i32 @PIC_sendEOI(i32 126)
ret void
}

LLVM IR (-O2):
define void @atapio_irq_handler() {
%1 = tail call i32 @PIC_sendEOI(i32 126)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int get_seq(int seq[]) {
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%d", &seq[i]);
  return n;
}


x86 assembly (clang, -O0):
<get_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <get_seq+0x58>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <get_seq+0x23>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seq>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    115d <get_seq+0x4d>
xor    %ebx,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1140 <get_seq+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_seq(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %1
%16 = phi i32 [ %5, %1 ], [ %12, %7 ]
ret i32 %16
}
int calc_v0_volt(struct dim_data *data, int color) { return 4301; }


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

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

LLVM IR (-O0):
%struct.dim_data = type opaque
define i32 @calc_v0_volt(%struct.dim_data* %0, i32 %1) {
%3 = alloca %struct.dim_data*
%4 = alloca i32
store %struct.dim_data* %0, %struct.dim_data** %3
store i32 %1, i32* %4
ret i32 4301
}

LLVM IR (-O2):
%struct.dim_data = type opaque
define i32 @calc_v0_volt(%struct.dim_data* nocapture readnone %0, i32 %1) {
ret i32 4301
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int ftype(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Usage...\n");
    exit(1);
  }
  printf("%c\n", ftype(argv[1]));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <ftype@plt>
mov    %eax,%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1165 <main+0x25>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    0x8(%rsi),%rdi
call   1050 <ftype@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"Usage...\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @ftype(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"Usage...\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @ftype(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long unsignedlong_ignoring_longdouble(unsigned long x, long double y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlong_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_longdouble(i64 %0, x86_fp80 %1) {
%3 = alloca i64
%4 = alloca x86_fp80
store i64 %0, i64* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
int intcmp(const void *c1, const void *c2) {
  const int *i1 = c1;
  const int *i2 = c2;
  return *i1 - *i2;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
unsigned int bm_hsl(double, double, double);
unsigned int bm_hsla(double H, double S, double L, double A) {
  unsigned int a = (unsigned int)(A * 255 / 100);
  unsigned int c = bm_hsl(H, S, L);
  return (c & 0x00FFFFFF) | ((a & 0xFF) << 24);
}


x86 assembly (clang, -O0):
<bm_hsla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <bm_hsl@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
and    $0xffffff,%eax
mov    -0x24(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_hsla>:
push   %rbx
mulsd  0xee7(%rip),%xmm3
divsd  0xee7(%rip),%xmm3
cvttsd2si %xmm3,%rbx
call   1030 <bm_hsl@plt>
and    $0xffffff,%eax
shl    $0x18,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bm_hsla(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %8
%12 = fmul double %11, 2.550000e+02
%13 = fdiv double %12, 1.000000e+02
%14 = fptoui double %13 to i32
store i32 %14, i32* %9
%15 = load double, double* %5
%16 = load double, double* %6
%17 = load double, double* %7
%18 = call i32 @bm_hsl(double %15, double %16, double %17)
store i32 %18, i32* %10
%19 = load i32, i32* %10
%20 = and i32 %19, 16777215
%21 = load i32, i32* %9
%22 = and i32 %21, 255
%23 = shl i32 %22, 24
%24 = or i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @bm_hsla(double %0, double %1, double %2, double %3) {
%5 = fmul double %3, 2.550000e+02
%6 = fdiv double %5, 1.000000e+02
%7 = fptoui double %6 to i32
%8 = tail call i32 @bm_hsl(double %0, double %1, double %2)
%9 = and i32 %8, 16777215
%10 = shl i32 %7, 24
%11 = or i32 %9, %10
ret i32 %11
}
/* Variables and functions */
char *julian_to_yyyy_mm_dd(double);
char *julian_display_yyyymmdd(double current) {
  return julian_to_yyyy_mm_dd(current);
}


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

x86 assembly (clang, -O2):
<julian_display_yyyymmdd>:
jmp    1030 <julian_to_yyyy_mm_dd@plt>

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

LLVM IR (-O2):
define i8* @julian_display_yyyymmdd(double %0) {
%2 = tail call i8* @julian_to_yyyy_mm_dd(double %0)
ret i8* %2
}
void __attribute__((no)) HEX00_typetraitsDatInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_typetraitsDatInit() {
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display(struct node *);
int /*<<< orphan*/ insert(struct node **, int);
int main(void) {
  struct node *head = NULL;
  insert(&head, 5);
  insert(&head, 10);
  insert(&head, 15);
  insert(&head, 20);
  display(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0xf,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1040 <insert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <insert@plt>
mov    0x8(%rsp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = call i32 @insert(%struct.node** %2, i32 5)
%4 = call i32 @insert(%struct.node** %2, i32 10)
%5 = call i32 @insert(%struct.node** %2, i32 15)
%6 = call i32 @insert(%struct.node** %2, i32 20)
%7 = load %struct.node*, %struct.node** %2
%8 = call i32 @display(%struct.node* %7)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = call i32 @insert(%struct.node** %1, i32 5)
%4 = call i32 @insert(%struct.node** %1, i32 10)
%5 = call i32 @insert(%struct.node** %1, i32 15)
%6 = call i32 @insert(%struct.node** %1, i32 20)
%7 = load %struct.node*, %struct.node** %1
%8 = call i32 @display(%struct.node* %7)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
int get_XConfigureRequestEvent_width(void *_p) {
  return (int)((XConfigureRequestEvent *)_p)->width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureRequestEvent_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureRequestEvent_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *json_set(const char *s, const char *k, const char *v) { return NULL; }


x86 assembly (clang, -O0):
<json_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @json_set(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @json_set(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* null
}
void foo455(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo455(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int do_test() {
  {
    if (strcmp("hello", "h") == 0)
      return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1141 <do_test+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <do_test+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [2 x i8] c"h\00"
define i32 @do_test() {
%1 = alloca i32
%2 = call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [2 x i8] c"h\00"
define i32 @do_test() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct comp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CloseBreezeSimulation(int);
int /*<<< orphan*/ printf(char *);
void BrzBinaryFunc_ackup(struct comp *comp, int port) {
  printf("BrzBinaryFunc_ackup: This code should never be reached\n");
  CloseBreezeSimulation(2);
}


x86 assembly (clang, -O0):
<BrzBinaryFunc_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <CloseBreezeSimulation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFunc_ackup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <CloseBreezeSimulation@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
@.str = [56 x i8] c"BrzBinaryFunc_ackup: This code should never be reached\0A\00"
define void @BrzBinaryFunc_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @CloseBreezeSimulation(i32 2)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
@str = [55 x i8] c"BrzBinaryFunc_ackup: This code should never be reached\00"
define void @BrzBinaryFunc_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @CloseBreezeSimulation(i32 2)
ret void
}
void glRotatex(void) { return; }


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

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

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

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