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

/* Variables and functions */
int syscall(int, int, struct stat *);
int fstat(int fd, struct stat *buf) { return syscall(197, fd, buf); }


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0xc5,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xc5,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 @syscall(i32 197, i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ unix_error(char *);
void Close(int fd) {
  int n;
  if ((n = close(fd)) < 0)
    unix_error("Close error");
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <Close+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
test   %eax,%eax
js     112c <Close+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Close error\00"
define void @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct wl_seat {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void wl_seat_destroy(struct wl_seat *wl_seat) {
  wl_proxy_destroy((struct wl_proxy *)wl_seat);
}


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

x86 assembly (clang, -O2):
<wl_seat_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_seat_destroy(%struct.wl_seat* %0) {
%2 = alloca %struct.wl_seat*
store %struct.wl_seat* %0, %struct.wl_seat** %2
%3 = load %struct.wl_seat*, %struct.wl_seat** %2
%4 = bitcast %struct.wl_seat* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %4)
ret void
}

LLVM IR (-O2):
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_seat_destroy(%struct.wl_seat* %0) {
%2 = bitcast %struct.wl_seat* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOGICALLY_FREEING_PAGES(size_t);
int /*<<< orphan*/ free_actual_pages(void *, size_t, int /*<<< orphan*/);
void free_pages(void *p, size_t len) {
  LOGICALLY_FREEING_PAGES(len);
  free_actual_pages(p, len, 0);
}


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

x86 assembly (clang, -O2):
<free_pages>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <LOGICALLY_FREEING_PAGES@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free_actual_pages@plt>

LLVM IR (-O0):
define void @free_pages(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @LOGICALLY_FREEING_PAGES(i64 %5)
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i32 @free_actual_pages(i8* %7, i64 %8, i32 0)
ret void
}

LLVM IR (-O2):
define void @free_pages(i8* %0, i64 %1) {
%3 = tail call i32 @LOGICALLY_FREEING_PAGES(i64 %1)
%4 = tail call i32 @free_actual_pages(i8* %0, i64 %1, i32 0)
ret void
}
void RTAvlrooGCPtrDoWithAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrDoWithAll() {
ret void
}
/* Variables and functions */
int __get_array_size(char const *);
int __infer_nondet_int();
size_t strspn(const char *s1, const char *s2) {
  int size_s1;
  int size_s2;
  int res;
  res = __infer_nondet_int();
  size_s1 = __get_array_size(s1);
  size_s2 = __get_array_size(s2);
  if (res < 0 || res > size_s1)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<strspn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1168 <strspn+0x48>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1172 <strspn+0x52>
jmp    116d <strspn+0x4d>
jmp    116d <strspn+0x4d>
movslq -0x1c(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strspn>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <__get_array_size@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <__get_array_size@plt>
test   %ebx,%ebx
js     1160 <strspn+0x40>
cmp    %ebp,%ebx
jg     1160 <strspn+0x40>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1160 <strspn+0x40>

LLVM IR (-O0):
define i64 @strspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = call i32 (...) @__infer_nondet_int()
store i32 %8, i32* %7
%9 = load i8*, i8** %3
%10 = call i32 @__get_array_size(i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = call i32 @__get_array_size(i8* %11)
store i32 %12, i32* %6
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %2
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15, %2
br label %20
20: ; preds = %19, %20
br label %20
21: ; preds = %15
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @strspn(i8* %0, i8* %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = tail call i32 @__get_array_size(i8* %0)
%5 = tail call i32 @__get_array_size(i8* %1)
%6 = icmp slt i32 %3, 0
%7 = icmp sgt i32 %3, %4
%8 = select i1 %6, i1 true, i1 %7
br i1 %8, label %9, label %10
9: ; preds = %2, %9
br label %9
10: ; preds = %2
%11 = zext i32 %3 to i64
ret i64 %11
}
int test_imm_EDuint32_reg(unsigned int val) {
  return ((val) & (0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%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_EDuint32_reg>:
test   $0xed,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EDuint32_reg(i32 %0) {
%2 = and i32 %0, 237
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int toupper_fast(int c) {
  if ((c >= 'a') && (c <= 'z'))
    c = c - ('a' - 'A');
  return c;
}


x86 assembly (clang, -O0):
<toupper_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <toupper_fast+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <toupper_fast+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper_fast>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper_fast(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper_fast(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
char *driver_get_window_class(void *handle) {
  static char class[256];
  return "UNIMPLEMENTED";
}


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

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

LLVM IR (-O0):
@driver_get_window_class.class = internal global [256 x i8] zeroinitializer
@.str = [14 x i8] c"UNIMPLEMENTED\00"
define i8* @driver_get_window_class(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"UNIMPLEMENTED\00"
define i8* @driver_get_window_class(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  execl("/usr/bin/killall", "/usr/bin/killall", "-USR1", "/usr/sbin/apache2",
        (char *)NULL);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"/usr/bin/killall\00"
@.str.1 = [6 x i8] c"-USR1\00"
@.str.2 = [18 x i8] c"/usr/sbin/apache2\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @execl(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"/usr/bin/killall\00"
@.str.1 = [6 x i8] c"-USR1\00"
@.str.2 = [18 x i8] c"/usr/sbin/apache2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execl(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* null)
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_after(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
void list_move(struct list_head *head, struct list_head *list) {
  list_del(list);
  list_add_after(head, list);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <list_del@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add_after@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %4
%6 = call i32 @list_del(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add_after(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_del(%struct.list_head* %1)
%4 = tail call i32 @list_add_after(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int mkdir(char const *, int const);
int stress_mkdir(const int dir_fd, const char *path, const int mode) {
  int ret;
  ret = mkdir(path, mode);
  (void)dir_fd;
  return ret;
}


x86 assembly (clang, -O0):
<stress_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <mkdir@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_mkdir>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @stress_mkdir(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @mkdir(i8* %1, i32 %2)
ret i32 %4
}
void handle_40(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_40(i32 %0) {
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *, int /*<<< orphan*/);
extern void swedish_UTF_8_close_env(struct SN_env *z) { SN_close_env(z, 0); }


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

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

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

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @swedish_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0, i32 0)
ret void
}
int setWindowSize(int sfd, int dfd) { return 0; }


x86 assembly (clang, -O0):
<setWindowSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setWindowSize(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
mode_t umask(mode_t newmask) {
  static mode_t the_mask = 022;
  mode_t old_mask = the_mask;
  the_mask = newmask;
  return old_mask;
}


x86 assembly (clang, -O0):
<umask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f13(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f07(%rip)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umask>:
mov    0x2f1a(%rip),%eax
mov    %edi,0x2f14(%rip)
ret

LLVM IR (-O0):
@umask.the_mask = internal global i32 18
define i32 @umask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @umask.the_mask
store i32 %4, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* @umask.the_mask
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@umask.the_mask = internal unnamed_addr global i32 18
define i32 @umask(i32 %0) {
%2 = load i32, i32* @umask.the_mask
store i32 %0, i32* @umask.the_mask
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ slick_fatal(char *);
void deadlock(void) { slick_fatal("deadlocked, no processes left"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"deadlocked, no processes left\00"
define void @deadlock() {
%1 = call i32 @slick_fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"deadlocked, no processes left\00"
define void @deadlock() {
%1 = tail call i32 @slick_fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct winsize {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCSWINSZ;
int errno_non_zero();
scalar_t__ ioctl(int, int /*<<< orphan*/, struct winsize const *);
int set_window_size(int fd, const struct winsize *size) {
  if (ioctl(fd, TIOCSWINSZ, size) < 0) {
    return errno_non_zero();
  }
  return 0;
}


x86 assembly (clang, -O0):
<set_window_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    115d <set_window_size+0x3d>
mov    $0x0,%al
call   1040 <errno_non_zero@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <set_window_size+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_window_size>:
push   %rax
mov    %rsi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
test   %rax,%rax
js     113b <set_window_size+0x1b>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <errno_non_zero@plt>

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCSWINSZ = global i32 0
define i32 @set_window_size(i32 %0, %struct.winsize* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.winsize*
store i32 %0, i32* %4
store %struct.winsize* %1, %struct.winsize** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @TIOCSWINSZ
%8 = load %struct.winsize*, %struct.winsize** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, %struct.winsize* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @errno_non_zero()
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCSWINSZ = global i32 0
define i32 @set_window_size(i32 %0, %struct.winsize* %1) {
%3 = load i32, i32* @TIOCSWINSZ
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.winsize* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @errno_non_zero()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 0, %2 ]
ret i32 %9
}
void spi_select(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sok_freegame(struct sokgame *);
void sok_freefile(struct sokgame **gamelist, int gamescount) {
  int x;
  for (x = 0; x < gamescount; x++) {
    sok_freegame(gamelist[x]);
  }
}


x86 assembly (clang, -O0):
<sok_freefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <sok_freefile+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <sok_freegame@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <sok_freefile+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.sokgame = type { i32 }
define void @sok_freefile(%struct.sokgame** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds %struct.sokgame*, %struct.sokgame** %0, i64 %7
%9 = load %struct.sokgame*, %struct.sokgame** %8
%10 = tail call i32 @sok_freegame(%struct.sokgame* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void foo118() {}


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

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

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

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

/* Variables and functions */
int darr_move_slice(struct darr *, struct darr *, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int /*<<< orphan*/ darr_size(struct darr *);
int darr_move(struct darr *d, struct darr *other) {
  return darr_move_slice(d, other, 0, darr_size(other));
}


x86 assembly (clang, -O0):
<darr_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <darr_size@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%ecx
xor    %edx,%edx
call   1030 <darr_move_slice@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darr_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <darr_size@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <darr_move_slice@plt>

LLVM IR (-O0):
%struct.darr = type { i32 }
define i32 @darr_move(%struct.darr* %0, %struct.darr* %1) {
%3 = alloca %struct.darr*
%4 = alloca %struct.darr*
store %struct.darr* %0, %struct.darr** %3
store %struct.darr* %1, %struct.darr** %4
%5 = load %struct.darr*, %struct.darr** %3
%6 = load %struct.darr*, %struct.darr** %4
%7 = load %struct.darr*, %struct.darr** %4
%8 = call i32 @darr_size(%struct.darr* %7)
%9 = call i32 @darr_move_slice(%struct.darr* %5, %struct.darr* %6, i32 0, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.darr = type { i32 }
define i32 @darr_move(%struct.darr* %0, %struct.darr* %1) {
%3 = tail call i32 @darr_size(%struct.darr* %1)
%4 = tail call i32 @darr_move_slice(%struct.darr* %0, %struct.darr* %1, i32 0, i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *x = (int *)malloc(4);
  x[1] = 0;
  printf("%d\n", x[2]);
  return x[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0x4(%rax)
mov    0x8(%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32 0, i32* %3
%4 = getelementptr inbounds i32, i32* %2, i64 2
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
ret i32 %7
}
/* Variables and functions */
double rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
double RandomInterval(double min, double max) {
  srand((unsigned)time(NULL));
  double x = 0, interval = max - min;
  x = rand();
  x = x / 32767;
  return min + x * interval;
}


x86 assembly (clang, -O0):
<RandomInterval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInterval>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
divsd  0xe91(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @RandomInterval(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call i64 @time(i32* null)
%8 = trunc i64 %7 to i32
%9 = call i32 @srand(i32 %8)
store double 0.000000e+00, double* %5
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
store double %12, double* %6
%13 = call double (...) @rand()
store double %13, double* %5
%14 = load double, double* %5
%15 = fdiv double %14, 3.276700e+04
store double %15, double* %5
%16 = load double, double* %3
%17 = load double, double* %5
%18 = load double, double* %6
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %16)
ret double %19
}

LLVM IR (-O2):
define double @RandomInterval(double %0, double %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = fsub double %1, %0
%7 = tail call double (...) @rand()
%8 = fdiv double %7, 3.276700e+04
%9 = tail call double @llvm.fmuladd.f64(double %8, double %6, double %0)
ret double %9
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_int8_t(int8_t *mat, int dim) {
  int i;
  for (i = 0; i < dim; i++)
    printf("%d ", mat[i]);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_int8_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_int8_t+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_int8_t+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int8_t>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_int8_t+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_int8_t+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_int8_t(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void led_putnum(num) char num;
{
  static unsigned char *leds = (unsigned char *)0xfc000059;
  *leds = num;
}


x86 assembly (clang, -O0):
<led_putnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    0x2f0c(%rip),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_putnum>:
mov    $0xfc000059,%eax
mov    %dil,(%rax)
ret

LLVM IR (-O0):
@led_putnum.leds = internal global i8* inttoptr (i64 4227858521 to i8*)
define void @led_putnum(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = load i8*, i8** @led_putnum.leds
store i8 %4, i8* %5
ret void
}

LLVM IR (-O2):
define void @led_putnum(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* inttoptr (i64 4227858521 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  puts(getenv("PWD"));
  return 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)
lea    0xec3(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"PWD\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 = call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"PWD\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i32 %3)
ret i32 0
}
void OPA_read_write_barrier(void) {
  int a = 0;
  __asm__ __volatile__("lock orl $0, %0" : "+m"(a) : : "memory");
}


x86 assembly (clang, -O0):
<OPA_read_write_barrier>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lock orl $0x0,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPA_read_write_barrier>:
movl   $0x0,-0x4(%rsp)
lock orl $0x0,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @OPA_read_write_barrier() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn_4parms(unsigned char, unsigned long *, unsigned long *,
                             unsigned int *);
int main() {
  unsigned char a = 0;
  unsigned long b = 1, c = 2;
  unsigned int d = 3;
  fn_4parms(a, &b, &c, &d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
movzbl -0x5(%rbp),%edi
call   1030 <fn_4parms@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x1,0x10(%rsp)
movq   $0x2,0x8(%rsp)
movl   $0x3,0x4(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
xor    %edi,%edi
call   1030 <fn_4parms@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = bitcast i64* %1 to i8*
store i64 1, i64* %1
%5 = bitcast i64* %2 to i8*
store i64 2, i64* %2
%6 = bitcast i32* %3 to i8*
store i32 3, i32* %3
%7 = call i32 @fn_4parms(i8 zeroext 0, i64* %1, i64* %2, i32* %3)
ret i32 0
}
void gtk_radio_menu_item_new_from_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_menu_item_new_from_widget() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arch_local_irq_restore(int);
void arch_local_irq_enable(void) { arch_local_irq_restore(1); }


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

x86 assembly (clang, -O2):
<arch_local_irq_enable>:
mov    $0x1,%edi
jmp    1030 <arch_local_irq_restore@plt>

LLVM IR (-O0):
define void @arch_local_irq_enable() {
%1 = call i32 @arch_local_irq_restore(i32 1)
ret void
}

LLVM IR (-O2):
define void @arch_local_irq_enable() {
%1 = tail call i32 @arch_local_irq_restore(i32 1)
ret void
}
void copy3f3d(float *v1, double *v2) {
  v2[0] = (double)v1[0];
  v2[1] = (double)v1[1];
  v2[2] = (double)v1[2];
}


x86 assembly (clang, -O0):
<copy3f3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy3f3d>:
cvtps2pd (%rdi),%xmm0
movups %xmm0,(%rsi)
movss  0x8(%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @copy3f3d(float* %0, double* %1) {
%3 = alloca float*
%4 = alloca double*
store float* %0, float** %3
store double* %1, double** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
store double %14, double* %16
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fpext float %19 to double
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
ret void
}

LLVM IR (-O2):
define void @copy3f3d(float* nocapture %0, double* nocapture writeonly %1) {
%3 = bitcast float* %0 to <2 x float>*
%4 = load <2 x float>, <2 x float>* %3
%5 = fpext <2 x float> %4 to <2 x double>
%6 = bitcast double* %1 to <2 x double>*
store <2 x double> %5, <2 x double>* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = getelementptr inbounds double, double* %1, i64 2
store double %9, double* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_sniffer();
void *receive_ack(void *ptr) { start_sniffer(); }


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

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

LLVM IR (-O0):
define i8* @receive_ack(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @start_sniffer()
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @receive_ack(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @start_sniffer()
ret i8* undef
}
int uri_hex(int c) {
  return ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') ||
          (c >= '0' && c <= '9'));
}


x86 assembly (clang, -O0):
<uri_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <uri_hex+0x20>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <uri_hex+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <uri_hex+0x39>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <uri_hex+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <uri_hex+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_hex>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x6,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @uri_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 102
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 70
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @uri_hex(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 6
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
scalar_t__ dwgsim_opt_is_int(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, char *);
int /*<<< orphan*/ stderr;
int32_t dwgsim_atoi(char *optarg, char flag) {
  if (0 == dwgsim_opt_is_int(optarg)) {
    fprintf(stderr, "Error: command line option -%c is not a number [%s]\n",
            flag, optarg);
    exit(1);
  }
  return atoi(optarg);
}


x86 assembly (clang, -O0):
<dwgsim_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dwgsim_opt_is_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1192 <dwgsim_atoi+0x52>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rcx
lea    0xe80(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwgsim_atoi>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <dwgsim_opt_is_int@plt>
test   %rax,%rax
je     1160 <dwgsim_atoi+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <atoi@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
movsbl %bpl,%edx
lea    0xe8c(%rip),%rsi
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Error: command line option -%c is not a number [%s]\0A\00"
define i32 @dwgsim_atoi(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i64 @dwgsim_opt_is_int(i8* %5)
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8, i8* %4
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = call i32 @atoi(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Error: command line option -%c is not a number [%s]\0A\00"
define i32 @dwgsim_atoi(i8* %0, i8 signext %1) {
%3 = tail call i64 @dwgsim_opt_is_int(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8 signext %1, i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 @atoi(i8* %0)
ret i32 %10
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
void priv_vm_madv_protect_cleanup(int asroot, int injail, struct test *test) {}


x86 assembly (clang, -O0):
<priv_vm_madv_protect_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define void @priv_vm_madv_protect_cleanup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret void
}

LLVM IR (-O2):
%struct.test = type { i32 }
define void @priv_vm_madv_protect_cleanup(i32 %0, i32 %1, %struct.test* nocapture %2) {
ret void
}