xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  pid_t pid;
  printf("buffered in %d\n", getpid());
  pid = fork();
  if (pid == -1)
    abort();
  printf("after in %d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    118f <main+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <fork@plt>
cmp    $0xffffffff,%eax
jne    1179 <main+0x29>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe89(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"buffered in %d\0A\00"
@.str.1 = [13 x i8] c"after in %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @fork()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 (...) @getpid()
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"buffered in %d\0A\00"
@.str.1 = [13 x i8] c"after in %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = tail call i32 (...) @getpid()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, char);
scalar_t__ serial_is_transmit_fifo_empty(int);
void serial_write_char(char a) {
  while (serial_is_transmit_fifo_empty(0x3F8) == 0)
    ;
  outb(0x3F8, a);
}


x86 assembly (clang, -O0):
<serial_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3f8,%edi
call   1040 <serial_is_transmit_fifo_empty@plt>
cmp    $0x0,%rax
jne    1147 <serial_write_char+0x27>
jmp    112e <serial_write_char+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_char>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3f8,%edi
call   1040 <serial_is_transmit_fifo_empty@plt>
test   %rax,%rax
je     1130 <serial_write_char+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_write_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 @serial_is_transmit_fifo_empty(i32 1016)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @serial_write_char(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @serial_is_transmit_fifo_empty(i32 1016)
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outb(i32 1016, i8 signext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int storage_db_final(void *key, void *data, va_list ap) {
  free(data);
  return 0;
}


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

x86 assembly (clang, -O2):
<storage_db_final>:
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @storage_db_final(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int bufis(const char *buf, size_t buf_size, const char *str) {
  return buf_size == strlen(str) && strncmp(buf, str, buf_size) == 0;
}


x86 assembly (clang, -O0):
<bufis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x19(%rbp)
jne    1175 <bufis+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufis>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jne    1159 <bufis+0x39>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @bufis(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = load i8*, i8** %6
%9 = call i64 @strlen(i8* %8)
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = load i64, i64* %5
%15 = call i64 @strncmp(i8* %12, i8* %13, i64 %14)
%16 = icmp eq i64 %15, 0
br label %17
17: ; preds = %11, %3
%18 = phi i1 [ false, %3 ], [ %16, %11 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @bufis(i8* %0, i64 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = icmp eq i64 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @strncmp(i8* %0, i8* %2, i64 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
char *avro_str_alloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *avro_strndup(const char *str, size_t size) {
  if (str == NULL) {
    return NULL;
  }
  char *new_str = avro_str_alloc(size + 1);
  memcpy(new_str, str, size);
  new_str[size] = '\0';
  return new_str;
}


x86 assembly (clang, -O0):
<avro_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <avro_strndup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    117e <avro_strndup+0x5e>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <avro_str_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avro_strndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1151 <avro_strndup+0x31>
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1030 <avro_str_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    1153 <avro_strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @avro_strndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i8* @avro_str_alloc(i64 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %1)
%8 = getelementptr inbounds i8, i8* %6, i64 %1
store i8 0, i8* %8
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %10
}
void default_isr(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<default_isr>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <default_isr+0x9>
jmp    1109 <default_isr+0x9>

x86 assembly (clang, -O2):
<default_isr>:
jmp    1100 <default_isr>

LLVM IR (-O0):
define void @default_isr() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @default_isr() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct buff {
  int dummy;
};

/* Variables and functions */
struct buff *buff_alloc();
int /*<<< orphan*/ buff_append(struct buff *, struct buff const *);
struct buff *buff_dup(const struct buff *buf) {
  struct buff *buf2;
  buf2 = buff_alloc();
  buff_append(buf2, buf);
  return buf2;
}


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

x86 assembly (clang, -O2):
<buff_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <buff_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <buff_append@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.buff = type { i32 }
define %struct.buff* @buff_dup(%struct.buff* %0) {
%2 = alloca %struct.buff*
%3 = alloca %struct.buff*
store %struct.buff* %0, %struct.buff** %2
%4 = call %struct.buff* (...) @buff_alloc()
store %struct.buff* %4, %struct.buff** %3
%5 = load %struct.buff*, %struct.buff** %3
%6 = load %struct.buff*, %struct.buff** %2
%7 = call i32 @buff_append(%struct.buff* %5, %struct.buff* %6)
%8 = load %struct.buff*, %struct.buff** %3
ret %struct.buff* %8
}

LLVM IR (-O2):
%struct.buff = type { i32 }
define %struct.buff* @buff_dup(%struct.buff* %0) {
%2 = tail call %struct.buff* (...) @buff_alloc()
%3 = tail call i32 @buff_append(%struct.buff* %2, %struct.buff* %0)
ret %struct.buff* %2
}
void hdmi_common_set_hpd_on(int on) { return; }


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

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

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

LLVM IR (-O2):
define void @hdmi_common_set_hpd_on(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ countSort(int *, int, int);
int getMax(int *, int);
void RadixSort(int *array, int size) {
  int m = getMax(array, size);
  for (int exp = 1; m / exp > 0; exp *= 10)
    countSort(array, size, exp);
}


x86 assembly (clang, -O0):
<RadixSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <getMax@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%eax
jle    1170 <RadixSort+0x50>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <countSort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <RadixSort+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadixSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <getMax@plt>
test   %eax,%eax
jle    115b <RadixSort+0x3b>
mov    %eax,%ebp
mov    $0x1,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <countSort@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
mov    %ebp,%eax
cltd
idiv   %ebx
test   %eax,%eax
jg     1140 <RadixSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @RadixSort(i32* %0, i32 %1) {
%3 = tail call i32 @getMax(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 1, %2 ]
%8 = tail call i32 @countSort(i32* %0, i32 %1, i32 %7)
%9 = mul nsw i32 %7, 10
%10 = sdiv i32 %3, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_proxy {
  int dummy;
};
struct wl_display {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_display_get_version(struct wl_display *wl_display) {
  return wl_proxy_get_version((struct wl_proxy *)wl_display);
}


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

x86 assembly (clang, -O2):
<wl_display_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

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

LLVM IR (-O2):
%struct.wl_display = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_display_get_version(%struct.wl_display* %0) {
%2 = bitcast %struct.wl_display* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t __rleu16(uint8_t *buffer) {
  return ((uint16_t)buffer[1] << 8) | ((uint16_t)buffer[0] << 0);
}


x86 assembly (clang, -O0):
<__rleu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rleu16>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @__rleu16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 0
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @__rleu16(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = load i64, i64* %0
%7 = trunc i64 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
unsigned long INT32_MAX;
unsigned long strtoul(char const *, int /*<<< orphan*/ *, int);
int fromihex(const char *s) {
  unsigned long l = strtoul(s, NULL, 16);
  if (l > INT32_MAX)
    l &= INT32_MAX;
  return (int)l;
}


x86 assembly (clang, -O0):
<fromihex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
jbe    1158 <fromihex+0x48>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromihex>:
push   %rax
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    0x2ebc(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rcx,%rax
mov    $0xffffffff,%edx
cmova  %ecx,%edx
and    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@INT32_MAX = global i64 0
define i32 @fromihex(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtoul(i8* %4, i32* null, i32 16)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* @INT32_MAX
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i64, i64* @INT32_MAX
%11 = load i64, i64* %3
%12 = and i64 %11, %10
store i64 %12, i64* %3
br label %13
13: ; preds = %9, %1
%14 = load i64, i64* %3
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@INT32_MAX = global i64 0
define i32 @fromihex(i8* nocapture %0) {
%2 = tail call i64 @strtoul(i8* nocapture %0, i32* null, i32 16)
%3 = load i64, i64* @INT32_MAX
%4 = icmp ugt i64 %2, %3
%5 = select i1 %4, i64 %3, i64 4294967295
%6 = and i64 %5, %2
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ lcd44780_wait();
void lcd44780_data(unsigned char c) {
  *((volatile unsigned char *)0xbe020001) = c;
  lcd44780_wait();
}


x86 assembly (clang, -O0):
<lcd44780_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xbe020001,%eax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <lcd44780_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd44780_data>:
mov    $0xbe020001,%eax
mov    %dil,(%rax)
xor    %eax,%eax
jmp    1030 <lcd44780_wait@plt>

LLVM IR (-O0):
define void @lcd44780_data(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 3187802113 to i8*)
%4 = call i32 (...) @lcd44780_wait()
ret void
}

LLVM IR (-O2):
define void @lcd44780_data(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 3187802113 to i8*)
%2 = tail call i32 (...) @lcd44780_wait()
ret void
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_offer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void wl_data_offer_destroy(struct wl_data_offer *wl_data_offer) {
  wl_proxy_marshal((struct wl_proxy *)wl_data_offer, 2);
  wl_proxy_destroy((struct wl_proxy *)wl_data_offer);
}


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

x86 assembly (clang, -O2):
<wl_data_offer_destroy>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

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

LLVM IR (-O2):
%struct.wl_data_offer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_offer_destroy(%struct.wl_data_offer* %0) {
%2 = bitcast %struct.wl_data_offer* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 2)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Variables and functions */
int cuadrado(int);
int cuarta(int);
int cubo(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stdout;
int main() {
  int a, b, c;
  a = cuadrado(2);
  b = cubo(2);
  c = cuarta(2);
  fprintf(stdout, "a= %d\n b= %d \n c= %d \n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <cuadrado@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1060 <cubo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1050 <cuarta@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe77(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2,%edi
call   1040 <cuadrado@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1060 <cubo@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1050 <cuarta@plt>
mov    0x2e74(%rip),%rcx
mov    (%rcx),%edi
lea    0xe8b(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"a= %d\0A b= %d \0A c= %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @cuadrado(i32 2)
store i32 %4, i32* %1
%5 = call i32 @cubo(i32 2)
store i32 %5, i32* %2
%6 = call i32 @cuarta(i32 2)
store i32 %6, i32* %3
%7 = load i32, i32* @stdout
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"a= %d\0A b= %d \0A c= %d \0A\00"
define i32 @main() {
%1 = tail call i32 @cuadrado(i32 2)
%2 = tail call i32 @cubo(i32 2)
%3 = tail call i32 @cuarta(i32 2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret i32 0
}
int init_sockets() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_sockets() {
ret i32 0
}
int __start() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__start() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int ror(int);
uint8_t F1(uint8_t x) {
  uint8_t temp1, temp2, temp3;
  temp1 = ror(x);
  temp1 = ror(temp1);
  temp2 = ror(temp1);
  temp2 = ror(temp2);
  temp3 = ror(temp2);
  return temp1 ^ temp2 ^ temp3;
}


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

x86 assembly (clang, -O2):
<F1>:
push   %rbp
push   %rbx
push   %rax
call   1030 <ror@plt>
mov    %eax,%edi
call   1030 <ror@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <ror@plt>
mov    %eax,%edi
call   1030 <ror@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <ror@plt>
xor    %ebx,%ebp
xor    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @F1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @ror(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @ror(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @ror(i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @ror(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 @ror(i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = xor i32 %16, %17
%19 = load i32, i32* %5
%20 = xor i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @F1(i32 %0) {
%2 = tail call i32 @ror(i32 %0)
%3 = tail call i32 @ror(i32 %2)
%4 = tail call i32 @ror(i32 %3)
%5 = tail call i32 @ror(i32 %4)
%6 = tail call i32 @ror(i32 %5)
%7 = xor i32 %5, %3
%8 = xor i32 %7, %6
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_STRING;

/* Variables and functions */
int ASN1_mbstring_ncopy(int /*<<< orphan*/ **, unsigned char const *, int, int,
                        unsigned long, int /*<<< orphan*/, int /*<<< orphan*/);
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
                       int inform, unsigned long mask) {
  return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
}


x86 assembly (clang, -O0):
<ASN1_mbstring_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <ASN1_mbstring_ncopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_mbstring_copy>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <ASN1_mbstring_ncopy@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ASN1_mbstring_copy(i32** %0, i8* %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store i32** %0, i32*** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i64, i64* %10
%16 = call i32 @ASN1_mbstring_ncopy(i32** %11, i8* %12, i32 %13, i32 %14, i64 %15, i32 0, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ASN1_mbstring_copy(i32** %0, i8* %1, i32 %2, i32 %3, i64 %4) {
%6 = tail call i32 @ASN1_mbstring_ncopy(i32** %0, i8* %1, i32 %2, i32 %3, i64 %4, i32 0, i32 0)
ret i32 %6
}
int hashfn(const char *key) {
  unsigned int hashed = 0;
  const char *c;
  static const int bits_per_int = sizeof(unsigned int) * 8;
  for (c = key; *c; c++) {
    hashed = (hashed << 5) | (hashed >> (bits_per_int - 5));
    hashed ^= *c;
  }
  return hashed % 31;
}


x86 assembly (clang, -O0):
<hashfn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <hashfn+0x53>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
shr    $0x1b,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hashfn+0x17>
mov    -0xc(%rbp),%eax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfn>:
mov    (%rdi),%al
test   %al,%al
je     1147 <hashfn+0x47>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
rol    $0x5,%edx
movsbl %al,%ecx
xor    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hashfn+0x10>
mov    %ecx,%eax
imul   $0x8421085,%rax,%rdx
shr    $0x20,%rdx
mov    %ecx,%eax
sub    %edx,%eax
shr    %eax
add    %edx,%eax
shr    $0x4,%eax
mov    %eax,%edx
shl    $0x5,%edx
sub    %edx,%eax
add    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@hashfn.bits_per_int = internal constant i32 32
define i32 @hashfn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %21, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %3
%12 = shl i32 %11, 5
%13 = load i32, i32* %3
%14 = lshr i32 %13, 27
%15 = or i32 %12, %14
store i32 %15, i32* %3
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %3
%20 = xor i32 %19, %18
store i32 %20, i32* %3
br label %21
21: ; preds = %10
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
br label %6
24: ; preds = %6
%25 = load i32, i32* %3
%26 = urem i32 %25, 31
ret i32 %26
}

LLVM IR (-O2):
define i32 @hashfn(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @llvm.fshl.i32(i32 %7, i32 %7, i32 5)
%9 = sext i8 %5 to i32
%10 = xor i32 %8, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 31
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
extern int ast_tvzero(const struct timeval t) {
  return (t.tv_sec == 0 && t.tv_usec == 0);
}


x86 assembly (clang, -O0):
<ast_tvzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1127 <ast_tvzero+0x27>
cmpq   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_tvzero>:
xor    %eax,%eax
or     %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @ast_tvzero(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ false, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @ast_tvzero(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = zext i1 %5 to i32
ret i32 %6
}
int main(void) {
  unsigned size = 3;
  unsigned local_array[size];
  static unsigned static_local_array[3] = {42, 89};
  unsigned(*array_pointer)[3];
  array_pointer = static_local_array;
  array_pointer = local_array;
  unsigned *array_of_pointers[3];
  unsigned *array_of_pointers_2[size];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
lea    0x2ede(%rip),%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.static_local_array = internal global [3 x i32] [i32 42, i32 89, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [3 x i32]*
%6 = alloca [3 x i32*]
%7 = alloca i64
store i32 0, i32* %1
store i32 3, i32* %2
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %3
%11 = alloca i32, i64 %9
store i64 %9, i64* %4
store [3 x i32]* @main.static_local_array, [3 x i32]** %5
%12 = bitcast i32* %11 to [3 x i32]*
store [3 x i32]* %12, [3 x i32]** %5
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = alloca i32*, i64 %14
store i64 %14, i64* %7
store i32 0, i32* %1
%16 = load i8*, i8** %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int WEXITSTATUS(int);
int WIFEXITED(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ wait(int *);
void utest_child_exited(int exitcode) {
  int status;
  wait(&status);
  assert(WIFEXITED(status));
  assert(WEXITSTATUS(status) == exitcode);
}


x86 assembly (clang, -O0):
<utest_child_exited>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1060 <wait@plt>
mov    -0x8(%rbp),%edi
call   1050 <WIFEXITED@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%edi
call   1040 <WEXITSTATUS@plt>
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utest_child_exited>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
call   1060 <wait@plt>
mov    0xc(%rsp),%edi
call   1050 <WIFEXITED@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    0xc(%rsp),%edi
call   1040 <WEXITSTATUS@plt>
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @utest_child_exited(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait(i32* %3)
%5 = load i32, i32* %3
%6 = call i32 @WIFEXITED(i32 %5)
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @WEXITSTATUS(i32 %8)
%10 = load i32, i32* %2
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}

LLVM IR (-O2):
define void @utest_child_exited(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @WIFEXITED(i32 %5)
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @WEXITSTATUS(i32 %8)
%10 = icmp eq i32 %9, %0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}
double saturate(double f) { return (f > 1.0 ? 1.0 : (f < 0.0 ? 0.0 : f)); }


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1132 <saturate+0x32>
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <saturate+0x61>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114d <saturate+0x4d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <saturate+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
xorpd  %xmm2,%xmm2
maxsd  %xmm0,%xmm2
movsd  0xef0(%rip),%xmm3
movapd %xmm3,%xmm1
cmpltsd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm3,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @saturate(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 0.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ 1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @saturate(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double 0.000000e+00, double %0
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int NSIG;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigdelset(int /*<<< orphan*/ *, int);
int sigdelset(sigset_t *set, int signo) {
  if (set == NULL || signo <= 0 || signo >= NSIG) {
    __set_errno(EINVAL);
    return -1;
  }
  return __sigdelset(set, signo);
}


x86 assembly (clang, -O0):
<sigdelset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <sigdelset+0x36>
cmpl   $0x0,-0x14(%rbp)
jle    1156 <sigdelset+0x36>
mov    -0x14(%rbp),%eax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
jl     1170 <sigdelset+0x50>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <sigdelset+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <__sigdelset@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigdelset>:
push   %rax
test   %rdi,%rdi
je     113b <sigdelset+0x1b>
test   %esi,%esi
jle    113b <sigdelset+0x1b>
mov    0x2ea7(%rip),%rax
cmp    %esi,(%rax)
jle    113b <sigdelset+0x1b>
pop    %rax
jmp    1040 <__sigdelset@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@NSIG = global i32 0
@EINVAL = global i32 0
define i32 @sigdelset(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = icmp eq i32* %6, null
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i32, i32* @NSIG
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11, %8, %2
%16 = load i32, i32* @EINVAL
%17 = call i32 @__set_errno(i32 %16)
store i32 -1, i32* %3
br label %22
18: ; preds = %11
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = call i32 @__sigdelset(i32* %19, i32 %20)
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@NSIG = global i32 0
@EINVAL = global i32 0
define i32 @sigdelset(i32* %0, i32 %1) {
%3 = icmp ne i32* %0, null
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = load i32, i32* @NSIG
%7 = icmp sgt i32 %6, %1
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* @EINVAL
%11 = tail call i32 @__set_errno(i32 %10)
br label %14
12: ; preds = %2
%13 = tail call i32 @__sigdelset(i32* %0, i32 %1)
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ -1, %9 ], [ %13, %12 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ XtInitializeWidgetClass(int /*<<< orphan*/);
int /*<<< orphan*/ vendorShellWidgetClass;
void XawInitializeWidgetSet() {
  static int firsttime = 1;
  if (firsttime) {
    firsttime = 0;
    XtInitializeWidgetClass(vendorShellWidgetClass);
  }
}


x86 assembly (clang, -O0):
<XawInitializeWidgetSet>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
je     1139 <XawInitializeWidgetSet+0x29>
movl   $0x0,0x2efd(%rip)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <XtInitializeWidgetClass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<XawInitializeWidgetSet>:
cmpb   $0x0,0x2f15(%rip)
je     111a <XawInitializeWidgetSet+0xa>
ret
movb   $0x1,0x2f0b(%rip)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <XtInitializeWidgetClass@plt>

LLVM IR (-O0):
@XawInitializeWidgetSet.firsttime = internal global i32 1
@vendorShellWidgetClass = global i32 0
define void @XawInitializeWidgetSet() {
%1 = load i32, i32* @XawInitializeWidgetSet.firsttime
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
store i32 0, i32* @XawInitializeWidgetSet.firsttime
%4 = load i32, i32* @vendorShellWidgetClass
%5 = call i32 @XtInitializeWidgetClass(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@XawInitializeWidgetSet.firsttime = internal unnamed_addr global i1 false
@vendorShellWidgetClass = global i32 0
define void @XawInitializeWidgetSet() {
%1 = load i1, i1* @XawInitializeWidgetSet.firsttime
br i1 %1, label %5, label %2
2: ; preds = %0
store i1 true, i1* @XawInitializeWidgetSet.firsttime
%3 = load i32, i32* @vendorShellWidgetClass
%4 = tail call i32 @XtInitializeWidgetClass(i32 %3)
br label %5
5: ; preds = %2, %0
ret void
}
void SSMR3Skip(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3Skip() {
ret void
}
int test_imm_5Auint32_mem(unsigned int *val) {
  return ((*val) & (0x5A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Auint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 90
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _prevent_memset_lto(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void test_func(void) {
  char buf[16];
  void *buffer_to_confuse_compiler = buf;
  memset(buffer_to_confuse_compiler, 0, 32);
  _prevent_memset_lto(buf, 0, 32);
}


x86 assembly (clang, -O0):
<test_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <_prevent_memset_lto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <_prevent_memset_lto@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_func() {
%1 = alloca [16 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i32 0, i32 32)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%7 = call i32 @_prevent_memset_lto(i8* %6, i32 0, i32 32)
ret void
}

LLVM IR (-O2):
define void @test_func() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 32)
%4 = call i32 @_prevent_memset_lto(i8* %2, i32 0, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_SetVolumeDB(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *, short);
void UPnPRenderingControl_SetVolumeDB(void *upnptoken, unsigned int InstanceID,
                                      char *Channel, short DesiredVolume) {
  printf("Invoke: UPnPRenderingControl_SetVolumeDB(%u,%s,%d);\r\n", InstanceID,
         Channel, DesiredVolume);
  UPnPResponse_RenderingControl_SetVolumeDB(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_SetVolumeDB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xeb8(%rip),%rdi
movswl -0x1a(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_RenderingControl_SetVolumeDB@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_SetVolumeDB>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_SetVolumeDB@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Invoke: UPnPRenderingControl_SetVolumeDB(%u,%s,%d);\0D\0A\00"
define void @UPnPRenderingControl_SetVolumeDB(i8* %0, i32 %1, i8* %2, i16 signext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i16, i16* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i16 signext %11)
%13 = load i8*, i8** %5
%14 = call i32 @UPnPResponse_RenderingControl_SetVolumeDB(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Invoke: UPnPRenderingControl_SetVolumeDB(%u,%s,%d);\0D\0A\00"
define void @UPnPRenderingControl_SetVolumeDB(i8* %0, i32 %1, i8* %2, i16 signext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i16 signext %3)
%6 = tail call i32 @UPnPResponse_RenderingControl_SetVolumeDB(i8* %0)
ret void
}