xunge/DecIR huggingface dataset:
void fs_http_closedir(struct fs_dir *d) { return; }


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

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

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

LLVM IR (-O2):
%struct.fs_dir = type opaque
define void @fs_http_closedir(%struct.fs_dir* nocapture %0) {
ret void
}
int sePuedeSwapAbajo(int iPosicionConflicto) {
  if (iPosicionConflicto < 7) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sePuedeSwapAbajo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    111d <sePuedeSwapAbajo+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <sePuedeSwapAbajo+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sePuedeSwapAbajo>:
xor    %eax,%eax
cmp    $0x7,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @sePuedeSwapAbajo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @sePuedeSwapAbajo(i32 %0) {
%2 = icmp slt i32 %0, 7
%3 = zext i1 %2 to i32
ret i32 %3
}
void sim_cleanup_sock(void) {}


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

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

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

LLVM IR (-O2):
define void @sim_cleanup_sock() {
ret void
}
/* Variables and functions */
int _pack2(unsigned int, unsigned int);
unsigned conj_fun_complexOf_ushort(unsigned a) {
  return _pack2(a >> 16, -(a & 0x0000ffff));
}


x86 assembly (clang, -O0):
<conj_fun_complexOf_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
xor    %esi,%esi
sub    %eax,%esi
call   1030 <_pack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conj_fun_complexOf_ushort>:
movzwl %di,%esi
shr    $0x10,%edi
neg    %esi
jmp    1030 <_pack2@plt>

LLVM IR (-O0):
define i32 @conj_fun_complexOf_ushort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
%7 = sub i32 0, %6
%8 = call i32 @_pack2(i32 %4, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @conj_fun_complexOf_ushort(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %0, 65535
%4 = sub nsw i32 0, %3
%5 = tail call i32 @_pack2(i32 %2, i32 %4)
ret i32 %5
}
__attribute__((always_)) long prctl_get_seccomp(void) { return -22; }


x86 assembly (clang, -O0):
<prctl_get_seccomp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffea,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prctl_get_seccomp>:
mov    $0xffffffffffffffea,%rax
ret

LLVM IR (-O0):
define i64 @prctl_get_seccomp() {
ret i64 -22
}

LLVM IR (-O2):
define i64 @prctl_get_seccomp() {
ret i64 -22
}
/* Type definitions */
struct serial_t {
  int dummy;
};

/* Variables and functions */
int serial_close(struct serial_t *);
int serial_remove(struct serial_t *tty) { return serial_close(tty); }


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

x86 assembly (clang, -O2):
<serial_remove>:
jmp    1030 <serial_close@plt>

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

LLVM IR (-O2):
%struct.serial_t = type { i32 }
define i32 @serial_remove(%struct.serial_t* %0) {
%2 = tail call i32 @serial_close(%struct.serial_t* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __DSB();
int /*<<< orphan*/ __ISB();
int /*<<< orphan*/ __set_BPIALL(int /*<<< orphan*/);
void L1C_InvalidateBTAC(void) {
  __set_BPIALL(0);
  __DSB();
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_InvalidateBTAC>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <__set_BPIALL@plt>
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_InvalidateBTAC>:
push   %rax
xor    %edi,%edi
call   1050 <__set_BPIALL@plt>
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_InvalidateBTAC() {
%1 = call i32 @__set_BPIALL(i32 0)
%2 = call i32 (...) @__DSB()
%3 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_InvalidateBTAC() {
%1 = tail call i32 @__set_BPIALL(i32 0)
%2 = tail call i32 (...) @__DSB()
%3 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
long moveFile(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *newMoveThread(void *arg) {
  char *filename;
  filename = (char *)arg;
  long filesize = moveFile(filename);
  if (filesize < 0) {
    filesize = 0;
  }
  pthread_exit((void *)filesize);
}


x86 assembly (clang, -O0):
<newMoveThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <moveFile@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1154 <newMoveThread+0x34>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newMoveThread>:
push   %rax
call   1030 <moveFile@plt>
xor    %edi,%edi
test   %rax,%rax
cmovns %rax,%rdi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @newMoveThread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @moveFile(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i64 0, i64* %5
br label %12
12: ; preds = %11, %1
%13 = load i64, i64* %5
%14 = inttoptr i64 %13 to i8*
%15 = call i32 @pthread_exit(i8* %14)
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @newMoveThread(i8* %0) {
%2 = tail call i64 @moveFile(i8* %0)
%3 = icmp sgt i64 %2, 0
%4 = select i1 %3, i64 %2, i64 0
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @pthread_exit(i8* %5)
ret i8* undef
}
void bnxt_tc_flow_stats_work(struct bnxt *bp) {}


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

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

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

LLVM IR (-O2):
%struct.bnxt = type opaque
define void @bnxt_tc_flow_stats_work(%struct.bnxt* nocapture %0) {
ret void
}
/* Variables and functions */
int info_mem_dev(char *, char **);
int smrlog_info_master(char *basedir, char **buf) {
  return info_mem_dev(basedir, buf);
}


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

x86 assembly (clang, -O2):
<smrlog_info_master>:
jmp    1030 <info_mem_dev@plt>

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

LLVM IR (-O2):
define i32 @smrlog_info_master(i8* %0, i8** %1) {
%3 = tail call i32 @info_mem_dev(i8* %0, i8** %1)
ret i32 %3
}
int main(void) {
  int x = 10;
  int *a;
  float *b;
  void *p;
  a = &x;
  p = a;
  b = p;
  *b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca float*
%5 = alloca i8*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to float*
store float* %9, float** %4
%10 = load float*, float** %4
%11 = load float, float* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int compare_special_b(void const *a, void const *b) {
  int char_a = ((char *)a)[0];
  int char_b = ((char *)b)[0];
  return char_a - char_b;
}


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

x86 assembly (clang, -O2):
<compare_special_b>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_special_b(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return (c + ('A' - 'a'));
  else
    return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <ft_toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <ft_toupper+0x29>
mov    -0x8(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_toupper(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
}
/* Variables and functions */
int get_mdterm();
void md_draw_string_green(int x, int y, char *str) {
  switch (get_mdterm()) {}
}


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

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

LLVM IR (-O0):
define void @md_draw_string_green(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @get_mdterm()
switch i32 %7, label %8 [
]
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @md_draw_string_green(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @get_mdterm()
ret void
}
int avl_max(int a, int b) { return (a > b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @avl_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ perror(char *);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void initialiser_signaux(void) {
  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
    perror(" signal ");
  }
}


x86 assembly (clang, -O0):
<initialiser_signaux>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%rax
jne    1157 <initialiser_signaux+0x37>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiser_signaux>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
je     1146 <initialiser_signaux+0x26>
pop    %rax
ret
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [9 x i8] c" signal \00"
define void @initialiser_signaux() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i64 @signal(i32 %1, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [9 x i8] c" signal \00"
define void @initialiser_signaux() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i64 @signal(i32 %1, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int send_raw(struct client *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int send_msg(struct client *cl, const char *channel, const char *msg) {
  char buf[1024 + 64];
  snprintf(buf, 1024 + 64, "PRIVMSG %s :%s", channel, msg);
  return send_raw(cl, buf);
}


x86 assembly (clang, -O0):
<send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x460(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x440,%esi
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x460(%rbp),%rsi
call   1040 <send_raw@plt>
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg>:
push   %r14
push   %rbx
sub    $0x448,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xec6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x440,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <send_raw@plt>
add    $0x448,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.client = type { i32 }
@.str = [15 x i8] c"PRIVMSG %s :%s\00"
define i32 @send_msg(%struct.client* %0, i8* %1, i8* %2) {
%4 = alloca %struct.client*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1088 x i8]
store %struct.client* %0, %struct.client** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1088 x i8], [1088 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @snprintf(i8* %8, i32 1088, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load %struct.client*, %struct.client** %4
%13 = getelementptr inbounds [1088 x i8], [1088 x i8]* %7, i64 0, i64 0
%14 = call i32 @send_raw(%struct.client* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.client = type { i32 }
@.str = [15 x i8] c"PRIVMSG %s :%s\00"
define i32 @send_msg(%struct.client* %0, i8* %1, i8* %2) {
%4 = alloca [1088 x i8]
%5 = getelementptr inbounds [1088 x i8], [1088 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 1088, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%7 = call i32 @send_raw(%struct.client* %0, i8* %5)
ret i32 %7
}
/* Type definitions */
struct pgpool {
  int dummy;
};

/* Variables and functions */
void *pgp_alloc(struct pgpool *, unsigned long);
void *__pgp_alloc_agent(void *alloc, unsigned long size) {
  return pgp_alloc((struct pgpool *)alloc, size);
}


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

x86 assembly (clang, -O2):
<__pgp_alloc_agent>:
jmp    1030 <pgp_alloc@plt>

LLVM IR (-O0):
%struct.pgpool = type { i32 }
define i8* @__pgp_alloc_agent(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.pgpool*
%7 = load i64, i64* %4
%8 = call i8* @pgp_alloc(%struct.pgpool* %6, i64 %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.pgpool = type { i32 }
define i8* @__pgp_alloc_agent(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to %struct.pgpool*
%4 = tail call i8* @pgp_alloc(%struct.pgpool* %3, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, int);
int STEST908(short v) {
  int r = v + 133;
  printf("sub  (test15f - C908): Call by value short :(%3d=5) returning int "
         ":(%3d=138)\n",
         v, r);
  v = v - 3;
  printf("sub  (test15f - C908): Call by value short :(%3d=2) returning int "
         ":(%3d=138)\n",
         v, r);
  return r;
}


x86 assembly (clang, -O0):
<STEST908>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x85,%eax
mov    %eax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
lea    0xec7(%rip),%rdi
movswl %ax,%esi
call   1030 <printf@plt>
movswl -0x2(%rbp),%eax
sub    $0x3,%eax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
lea    0xef4(%rip),%rdi
movswl %ax,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEST908>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x85(%rbx),%ebp
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    $0xfffffffd,%ebx
movswl %bx,%esi
lea    0xf16(%rip),%rdi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [78 x i8] c"sub (test15f - C908): Call by value short :(%3d=5) returning int :(%3d=138)\0A\00"
@.str.1 = [78 x i8] c"sub (test15f - C908): Call by value short :(%3d=2) returning int :(%3d=138)\0A\00"
define i32 @STEST908(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = add nsw i32 %5, 133
store i32 %6, i32* %3
%7 = load i16, i16* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i16 signext %7, i32 %8)
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = sub nsw i32 %11, 3
%13 = trunc i32 %12 to i16
store i16 %13, i16* %2
%14 = load i16, i16* %2
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i16 signext %14, i32 %15)
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [78 x i8] c"sub (test15f - C908): Call by value short :(%3d=5) returning int :(%3d=138)\0A\00"
@.str.1 = [78 x i8] c"sub (test15f - C908): Call by value short :(%3d=2) returning int :(%3d=138)\0A\00"
define i32 @STEST908(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = add nsw i32 %2, 133
%4 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i16 signext %0, i32 %3)
%5 = add i16 %0, -3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i16 signext %5, i32 %3)
ret i32 %3
}
char *foo() { return "foo"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @foo() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void swap(int *array, int i, int j) {
  int aux;
  aux = array[i];
  array[i] = array[j];
  array[j] = aux;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
__attribute__((no, noclone)) unsigned __int128 t159_5add(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_add_overflow(x, (signed __int128)(-4), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t159_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0xfffffffffffffffc,%rdx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t159_5add+0x77>
jmp    118e <t159_5add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t159_5add>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
mov    %rdi,%r14
add    $0xfffffffffffffffc,%r14
mov    %rsi,%rbx
adc    $0xffffffffffffffff,%rbx
mov    $0x3,%ecx
cmp    %rdi,%rcx
sbb    %rsi,%rax
jl     1138 <t159_5add+0x28>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t159_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %12, i129 -4)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t159_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nsw i129 %7, -4
%9 = icmp slt i128 %6, 4
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
void *init_branches_c(int n) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @init_branches_c(i32 %0) {
ret i8* null
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, char *, int *);
char *sceKernelGetRandomizedPath() {
  char path[16];
  int length = 11;
  char *r;
  syscall(602, 0, path + 4, &length);
  r = malloc(12);
  r[0] = '/';
  strcpy(r, path + 4);
  return r;
}


x86 assembly (clang, -O0):
<sceKernelGetRandomizedPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xb,-0x14(%rbp)
lea    -0x10(%rbp),%rdx
add    $0x4,%rdx
mov    $0x25a,%edi
xor    %esi,%esi
lea    -0x14(%rbp),%rcx
call   1040 <syscall@plt>
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x20(%rbp),%rdi
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sceKernelGetRandomizedPath>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movl   $0xb,0xc(%rsp)
lea    0x14(%rsp),%r14
lea    0xc(%rsp),%rcx
mov    $0x25a,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <syscall@plt>
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x2f,(%rax)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sceKernelGetRandomizedPath() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = alloca i8*
store i32 11, i32* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = call i32 @syscall(i32 602, i32 0, i8* %5, i32* %2)
%7 = call i8* @malloc(i32 12)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 47, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 4
%13 = call i32 @strcpy(i8* %10, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @sceKernelGetRandomizedPath() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 11, i32* %2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 4
%6 = call i32 @syscall(i32 602, i32 0, i8* %5, i32* %2)
%7 = call dereferenceable_or_null(12) i8* @malloc(i32 12)
store i8 47, i8* %7
%8 = call i32 @strcpy(i8* %7, i8* %5)
ret i8* %7
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __nacl_irt_stat(char const *, struct stat *);
int __xstat(int version, const char *path, struct stat *buf) {
  return __nacl_irt_stat(path, buf);
}


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

x86 assembly (clang, -O2):
<__xstat>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <__nacl_irt_stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i8*, i8** %5
%8 = load %struct.stat*, %struct.stat** %6
%9 = call i32 @__nacl_irt_stat(i8* %7, %struct.stat* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = tail call i32 @__nacl_irt_stat(i8* %1, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
int jg_lex();
int yylex(void) { return jg_lex(); }


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

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

LLVM IR (-O0):
define i32 @yylex() {
%1 = call i32 (...) @jg_lex()
ret i32 %1
}

LLVM IR (-O2):
define i32 @yylex() {
%1 = tail call i32 (...) @jg_lex()
ret i32 %1
}
/* Type definitions */
struct foo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ foo_hold(struct foo *);
int /*<<< orphan*/ printf(char *, unsigned int);
scalar_t__ pthread_self();
void *thr_fn_hold(void *arg) {
  printf("thread id %u\n", (unsigned int)pthread_self());
  foo_hold((struct foo *)arg);
  return ((void *)0);
}


x86 assembly (clang, -O0):
<thr_fn_hold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <foo_hold@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn_hold>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <foo_hold@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.foo = type { i32 }
@.str = [14 x i8] c"thread id %u\0A\00"
define i8* @thr_fn_hold(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to %struct.foo*
%8 = call i32 @foo_hold(%struct.foo* %7)
ret i8* null
}

LLVM IR (-O2):
%struct.foo = type { i32 }
@.str = [14 x i8] c"thread id %u\0A\00"
define noalias i8* @thr_fn_hold(i8* %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = bitcast i8* %0 to %struct.foo*
%6 = tail call i32 @foo_hold(%struct.foo* %5)
ret i8* null
}
void foo414(int p) {}


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

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

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

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

/* Variables and functions */
void *__radix_tree_lookup(struct radix_tree *, unsigned long, int);
void *radix_tree_lookup_prev(struct radix_tree *tree, unsigned long key) {
  return __radix_tree_lookup(tree, key, true);
}


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

x86 assembly (clang, -O2):
<radix_tree_lookup_prev>:
mov    $0x1,%edx
jmp    1030 <__radix_tree_lookup@plt>

LLVM IR (-O0):
%struct.radix_tree = type { i32 }
define i8* @radix_tree_lookup_prev(%struct.radix_tree* %0, i64 %1) {
%3 = alloca %struct.radix_tree*
%4 = alloca i64
store %struct.radix_tree* %0, %struct.radix_tree** %3
store i64 %1, i64* %4
%5 = load %struct.radix_tree*, %struct.radix_tree** %3
%6 = load i64, i64* %4
%7 = call i8* @__radix_tree_lookup(%struct.radix_tree* %5, i64 %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
%struct.radix_tree = type { i32 }
define i8* @radix_tree_lookup_prev(%struct.radix_tree* %0, i64 %1) {
%3 = tail call i8* @__radix_tree_lookup(%struct.radix_tree* %0, i64 %1, i32 1)
ret i8* %3
}
/* Variables and functions */
void *malloc(size_t);
char *memcpy(void *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *str) {
  size_t length = strlen(str) + 1;
  void *new = malloc(length);
  if (new == NULL)
    return NULL;
  return memcpy(new, str, length);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1188 <strdup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %4, i1 false)
br label %8
8: ; preds = %1, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ld_cp_a(void) { op_write1(0xe2); }


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

x86 assembly (clang, -O2):
<op_enc_ld_cp_a>:
mov    $0xe2,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ld_cp_a() {
%1 = call i32 @op_write1(i32 226)
ret void
}

LLVM IR (-O2):
define void @op_enc_ld_cp_a() {
%1 = tail call i32 @op_write1(i32 226)
ret void
}
/* Variables and functions */
size_t capacityHS(unsigned nbits) { return 1 << (nbits - 1); }


x86 assembly (clang, -O0):
<capacityHS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<capacityHS>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @capacityHS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @capacityHS(i32 %0) {
%2 = add i32 %0, -1
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ start_elab_thread();
void init_elab() { start_elab_thread(); }


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

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

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

LLVM IR (-O2):
define void @init_elab() {
%1 = tail call i32 (...) @start_elab_thread()
ret void
}
int getLineType(const char *ptr) {
  if (*ptr == '[') {
    return 1;
  } else if (*ptr == '#') {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<getLineType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1124 <getLineType+0x24>
movl   $0x1,-0x4(%rbp)
jmp    114c <getLineType+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1140 <getLineType+0x40>
movl   $0x2,-0x4(%rbp)
jmp    114c <getLineType+0x4c>
jmp    1145 <getLineType+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLineType>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    $0x23,%al
sete   %cl
add    %ecx,%ecx
cmp    $0x5b,%al
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getLineType(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 91
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %17
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 35
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 2, i32* %2
br label %17
15: ; preds = %9
br label %16
16: ; preds = %15
store i32 0, i32* %2
br label %17
17: ; preds = %16, %14, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @getLineType(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = select i1 %3, i32 2, i32 0
%5 = icmp eq i8 %2, 91
%6 = select i1 %5, i32 1, i32 %4
ret i32 %6
}
void inc(unsigned char *n) {
  (*(unsigned int *)&n[12]) =
      __builtin_bswap32(1 + (__builtin_bswap32((*(unsigned int *)&n[12]))));
}


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
bswap  %ecx
add    $0x1,%ecx
bswap  %ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
mov    0xc(%rdi),%eax
bswap  %eax
add    $0x1,%eax
bswap  %eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @inc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @llvm.bswap.i32(i32 %6)
%8 = add i32 1, %7
%9 = call i32 @llvm.bswap.i32(i32 %8)
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 12
%12 = bitcast i8* %11 to i32*
store i32 %9, i32* %12
ret void
}

LLVM IR (-O2):
define void @inc(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @llvm.bswap.i32(i32 %4)
%6 = add i32 %5, 1
%7 = tail call i32 @llvm.bswap.i32(i32 %6)
store i32 %7, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t USBHostAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint,
                        uint32_t ui32Flags) {
  ;

  ;
  if (ui32Flags & 0x00002000) {
    return ((*((volatile unsigned char *)(ui32Base + 0x00000080 +
                                          (ui32Endpoint >> 1)))));
  } else {
    return ((*((volatile unsigned char *)(ui32Base + 0x00000080 + 4 +
                                          (ui32Endpoint >> 1)))));
  }
}


x86 assembly (clang, -O0):
<USBHostAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     113d <USBHostAddrGet+0x3d>
mov    -0x8(%rbp),%eax
add    $0x80,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <USBHostAddrGet+0x5a>
mov    -0x8(%rbp),%eax
add    $0x80,%eax
add    $0x4,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostAddrGet>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
lea    (%rdi,%rax,4),%eax
add    $0x80,%eax
sar    %esi
cltq
movslq %esi,%rcx
movzbl (%rax,%rcx,1),%eax
ret

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

LLVM IR (-O2):
define i32 @USBHostAddrGet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 8192
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 132, i32 128
%7 = add nsw i32 %6, %0
%8 = ashr i32 %1, 1
%9 = add nsw i32 %7, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load volatile i8, i8* %11
%13 = zext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
double transverse_distance(double);
double comoving_volume(double z) {
  double r = transverse_distance(z);
  return (4.0 * 3.14159265358979323846264338327950288 * r * r * r / 3.0);
}


x86 assembly (clang, -O0):
<comoving_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <transverse_distance@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comoving_volume>:
push   %rax
call   1030 <transverse_distance@plt>
movsd  0xee2(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
divsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @comoving_volume(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @transverse_distance(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double 0x402921FB54442D18, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = fdiv double %11, 3.000000e+00
ret double %12
}

LLVM IR (-O2):
define double @comoving_volume(double %0) {
%2 = tail call double @transverse_distance(double %0)
%3 = fmul double %2, 0x402921FB54442D18
%4 = fmul double %2, %3
%5 = fmul double %2, %4
%6 = fdiv double %5, 3.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, const char **argv) {
  fputs("Hello,", stdout);
  fputs(" ", stdout);
  fputs("world\n", stdout);
  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)
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xed8(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello,\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c" \00"
@.str.2 = [7 x i8] c"world\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}