xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gen_r_instr(int, int, int, int, int, int);
int /*<<< orphan*/ make_room();
void gen_r_type_SYSCALL() {
  int funct;
  int shamt;
  int vopt;
  int RD;
  int RS;
  int RT;
  funct = 0xc;
  shamt = 0;
  vopt = 5;
  RD = 0;
  RS = 0;
  RT = 0;
  make_room();
  gen_r_instr(vopt, funct, RD, RS, RT, shamt);
}


x86 assembly (clang, -O0):
<gen_r_type_SYSCALL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <make_room@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x8(%rbp),%r9d
call   1040 <gen_r_instr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_r_type_SYSCALL>:
push   %rax
xor    %eax,%eax
call   1030 <make_room@plt>
mov    $0x5,%edi
mov    $0xc,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rax
jmp    1040 <gen_r_instr@plt>

LLVM IR (-O0):
define void @gen_r_type_SYSCALL() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 12, i32* %1
store i32 0, i32* %2
store i32 5, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (...) @make_room()
%8 = load i32, i32* %3
%9 = load i32, i32* %1
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %2
%14 = call i32 @gen_r_instr(i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @gen_r_type_SYSCALL() {
%1 = tail call i32 (...) @make_room()
%2 = tail call i32 @gen_r_instr(i32 5, i32 12, i32 0, i32 0, i32 0, i32 0)
ret void
}
int search_file(const char *restrict directory, const char *restrict filename) {
  return 1;
}


x86 assembly (clang, -O0):
<search_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @search_file(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
ret i32 1
}
void gtk_text_iter_forward_word_end() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_word_end() {
ret void
}
void main(void) {
  int x;
  int y;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int __infer_nondet_int();
unsigned sleep(unsigned seconds) {
  int n;
  n = __infer_nondet_int();
  if (n < 0)
    while (1)
      ;
  return n;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1139 <sleep+0x29>
jmp    1134 <sleep+0x24>
jmp    1134 <sleep+0x24>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
js     1120 <sleep+0x10>
pop    %rcx
ret
xchg   %ax,%ax
jmp    1120 <sleep+0x10>

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

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %4
br label %4
5: ; preds = %1
ret i32 %2
}
/* Variables and functions */
scalar_t__ kill(int, int /*<<< orphan*/);
int process_running(int pid) { return (kill(pid, 0) == 0); }


x86 assembly (clang, -O0):
<process_running>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_running>:
push   %rax
xor    %esi,%esi
call   1030 <kill@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @process_running(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @kill(i32 %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @process_running(i32 %0) {
%2 = tail call i64 @kill(i32 %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, void *, size_t, int, struct sockaddr *,
                            int /*<<< orphan*/ *);
ssize_t test(void) {
  int sockfd = 4;
  int buffer;
  void *buf = &buffer;
  size_t len = sizeof(buffer);
  int flags = 7;
  struct sockaddr src_addr;
  socklen_t addrlen;
  return recvfrom(sockfd, buf, len, flags, &src_addr, &addrlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x4,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x4,-0x18(%rbp)
movl   $0x7,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    -0x20(%rbp),%r8
lea    -0x24(%rbp),%r9
call   1030 <recvfrom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%r8
lea    0x10(%rsp),%r9
mov    $0x4,%edx
mov    $0x4,%edi
mov    $0x7,%ecx
call   1030 <recvfrom@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.sockaddr
%7 = alloca i32
store i32 4, i32* %1
%8 = bitcast i32* %2 to i8*
store i8* %8, i8** %3
store i64 4, i64* %4
store i32 7, i32* %5
%9 = load i32, i32* %1
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = load i32, i32* %5
%13 = call i32 @recvfrom(i32 %9, i8* %10, i64 %11, i32 %12, %struct.sockaddr* %6, i32* %7)
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast %struct.sockaddr* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @recvfrom(i32 4, i8* %4, i64 4, i32 7, %struct.sockaddr* %2, i32* %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void baz(void) {
  bar();
  bar();
  bar();
}


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

x86 assembly (clang, -O2):
<baz>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @baz() {
%1 = call i32 (...) @bar()
%2 = call i32 (...) @bar()
%3 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @baz() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @bar()
ret void
}
void elfoutmsbu16(unsigned char *bp, unsigned int v) {
  ((bp)[0] = (v >> 8), (bp)[1] = v);
}


x86 assembly (clang, -O0):
<elfoutmsbu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<elfoutmsbu16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @elfoutmsbu16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_append_quaddobl_solution(int n, int m, double *sol) {
  int *a, fail;
  int b[2];
  b[0] = n;
  b[1] = m;
  fail = _ada_use_c2phc4c(396, a, b, sol, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_append_quaddobl_solution>:
push   %rax
mov    %rdx,%rcx
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x18c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_append_quaddobl_solution(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32*, i32** %7
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load double*, double** %6
%17 = call i32 @_ada_use_c2phc4c(i32 396, i32* %14, i32* %15, double* %16, i32 0)
store i32 %17, i32* %8
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @solcon_append_quaddobl_solution(i32 %0, i32 %1, double* %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 396, i32* undef, i32* %6, double* %2, i32 0)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pr_cont(char *);
void print_cpu_stall_info_begin(void) { pr_cont(" {"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c" {\00"
define void @print_cpu_stall_info_begin() {
%1 = tail call i32 @pr_cont(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Prim();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Here we go\n");
  Prim();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <Prim@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Here we go\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @Prim()
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Here we go\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @Prim()
ret i32 0
}
/* Variables and functions */
double drand48();
char binario_rand() { return drand48() < 0.5 ? '0' : '1'; }


x86 assembly (clang, -O0):
<binario_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mov    $0x31,%eax
mov    $0x30,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binario_rand>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
movsd  0xee0(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
xor    $0x31,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @binario_rand() {
%1 = call double (...) @drand48()
%2 = fcmp olt double %1, 5.000000e-01
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 48, i32 49
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @binario_rand() {
%1 = tail call double (...) @drand48()
%2 = fcmp olt double %1, 5.000000e-01
%3 = select i1 %2, i8 48, i8 49
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ myfunc(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  FILE *f = fopen(argv[1], "rb");
  myfunc(f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <myfunc@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <myfunc@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @myfunc(i32* %5)
%7 = tail call i32 @fclose(i32* %5)
ret i32 0
}
int ceil_div(int value, int divisor) {
  --value;
  return value - value % divisor + divisor;
}


x86 assembly (clang, -O0):
<ceil_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    %edx,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_div>:
lea    -0x1(%rdi),%eax
cltd
idiv   %esi
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ceil_div(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 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = sub nsw i32 %7, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ceil_div(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = srem i32 %3, %1
%5 = add i32 %3, %1
%6 = sub i32 %5, %4
ret i32 %6
}
const char *basename(const char *name) {
  const char *p = name;
  while (*p != '\0') {
    p++;
  }
  while (p > name) {
    if (*(p - 1) == '/' || *(p - 1) == '\\') {
      break;
    }
    p--;
  }
  return p;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <basename+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <basename+0x10>
jmp    1136 <basename+0x36>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    117c <basename+0x7c>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x2f,%eax
je     1166 <basename+0x66>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x5c,%eax
jne    116b <basename+0x6b>
jmp    117c <basename+0x7c>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <basename+0x36>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
lea    -0x1(%rdi),%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x1(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <basename+0x10>
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
cmp    %rdi,%rcx
jbe    113a <basename+0x3a>
movzbl -0x1(%rax),%edx
cmp    $0x5c,%dl
je     113a <basename+0x3a>
lea    -0x1(%rax),%rcx
cmp    $0x2f,%dl
jne    1120 <basename+0x20>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2, %10
%8 = phi i8* [ %11, %10 ], [ %3, %2 ]
%9 = icmp ugt i8* %8, %0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %8, i64 -1
%12 = load i8, i8* %11
switch i8 %12, label %7 [
i8 47, label %13
i8 92, label %13
]
13: ; preds = %10, %10, %7
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
main() {
  char *s = "main(){ char *s = %c%s%c; printf(s,34,s,34);}";
  printf(s, 34, s, 34);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x22,%ecx
mov    %ecx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x22,%esi
mov    %rdi,%rdx
mov    $0x22,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"main(){ char *s = %c%s%c; printf(s,34,s,34);}\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* %2, i32 34, i8* %3, i32 34)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"main(){ char *s = %c%s%c; printf(s,34,s,34);}\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 34)
ret i32 0
}
void _Z12shsTransformP8SHS_INFO(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z12shsTransformP8SHS_INFO() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void my_task(int x) { printf("Hello, world!  With x = %d\n", x); }


x86 assembly (clang, -O0):
<my_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_task>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Hello, world! With x = %d\0A\00"
define void @my_task(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello, world! With x = %d\0A\00"
define void @my_task(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  long long i = 1;
  i = i * 2 + 1;
  if (i != 3)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x3,-0x10(%rbp)
je     1159 <main+0x39>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 2
%5 = add nsw i64 %4, 1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int errno;
scalar_t__ futex(int *, int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_wait(int *address, int val) {
  return futex(address, FUTEX_WAIT, val, NULL, NULL, 0) ? errno : 0;
}


x86 assembly (clang, -O0):
<futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <futex@plt>
cmp    $0x0,%rax
je     115a <futex_wait+0x4a>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <futex_wait+0x54>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <futex_wait+0x54>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wait>:
push   %rbx
mov    %esi,%edx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <futex@plt>
test   %rax,%rax
je     1139 <futex_wait+0x29>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@FUTEX_WAIT = global i32 0
@errno = global i32 0
define i32 @futex_wait(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* @FUTEX_WAIT
%7 = load i32, i32* %4
%8 = call i64 @futex(i32* %5, i32 %6, i32 %7, i32* null, i32* null, i32 0)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @errno
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %10
%14 = phi i32 [ %11, %10 ], [ 0, %12 ]
ret i32 %14
}

LLVM IR (-O2):
@FUTEX_WAIT = global i32 0
@errno = global i32 0
define i32 @futex_wait(i32* %0, i32 %1) {
%3 = load i32, i32* @FUTEX_WAIT
%4 = tail call i64 @futex(i32* %0, i32 %3, i32 %1, i32* null, i32* null, i32 0)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* @errno
%7 = select i1 %5, i32 0, i32 %6
ret i32 %7
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int serial_close(int pi, unsigned handle) {
  return pigpio_command(pi, 77, handle, 0, 1);
}


x86 assembly (clang, -O0):
<serial_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x4d,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_close>:
mov    %esi,%edx
mov    $0x4d,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @serial_close(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 = call i32 @pigpio_command(i32 %5, i32 77, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @serial_close(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 77, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int setpriority(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ terminal_error(char *);
void set_nice(int prio) {
  if (setpriority(PRIO_PROCESS, 0, prio) == -1)
    terminal_error("setpriority");
}


x86 assembly (clang, -O0):
<set_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <setpriority@plt>
cmp    $0xffffffff,%eax
jne    1153 <set_nice+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <terminal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nice>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setpriority@plt>
cmp    $0xffffffff,%eax
je     113a <set_nice+0x1a>
pop    %rax
ret
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1040 <terminal_error@plt>

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

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
@.str = [12 x i8] c"setpriority\00"
define void @set_nice(i32 %0) {
%2 = load i32, i32* @PRIO_PROCESS
%3 = tail call i32 @setpriority(i32 %2, i32 0, i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @terminal_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cfree(void *ptr) { free(ptr); }


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

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

LLVM IR (-O0):
define void @cfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @cfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ f();
int /*<<< orphan*/ g();
int rec(int a) {
  int ret = 0;
  if (a > 10 && f())
    ret += rec(a - 1);
  g();
  return a + ret;
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    116e <rec+0x3e>
mov    $0x0,%al
call   1030 <f@plt>
cmp    $0x0,%rax
je     116e <rec+0x3e>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1050 <rec@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <g@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0xb,%edi
jl     1154 <rec+0x24>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <f@plt>
test   %rax,%rax
je     1154 <rec+0x24>
lea    -0x1(%rbx),%edi
call   1050 <rec@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <g@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 10
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = call i64 (...) @f()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = call i32 @rec(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %9, %6, %1
%16 = call i32 (...) @g()
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @rec(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = tail call i64 (...) @f()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = add nsw i32 %0, -1
%8 = tail call i32 @rec(i32 %7)
br label %9
9: ; preds = %6, %3, %1
%10 = phi i32 [ %8, %6 ], [ 0, %3 ], [ 0, %1 ]
%11 = tail call i32 (...) @g()
%12 = add nsw i32 %10, %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void prior_free_norm(void *data) { free(data); }


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

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

LLVM IR (-O0):
define void @prior_free_norm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @prior_free_norm(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR74_set(void) { return U_WMRCORENONE_set("U_WMR74"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR74\00"
define i8* @U_WMR74_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void unsigned_prune_gt(unsigned int x, unsigned int y) {
  if (x > 0) {
    unsigned int z = x - y;
  }
}


x86 assembly (clang, -O0):
<unsigned_prune_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    111d <unsigned_prune_gt+0x1d>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @unsigned_prune_gt(i32 %0, i32 %1) {
ret void
}
void exch(int *A, int *B) {
  int temp;
  temp = *A;
  *A = *B;
  *B = temp;
}


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

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

LLVM IR (-O0):
define void @exch(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @exch(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
typedef long long int64_t;

/* Variables and functions */
time_t FileTime2tt(int64_t winTime) {
  time_t tt;
  winTime -= 116444736000000000LL;
  winTime /= 10000000LL;
  tt = (time_t)winTime;
  return tt;
}


x86 assembly (clang, -O0):
<FileTime2tt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x19db1ded53e8000,%rcx
b1 9d 01
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x989680,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileTime2tt>:
movabs $0xfe624e212ac18000,%rcx
4e 62 fe
add    %rdi,%rcx
movabs $0xd6bf94d5e57a42bd,%rdx
94 bf d6
mov    %rcx,%rax
imul   %rdx
add    %rdx,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x17,%rcx
add    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @FileTime2tt(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sub nsw i64 %4, 116444736000000000
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = sdiv i64 %6, 10000000
store i64 %7, i64* %2
%8 = load i64, i64* %2
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @FileTime2tt(i64 %0) {
%2 = add nsw i64 %0, -116444736000000000
%3 = sdiv i64 %2, 10000000
ret i64 %3
}
int test_imm_3Buint16_reg(unsigned short val) {
  return ((val) & (-0x3B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Buint16_reg>:
test   $0xffc5,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Buint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -59
%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_3Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -59
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  int i = 1;
  return 2 + i + 2 - 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
add    $0x2,%eax
sub    $0x5,%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
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 2, %3
%5 = add nsw i32 %4, 2
%6 = sub nsw i32 %5, 5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ORA_();
int /*<<< orphan*/ c64_memZero();
void ORA_zpx(void) {
  c64_memZero();
  ORA_();
}


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

x86 assembly (clang, -O2):
<ORA_zpx>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memZero@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ORA_@plt>

LLVM IR (-O0):
define void @ORA_zpx() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @ORA_()
ret void
}

LLVM IR (-O2):
define void @ORA_zpx() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @ORA_()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/);
__m128 test_mm_castsi128_ps(__m128i A) { return _mm_castsi128_ps(A); }


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

x86 assembly (clang, -O2):
<test_mm_castsi128_ps>:
jmp    1030 <_mm_castsi128_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_castsi128_ps(i32 %0) {
%2 = tail call i32 @_mm_castsi128_ps(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int count_bits(unsigned long long);
int count_bits_between(uint64_t cstring, const int i, const int j) {
  cstring &= (((1ull << i) - 1) ^ ((2ull << j) - 1));
  cstring &= (((1ull << j) - 1) ^ ((2ull << i) - 1));
  return count_bits(cstring);
}


x86 assembly (clang, -O0):
<count_bits_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%ecx
mov    $0x2,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
xor    %rcx,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    -0xc(%rbp),%ecx
mov    $0x2,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
xor    %rcx,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits_between>:
mov    %edx,%r9d
mov    %esi,%r8d
mov    $0xffffffffffffffff,%r10
mov    %r8d,%ecx
shl    %cl,%r10
mov    $0xfffffffffffffffe,%rsi
mov    %r9d,%ecx
shl    %cl,%rsi
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
mov    $0xfffffffffffffffe,%rax
mov    %r8d,%ecx
shl    %cl,%rax
xor    %r10,%rsi
and    %rsi,%rdi
xor    %rdx,%rax
and    %rax,%rdi
jmp    1030 <count_bits@plt>

LLVM IR (-O0):
define i32 @count_bits_between(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = sub i64 %9, 1
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = shl i64 2, %12
%14 = sub i64 %13, 1
%15 = xor i64 %10, %14
%16 = load i64, i64* %4
%17 = and i64 %16, %15
store i64 %17, i64* %4
%18 = load i32, i32* %6
%19 = zext i32 %18 to i64
%20 = shl i64 1, %19
%21 = sub i64 %20, 1
%22 = load i32, i32* %5
%23 = zext i32 %22 to i64
%24 = shl i64 2, %23
%25 = sub i64 %24, 1
%26 = xor i64 %21, %25
%27 = load i64, i64* %4
%28 = and i64 %27, %26
store i64 %28, i64* %4
%29 = load i64, i64* %4
%30 = call i32 @count_bits(i64 %29)
ret i32 %30
}

LLVM IR (-O2):
define i32 @count_bits_between(i64 %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = shl nsw i64 -1, %4
%6 = zext i32 %2 to i64
%7 = shl i64 -2, %6
%8 = xor i64 %7, %5
%9 = and i64 %8, %0
%10 = shl nsw i64 -1, %6
%11 = shl i64 -2, %4
%12 = xor i64 %10, %11
%13 = and i64 %9, %12
%14 = tail call i32 @count_bits(i64 %13)
ret i32 %14
}
void ATI4200_Done() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ATI4200_Done() {
ret void
}
/* Variables and functions */
int _ilog(unsigned int v) {
  int ret = 0;
  while (v) {
    ret++;
    v >>= 1;
  }
  return (ret);
}


x86 assembly (clang, -O0):
<_ilog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <_ilog+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <_ilog+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ilog>:
xor    %eax,%eax
test   %edi,%edi
je     111c <_ilog+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <_ilog+0x10>
ret

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

LLVM IR (-O2):
define i32 @_ilog(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printhelp() {
  puts("Specify input ternary executable as first argument");
  puts("Valid options are: -dump -flow -reg");
}


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

x86 assembly (clang, -O2):
<printhelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Specify input ternary executable as first argument\00"
@.str.1 = [36 x i8] c"Valid options are: -dump -flow -reg\00"
define void @printhelp() {
%1 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Specify input ternary executable as first argument\00"
@.str.1 = [36 x i8] c"Valid options are: -dump -flow -reg\00"
define void @printhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void avcodec_receive_packet() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_receive_packet() {
ret void
}
void call_after_alloca_subr(char c, short s, int i, long l, unsigned char uc,
                            unsigned short us, unsigned int ui,
                            unsigned long ul) {
  c = 'a';
  i = 7;
  s = 8;
  l = 7;
  uc = 44;
  us = 77;
  ul = 43;
  ui = 33;
}


x86 assembly (clang, -O0):
<call_after_alloca_subr>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x2c(%rbp)
mov    %rcx,%rax
mov    -0x2c(%rbp),%ecx
mov    %rax,-0x28(%rbp)
mov    %edx,%eax
mov    -0x28(%rbp),%rdx
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    -0x1c(%rbp),%esi
mov    %eax,-0x18(%rbp)
mov    %edi,%r8d
mov    -0x18(%rbp),%edi
mov    %r9w,%ax
mov    0x18(%rbp),%r9
mov    0x10(%rbp),%r9d
mov    %r8b,-0x1(%rbp)
mov    %di,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
movb   $0x61,-0x1(%rbp)
movl   $0x7,-0x8(%rbp)
movw   $0x8,-0x4(%rbp)
movq   $0x7,-0x10(%rbp)
movb   $0x2c,-0x11(%rbp)
movw   $0x4d,-0x14(%rbp)
movq   $0x2b,0x18(%rbp)
movl   $0x21,0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call_after_alloca_subr(i8 signext %0, i16 signext %1, i32 %2, i64 %3, i8 zeroext %4, i16 zeroext %5, i32 %6, i64 %7) {
%9 = alloca i8
%10 = alloca i16
%11 = alloca i32
%12 = alloca i64
%13 = alloca i8
%14 = alloca i16
%15 = alloca i32
%16 = alloca i64
store i8 %0, i8* %9
store i16 %1, i16* %10
store i32 %2, i32* %11
store i64 %3, i64* %12
store i8 %4, i8* %13
store i16 %5, i16* %14
store i32 %6, i32* %15
store i64 %7, i64* %16
store i8 97, i8* %9
store i32 7, i32* %11
store i16 8, i16* %10
store i64 7, i64* %12
store i8 44, i8* %13
store i16 77, i16* %14
store i64 43, i64* %16
store i32 33, i32* %15
ret void
}

LLVM IR (-O2):
define void @call_after_alloca_subr(i8 signext %0, i16 signext %1, i32 %2, i64 %3, i8 zeroext %4, i16 zeroext %5, i32 %6, i64 %7) {
ret void
}