xunge/DecIR huggingface dataset:
/* Type definitions */
struct istruct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inter_save(struct istruct *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void inter_save_a(struct istruct *in, char *path, char *name) {
  char wholename[200];
  sprintf(wholename, "%s/%s", path, name);
  inter_save(in, wholename);
}


x86 assembly (clang, -O0):
<inter_save_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <inter_save@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_save_a>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec6(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <inter_save@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.istruct = type { i32 }
@.str = [6 x i8] c"%s/%s\00"
define void @inter_save_a(%struct.istruct* %0, i8* %1, i8* %2) {
%4 = alloca %struct.istruct*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [200 x i8]
store %struct.istruct* %0, %struct.istruct** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load %struct.istruct*, %struct.istruct** %4
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%14 = call i32 @inter_save(%struct.istruct* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.istruct = type { i32 }
@.str = [6 x i8] c"%s/%s\00"
define void @inter_save_a(%struct.istruct* %0, i8* %1, i8* %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%7 = call i32 @inter_save(%struct.istruct* %0, i8* %5)
ret void
}
void on_conn_data_sent(int id) {}


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

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

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

LLVM IR (-O2):
define void @on_conn_data_sent(i32 %0) {
ret void
}
void enter_idle(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct ThreadParams *);
void cleanup(void *params) {
  struct ThreadParams *p = (struct ThreadParams *)params;
  free(p);
}


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

x86 assembly (clang, -O2):
<cleanup>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ThreadParams = type { i32 }
define void @cleanup(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.ThreadParams*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.ThreadParams*
store %struct.ThreadParams* %5, %struct.ThreadParams** %3
%6 = load %struct.ThreadParams*, %struct.ThreadParams** %3
%7 = call i32 @free(%struct.ThreadParams* %6)
ret void
}

LLVM IR (-O2):
%struct.ThreadParams = type { i32 }
define void @cleanup(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.ThreadParams*
%3 = tail call i32 @free(%struct.ThreadParams* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strpbrk(char const *, char *);
int lo_string_contains_pattern(const char *str) {
  if (!str)
    return 0;
  return strpbrk(str, " #*,?[]{}") != NULL;
}


x86 assembly (clang, -O0):
<lo_string_contains_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <lo_string_contains_pattern+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1152 <lo_string_contains_pattern+0x42>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strpbrk@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lo_string_contains_pattern>:
test   %rdi,%rdi
je     1132 <lo_string_contains_pattern+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c" #*,?[]{}\00"
define i32 @lo_string_contains_pattern(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @strpbrk(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void DESDMAEnable(uint32_t ui32Base, uint32_t ui32Flags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) |= ui32Flags;
}


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

x86 assembly (clang, -O2):
<DESDMAEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x34(%rcx)
ret

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

LLVM IR (-O2):
define void @DESDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 52
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
char *allocate_mountpoint(char const *);
int /*<<< orphan*/ check_path_length(char const *);
int /*<<< orphan*/ mount_proc(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *setup_proc(const char *path) {
  check_path_length(path);
  char *mountpoint = allocate_mountpoint(path);
  strcpy(mountpoint, path);
  strcat(mountpoint, "/proc");
  mount_proc(mountpoint);
  return mountpoint;
}


x86 assembly (clang, -O0):
<setup_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <check_path_length@plt>
mov    -0x8(%rbp),%rdi
call   1060 <allocate_mountpoint@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1050 <mount_proc@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_proc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <check_path_length@plt>
mov    %r14,%rdi
call   1060 <allocate_mountpoint@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rdi
call   1050 <mount_proc@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/proc\00"
define i8* @setup_proc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @check_path_length(i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @allocate_mountpoint(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %3
%14 = call i32 @mount_proc(i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"/proc\00"
define i8* @setup_proc(i8* %0) {
%2 = tail call i32 @check_path_length(i8* %0)
%3 = tail call i8* @allocate_mountpoint(i8* %0)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
%5 = tail call i32 @strcat(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @mount_proc(i8* %3)
ret i8* %3
}
void exynos_int_notify_power_status(const char *pd_name, unsigned int turn_on) {
}


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

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

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

LLVM IR (-O2):
define void @exynos_int_notify_power_status(i8* nocapture %0, i32 %1) {
ret void
}
void wifi_evt_endpoint_error(const struct wifi_msg_endpoint_error_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_endpoint_error_evt_t = type opaque
define void @wifi_evt_endpoint_error(%struct.wifi_msg_endpoint_error_evt_t* nocapture %0) {
ret void
}
int do_439() { return 439; }


x86 assembly (clang, -O0):
<do_439>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_439() {
ret i32 439
}

LLVM IR (-O2):
define i32 @do_439() {
ret i32 439
}
equal(as1, as2) {
  register char *s1, *s2;
  s1 = as1;
  s2 = as2;
  while (*s1++ == *s2)
    if (*s2++ == 0)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1167 <equal+0x67>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1162 <equal+0x62>
movl   $0x1,-0x4(%rbp)
jmp    116e <equal+0x6e>
jmp    111a <equal+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
movslq %edi,%rdi
movslq %esi,%rdx
xor    %eax,%eax
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rsi,1),%ecx
cmp    (%rdx,%rsi,1),%cl
jne    1126 <equal+0x26>
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <equal+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @equal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %7
br label %14
14: ; preds = %30, %2
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %6
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %7
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %18, %21
br i1 %22, label %23, label %31
23: ; preds = %14
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %7
%26 = load i8, i8* %24
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 1, i32* %3
br label %32
30: ; preds = %23
br label %14
31: ; preds = %14
store i32 0, i32* %3
br label %32
32: ; preds = %31, %29
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @equal(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = inttoptr i64 %5 to i8*
br label %7
7: ; preds = %13, %2
%8 = phi i8* [ %4, %2 ], [ %14, %13 ]
%9 = phi i8* [ %6, %2 ], [ %15, %13 ]
%10 = load i8, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %9, i64 1
%16 = icmp eq i8 %10, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %13
%18 = phi i32 [ 1, %13 ], [ 0, %7 ]
ret i32 %18
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int);
void status() { printf("[%d]: ppid = %d\n", getpid(), getppid()); }


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"[%d]: ppid = %d\0A\00"
define void @status() {
%1 = call i32 (...) @getpid()
%2 = call i32 (...) @getppid()
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"[%d]: ppid = %d\0A\00"
define void @status() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getppid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
void check_logfs_disk_inode(void) { ; }


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

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

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

LLVM IR (-O2):
define void @check_logfs_disk_inode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *cmd) {
  printf("xmUtil v%s by Markus Wiik <vassius@gmail.com>\n", "0.1");
  printf("Usage: \n");
  printf("\t%s <device> <filename>\n\n", cmd);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"xmUtil v%s by Markus Wiik <vassius@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [9 x i8] c"Usage: \0A\00"
@.str.3 = [26 x i8] c"\09%s <device> <filename>\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"xmUtil v%s by Markus Wiik <vassius@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.3 = [26 x i8] c"\09%s <device> <filename>\0A\0A\00"
@str = [8 x i8] c"Usage: \00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}
long double floorld(long double value) {
  int temporal = (int)value;
  return value < temporal ? temporal - 1 : temporal;
}


x86 assembly (clang, -O0):
<floorld>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpl -0x1c(%rbp)
fldcw  -0x22(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
fildl  -0x18(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    1155 <floorld+0x55>
jmp    1147 <floorld+0x47>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    115b <floorld+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
fildl  -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorld>:
fldt   0x8(%rsp)
fnstcw -0x10(%rsp)
movzwl -0x10(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xe(%rsp)
fldcw  -0xe(%rsp)
fistl  -0xc(%rsp)
fldcw  -0x10(%rsp)
mov    -0xc(%rsp),%eax
mov    %eax,-0x8(%rsp)
fildl  -0x8(%rsp)
xor    %ecx,%ecx
fucomip %st(1),%st
fstp   %st(0)
seta   %cl
sub    %ecx,%eax
mov    %eax,-0x4(%rsp)
fildl  -0x4(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @floorld(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fptosi x86_fp80 %4 to i32
store i32 %5, i32* %3
%6 = load x86_fp80, x86_fp80* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to x86_fp80
%9 = fcmp olt x86_fp80 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
br label %15
13: ; preds = %1
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %12, %10 ], [ %14, %13 ]
%17 = sitofp i32 %16 to x86_fp80
ret x86_fp80 %17
}

LLVM IR (-O2):
define x86_fp80 @floorld(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i32
%3 = sitofp i32 %2 to x86_fp80
%4 = fcmp ogt x86_fp80 %3, %0
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %2
%7 = sitofp i32 %6 to x86_fp80
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_macro_0(void) { puts("Hello, "); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello, \00"
define void @print_macro_0() {
%1 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hello, \00"
define void @print_macro_0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int cvt_to_wave_test() { return sizeof(short) - 2; }


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

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

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

LLVM IR (-O2):
define i32 @cvt_to_wave_test() {
ret i32 0
}
int Carre1(int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @Carre1(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_standard_polysys_witset(int dim) {
  int *b;
  double *c;
  int fail = _ada_use_c2phc4c(851, &dim, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @copy_standard_polysys_witset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 851, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ echo(int);
main() { echo(-2147483649); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7fffffff,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @echo(i32 2147483647)
ret i32 0
}
int tl880_driver(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @tl880_driver() {
ret i32 1
}

LLVM IR (-O2):
define i32 @tl880_driver() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nUsage: gaspi_logger [OPTIONS]\n\n");
  printf("Available options:\n");
  printf("  -p <port number> Port to use ([1024..65535]).\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
lea    0xef3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0AUsage: gaspi_logger [OPTIONS]\0A\0A\00"
@.str.1 = [20 x i8] c"Available options:\0A\00"
@.str.2 = [49 x i8] c" -p <port number> Port to use ([1024..65535]).\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"\0AUsage: gaspi_logger [OPTIONS]\0A\00"
@str.4 = [19 x i8] c"Available options:\00"
@str.5 = [48 x i8] c" -p <port number> Port to use ([1024..65535]).\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int SubEvt_hdrLen();
size_t SubEvt_hdrSize(void) { return SubEvt_hdrLen() * sizeof(uint32_t); }


x86 assembly (clang, -O0):
<SubEvt_hdrSize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SubEvt_hdrLen@plt>
cltq
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubEvt_hdrSize>:
push   %rax
xor    %eax,%eax
call   1030 <SubEvt_hdrLen@plt>
cltq
shl    $0x2,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @SubEvt_hdrSize() {
%1 = call i32 (...) @SubEvt_hdrLen()
%2 = sext i32 %1 to i64
%3 = mul i64 %2, 4
ret i64 %3
}

LLVM IR (-O2):
define i64 @SubEvt_hdrSize() {
%1 = tail call i32 (...) @SubEvt_hdrLen()
%2 = sext i32 %1 to i64
%3 = shl nsw i64 %2, 2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ f3();
void bar(int n) {
  if (n)
    f3();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <bar+0x1c>
mov    $0x0,%al
call   1030 <f3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
je     111b <bar+0xb>
xor    %eax,%eax
jmp    1030 <f3@plt>
ret

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @f3()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @f3()
br label %5
5: ; preds = %3, %1
ret void
}
void ADC_DelSig_ISR1(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_ISR1() {
ret void
}
/* Variables and functions */
unsigned long long PRCMHIBRegRead(int);
int /*<<< orphan*/ PRCMHIBRegWrite(int, int);
unsigned long long PRCMSlowClkCtrGet() {
  unsigned long long ullRTCVal;
  PRCMHIBRegWrite(0x4402F800 + 0x0000000C, 0x1);
  ullRTCVal = PRCMHIBRegRead(0x4402F800 + 0x00000014);
  ullRTCVal = ullRTCVal << 32;
  ullRTCVal |= PRCMHIBRegRead(0x4402F800 + 0x00000010);
  return ullRTCVal;
}


x86 assembly (clang, -O0):
<PRCMSlowClkCtrGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4402f80c,%edi
mov    $0x1,%esi
call   1030 <PRCMHIBRegWrite@plt>
mov    $0x4402f814,%edi
call   1040 <PRCMHIBRegRead@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    $0x4402f810,%edi
call   1040 <PRCMHIBRegRead@plt>
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMSlowClkCtrGet>:
push   %rbx
mov    $0x4402f80c,%edi
mov    $0x1,%esi
call   1030 <PRCMHIBRegWrite@plt>
mov    $0x4402f814,%edi
call   1040 <PRCMHIBRegRead@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
mov    $0x4402f810,%edi
call   1040 <PRCMHIBRegRead@plt>
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @PRCMSlowClkCtrGet() {
%1 = alloca i64
%2 = call i32 @PRCMHIBRegWrite(i32 1141045260, i32 1)
%3 = call i64 @PRCMHIBRegRead(i32 1141045268)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = shl i64 %4, 32
store i64 %5, i64* %1
%6 = call i64 @PRCMHIBRegRead(i32 1141045264)
%7 = load i64, i64* %1
%8 = or i64 %7, %6
store i64 %8, i64* %1
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
define i64 @PRCMSlowClkCtrGet() {
%1 = tail call i32 @PRCMHIBRegWrite(i32 1141045260, i32 1)
%2 = tail call i64 @PRCMHIBRegRead(i32 1141045268)
%3 = shl i64 %2, 32
%4 = tail call i64 @PRCMHIBRegRead(i32 1141045264)
%5 = or i64 %3, %4
ret i64 %5
}
int base_len(unsigned long long n, int radix) {
  int len = 0;
  while (n) {
    n /= radix;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<base_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <base_len+0x3c>
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <base_len+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_len>:
test   %rdi,%rdi
je     113a <base_len+0x3a>
movslq %esi,%r8
xor    %ecx,%ecx
jmp    1123 <base_len+0x23>
nopl   0x0(%rax)
mov    %rdi,%rax
xor    %edx,%edx
div    %r8
add    $0x1,%ecx
cmp    %r8,%rdi
mov    %rax,%rdi
jb     1137 <base_len+0x37>
mov    %rdi,%rax
or     %r8,%rax
shr    $0x20,%rax
jne    1110 <base_len+0x10>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1118 <base_len+0x18>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @base_len(i64 %0, i32 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %10, %6 ]
%8 = phi i64 [ %0, %4 ], [ %9, %6 ]
%9 = udiv i64 %8, %5
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i64 %8, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %13
}
int droite(int _index) { return (_index < 0 ? -1 : (2 * _index + 2)); }


x86 assembly (clang, -O0):
<droite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <droite+0x1e>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <droite+0x2a>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<droite>:
lea    (%rdi,%rdi,1),%ecx
add    $0x2,%ecx
test   %edi,%edi
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @droite(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ serial_getchar(int);
int serial_recvbuffer(int channel, unsigned char *data, int len) {
  while (len--) {
    *data++ = serial_getchar(channel);
  }
  return 1;
}


x86 assembly (clang, -O0):
<serial_recvbuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1156 <serial_recvbuffer+0x46>
mov    -0x4(%rbp),%edi
call   1030 <serial_getchar@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1122 <serial_recvbuffer+0x12>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_recvbuffer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1144 <serial_recvbuffer+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
mov    %edx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%edi
call   1030 <serial_getchar@plt>
mov    %al,(%r14,%rbp,1)
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1130 <serial_recvbuffer+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @serial_recvbuffer(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %11, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = tail call i32 @serial_getchar(i32 %0)
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %7
%12 = icmp eq i32 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret i32 1
}
void test5() {}


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

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

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

LLVM IR (-O2):
define void @test5() {
ret void
}
int test_imm_F4uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F4uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 244
%7 = icmp ne i64 %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_F4uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15990784
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ trio_copy_max(char *, size_t, char const *);
char *trio_create(size_t);
__attribute__((visibility("hidden"))) char *
internal_duplicate_max(const char *source, size_t size) {
  char *target;
  assert(source);
  size++;
  target = trio_create(size);
  if (target) {
    trio_copy_max(target, size, source);
  }
  return target;
}


x86 assembly (clang, -O0):
<internal_duplicate_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <trio_create@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117e <internal_duplicate_max+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <trio_copy_max@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_duplicate_max>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <assert@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <trio_create@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <internal_duplicate_max+0x32>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <trio_copy_max@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define hidden i8* @internal_duplicate_max(i8* %0, i64 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = add i64 %1, 1
%5 = tail call i8* @trio_create(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @trio_copy_max(i8* %5, i64 %4, i8* %0)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ dlink_delete_first();
int dlink_get_first();
int pop() {
  int ret = dlink_get_first();
  dlink_delete_first();
  return ret;
}


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

x86 assembly (clang, -O2):
<pop>:
push   %rbx
xor    %eax,%eax
call   1040 <dlink_get_first@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <dlink_delete_first@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pop() {
%1 = alloca i32
%2 = call i32 (...) @dlink_get_first()
store i32 %2, i32* %1
%3 = call i32 (...) @dlink_delete_first()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @pop() {
%1 = tail call i32 (...) @dlink_get_first()
%2 = tail call i32 (...) @dlink_delete_first()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int touch_all(int idx) {
  int bit;
  static int IsAll;
  bit = 1 << idx;
  printf("bit=%d\n", bit);
  IsAll |= bit;
  printf("IsAll=%02X\n", IsAll);
  if (IsAll == 0xFF)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<touch_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
or     0x2eec(%rip),%eax
mov    %eax,0x2ee6(%rip)
mov    0x2ee0(%rip),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xff,0x2eca(%rip)
jne    1174 <touch_all+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117b <touch_all+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch_all>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
mov    %ebx,%ecx
shl    %cl,%esi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2efe(%rip),%esi
bts    %ebx,%esi
mov    %esi,0x2ef5(%rip)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0xff,0x2edd(%rip)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@touch_all.IsAll = internal global i32 0
@.str = [8 x i8] c"bit=%d\0A\00"
@.str.1 = [12 x i8] c"IsAll=%02X\0A\00"
define i32 @touch_all(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = shl i32 1, %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* @touch_all.IsAll
%11 = or i32 %10, %9
store i32 %11, i32* @touch_all.IsAll
%12 = load i32, i32* @touch_all.IsAll
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @touch_all.IsAll
%15 = icmp eq i32 %14, 255
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 1, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@touch_all.IsAll = internal unnamed_addr global i32 0
@.str = [8 x i8] c"bit=%d\0A\00"
@.str.1 = [12 x i8] c"IsAll=%02X\0A\00"
define i32 @touch_all(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @touch_all.IsAll
%5 = or i32 %4, %2
store i32 %5, i32* @touch_all.IsAll
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @touch_all.IsAll
%8 = icmp eq i32 %7, 255
%9 = zext i1 %8 to i32
ret i32 %9
}
void destruct_tokenlist(int argnum, char **args) {
  int i = 0;
  for (; i < argnum; i++) {
    free(args[i]);
  }
  free(args);
}


x86 assembly (clang, -O0):
<destruct_tokenlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <destruct_tokenlist+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <destruct_tokenlist+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destruct_tokenlist>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <destruct_tokenlist+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destruct_tokenlist+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destruct_tokenlist(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
char *system_get_architerture() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @system_get_architerture() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @system_get_architerture() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "rm [-rR] <target>\n");
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"rm [-rR] <target>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"rm [-rR] <target>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int sort(const void *x, const void *y) {
  if (*(const float *)y < *(const float *)x)
    return -1;
  return *(const float *)y > *(const float *)x;
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1131 <sort+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <sort+0x4b>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp olt float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = bitcast i8* %15 to float*
%17 = load float, float* %16
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp ogt float %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to float*
%4 = load float, float* %3
%5 = bitcast i8* %0 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}