xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ send(int, char const *, int, int /*<<< orphan*/);
int strlen(char const *);
void jsend(const char *jcommand, int sock) {
  send(sock, jcommand, strlen(jcommand), 0);
  send(sock, "\r\n", 2, 0);
}


x86 assembly (clang, -O0):
<jsend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0xc(%rbp),%edi
lea    0xea0(%rip),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsend>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    0xebe(%rip),%rsi
mov    %ebp,%edi
mov    $0x2,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @jsend(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 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @send(i32 %5, i8* %6, i32 %8, i32 0)
%10 = load i32, i32* %4
%11 = call i32 @send(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @jsend(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @send(i32 %1, i8* %0, i32 %3, i32 0)
%5 = tail call i32 @send(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printmatwfile(double *, int, int, int, int /*<<< orphan*/ *);
void printmatfile(double *a, int m, int n, FILE *fff) {
  printmatwfile(a, m, n, 5, fff);
}


x86 assembly (clang, -O0):
<printmatfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x5,%ecx
call   1030 <printmatwfile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmatfile>:
mov    %rcx,%r8
mov    $0x5,%ecx
jmp    1030 <printmatwfile@plt>

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

LLVM IR (-O2):
define void @printmatfile(double* %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @printmatwfile(double* %0, i32 %1, i32 %2, i32 5, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ list_process(int /*<<< orphan*/);
int listprocess() {
  list_process(0);
  return 0;
}


x86 assembly (clang, -O0):
<listprocess>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <list_process@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<listprocess>:
push   %rax
xor    %edi,%edi
call   1030 <list_process@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @listprocess() {
%1 = call i32 @list_process(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @listprocess() {
%1 = tail call i32 @list_process(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x58() {
  Assert_real((iscntrl(88) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              445, ("iscntrl should be 0 for X"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x58>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1bd,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x58>:
push   %rax
mov    $0x58,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1bd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for X\00"
define void @t_iscntrl_0x58() {
%1 = call i64 @iscntrl(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for X\00"
define void @t_iscntrl_0x58() {
%1 = tail call i64 @iscntrl(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_73uint32_mem(unsigned int *val) {
  return ((*val) & (0x73 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_73uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 115
%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_73uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 115
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void move(no_of_disc, src_pole, dest_pole, temp_pole) {
  if (no_of_disc >= 1) {
    move(no_of_disc - 1, src_pole, temp_pole, dest_pole);
    printf("Move %d -> %d\n", src_pole, dest_pole);
    move(no_of_disc - 1, temp_pole, dest_pole, src_pole);
  }
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     117a <move+0x5a>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1040 <move@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1040 <move@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    116e <move+0x4e>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xec3(%rip),%r15
nopl   (%rax)
mov    %ecx,%r12d
lea    -0x2(%rbx),%edi
mov    %ebp,%esi
mov    %ecx,%edx
mov    %r14d,%ecx
call   1040 <move@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
mov    %ebp,%ecx
mov    %r12d,%ebp
cmp    $0x1,%ebx
ja     1140 <move+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Move %d -> %d\0A\00"
define void @move(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %13
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %3, %4 ]
%8 = phi i32 [ %7, %6 ], [ %1, %4 ]
%9 = phi i32 [ %10, %6 ], [ %0, %4 ]
%10 = add nsw i32 %9, -1
tail call void @move(i32 %10, i32 %8, i32 %7, i32 %2)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %2)
%12 = icmp ugt i32 %9, 1
br i1 %12, label %6, label %13
13: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_path(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void get_highscore_file_path(char file[512]) {
  char path[512];
  config_path(path);
  snprintf(file, 512, "%s/highscore.dat", path);
}


x86 assembly (clang, -O0):
<get_highscore_file_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <config_path@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rcx
mov    $0x200,%esi
lea    0xeae(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_highscore_file_path>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <config_path@plt>
lea    0xec1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %r14,%rcx
call   1040 <snprintf@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s/highscore.dat\00"
define void @get_highscore_file_path(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @config_path(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @snprintf(i8* %6, i32 512, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s/highscore.dat\00"
define void @get_highscore_file_path(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @config_path(i8* %3)
%5 = call i32 @snprintf(i8* %0, i32 512, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void millisleep(unsigned ms) { usleep(1000 * ms); }


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

x86 assembly (clang, -O2):
<millisleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @millisleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @millisleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ client_control_forward();
int get_control_line(int);
int /*<<< orphan*/ server_control_forward();
void run_proxy() {
  int i;
  do {
    i = get_control_line(3);
    if (i & 1)
      client_control_forward();
    if (i & 2)
      server_control_forward();
  } while (1);
}


x86 assembly (clang, -O0):
<run_proxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1040 <get_control_line@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     115b <run_proxy+0x2b>
mov    $0x0,%al
call   1030 <client_control_forward@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1171 <run_proxy+0x41>
mov    $0x0,%al
call   1050 <server_control_forward@plt>
jmp    1176 <run_proxy+0x46>
mov    $0x1,%al
test   $0x1,%al
jne    1138 <run_proxy+0x8>
jmp    1185 <run_proxy+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_proxy>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3,%edi
call   1040 <get_control_line@plt>
mov    %eax,%ebx
test   $0x1,%bl
je     1158 <run_proxy+0x28>
xor    %eax,%eax
call   1030 <client_control_forward@plt>
test   $0x2,%bl
je     1140 <run_proxy+0x10>
xor    %eax,%eax
call   1050 <server_control_forward@plt>
jmp    1140 <run_proxy+0x10>

LLVM IR (-O0):
define void @run_proxy() {
%1 = alloca i32
br label %2
2: ; preds = %16, %0
%3 = call i32 @get_control_line(i32 3)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @client_control_forward()
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %1
%11 = and i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @server_control_forward()
br label %15
15: ; preds = %13, %9
br label %16
16: ; preds = %15
br i1 true, label %2, label %17
17: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @run_proxy() {
br label %1
1: ; preds = %10, %0
%2 = tail call i32 @get_control_line(i32 3)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @client_control_forward()
br label %7
7: ; preds = %5, %1
%8 = and i32 %2, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %11
br label %1
11: ; preds = %7
%12 = tail call i32 (...) @server_control_forward()
br label %10
}
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *getlogin() {
  static char userid[9];
  struct passwd *pw_entry;
  pw_entry = getpwuid(getuid());
  if (pw_entry == (struct passwd *)NULL)
    return ((char *)NULL);
  strcpy(userid, pw_entry->pw_name);
  return (userid);
}


x86 assembly (clang, -O0):
<getlogin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <getlogin+0x32>
movq   $0x0,-0x8(%rbp)
jmp    117f <getlogin+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0x2eca(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2ebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
test   %rax,%rax
je     1157 <getlogin+0x27>
mov    (%rax),%esi
lea    0x2eea(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@getlogin.userid = internal global [9 x i8] zeroinitializer
define i8* @getlogin() {
%1 = alloca i8*
%2 = alloca %struct.passwd*
%3 = call i32 (...) @getuid()
%4 = call %struct.passwd* @getpwuid(i32 %3)
store %struct.passwd* %4, %struct.passwd** %2
%5 = load %struct.passwd*, %struct.passwd** %2
%6 = icmp eq %struct.passwd* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
store i8* null, i8** %1
br label %13
8: ; preds = %0
%9 = load %struct.passwd*, %struct.passwd** %2
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @strcpy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getlogin.userid, i64 0, i64 0), i32 %11)
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getlogin.userid, i64 0, i64 0), i8** %1
br label %13
13: ; preds = %8, %7
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@getlogin.userid = internal global [9 x i8] zeroinitializer
define i8* @getlogin() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @strcpy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getlogin.userid, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %0, %4
%9 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @getlogin.userid, i64 0, i64 0), %4 ], [ null, %0 ]
ret i8* %9
}
/* Variables and functions */
int cos(float);
float torsion(float phi, float V2, float n_fold, float gamma) {
  float e;
  e = V2 * (1. + cos(n_fold * phi - gamma));
  return e;
}


x86 assembly (clang, -O0):
<torsion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  0xe8c(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<torsion>:
push   %rax
cvtss2sd %xmm1,%xmm1
movsd  %xmm1,(%rsp)
mulss  %xmm2,%xmm0
subss  %xmm3,%xmm0
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xeca(%rip),%xmm0
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @torsion(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = load float, float* %7
%13 = load float, float* %5
%14 = load float, float* %8
%15 = fneg float %14
%16 = call float @llvm.fmuladd.f32(float %12, float %13, float %15)
%17 = call i32 @cos(float %16)
%18 = sitofp i32 %17 to double
%19 = fadd double 1.000000e+00, %18
%20 = fmul double %11, %19
%21 = fptrunc double %20 to float
store float %21, float* %9
%22 = load float, float* %9
ret float %22
}

LLVM IR (-O2):
define float @torsion(float %0, float %1, float %2, float %3) {
%5 = fpext float %1 to double
%6 = fneg float %3
%7 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %6)
%8 = tail call i32 @cos(float %7)
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.000000e+00
%11 = fmul double %10, %5
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
char **Cvar_CompleteBuildListWithFlag(char const *, int);
char **Cvar_CompleteBuildListUser(const char *partial) {
  return Cvar_CompleteBuildListWithFlag(partial, 2);
}


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

x86 assembly (clang, -O2):
<Cvar_CompleteBuildListUser>:
mov    $0x2,%esi
jmp    1030 <Cvar_CompleteBuildListWithFlag@plt>

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

LLVM IR (-O2):
define i8** @Cvar_CompleteBuildListUser(i8* %0) {
%2 = tail call i8** @Cvar_CompleteBuildListWithFlag(i8* %0, i32 2)
ret i8** %2
}
unsigned long mpc_ceil_log2(unsigned long d) {
  unsigned long exp;
  for (exp = 0; d > 1; d = (d + 1) / 2)
    exp++;
  return exp;
}


x86 assembly (clang, -O0):
<mpc_ceil_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jbe    113c <mpc_ceil_log2+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <mpc_ceil_log2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc_ceil_log2>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     1127 <mpc_ceil_log2+0x27>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0x1,%rdi
mov    %rdi,%rcx
shr    %rcx
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <mpc_ceil_log2+0x10>
ret

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

LLVM IR (-O2):
define i64 @mpc_ceil_log2(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = add i64 %4, 1
%7 = add i64 %5, 1
%8 = lshr i64 %7, 1
%9 = icmp ugt i64 %7, 3
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %11
}
/* Variables and functions */
scalar_t__ intcmp(char *, char *);
int binary_ne(char *s1, char *s2) { return intcmp(s1, s2) != 0; }


x86 assembly (clang, -O0):
<binary_ne>:
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 <intcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_ne>:
push   %rax
call   1030 <intcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @binary_ne(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 i64 @intcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @binary_ne(i8* %0, i8* %1) {
%3 = tail call i64 @intcmp(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_Deque_append();
int /*<<< orphan*/ test_Deque_basics();
int /*<<< orphan*/ test_Deque_erase();
int /*<<< orphan*/ test_Deque_erase_2();
int /*<<< orphan*/ test_Deque_front_back();
int /*<<< orphan*/ test_Deque_insert();
int /*<<< orphan*/ test_Deque_insert_2();
void test_Deque(void) {
  test_Deque_basics();
  test_Deque_append();
  test_Deque_insert();
  test_Deque_insert_2();
  test_Deque_erase();
  test_Deque_erase_2();
  test_Deque_front_back();
}


x86 assembly (clang, -O0):
<test_Deque>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <test_Deque_basics@plt>
mov    $0x0,%al
call   1030 <test_Deque_append@plt>
mov    $0x0,%al
call   1060 <test_Deque_insert@plt>
mov    $0x0,%al
call   1080 <test_Deque_insert_2@plt>
mov    $0x0,%al
call   1050 <test_Deque_erase@plt>
mov    $0x0,%al
call   1040 <test_Deque_erase_2@plt>
mov    $0x0,%al
call   1070 <test_Deque_front_back@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Deque>:
push   %rax
xor    %eax,%eax
call   1090 <test_Deque_basics@plt>
xor    %eax,%eax
call   1030 <test_Deque_append@plt>
xor    %eax,%eax
call   1060 <test_Deque_insert@plt>
xor    %eax,%eax
call   1080 <test_Deque_insert_2@plt>
xor    %eax,%eax
call   1050 <test_Deque_erase@plt>
xor    %eax,%eax
call   1040 <test_Deque_erase_2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <test_Deque_front_back@plt>

LLVM IR (-O0):
define void @test_Deque() {
%1 = call i32 (...) @test_Deque_basics()
%2 = call i32 (...) @test_Deque_append()
%3 = call i32 (...) @test_Deque_insert()
%4 = call i32 (...) @test_Deque_insert_2()
%5 = call i32 (...) @test_Deque_erase()
%6 = call i32 (...) @test_Deque_erase_2()
%7 = call i32 (...) @test_Deque_front_back()
ret void
}

LLVM IR (-O2):
define void @test_Deque() {
%1 = tail call i32 (...) @test_Deque_basics()
%2 = tail call i32 (...) @test_Deque_append()
%3 = tail call i32 (...) @test_Deque_insert()
%4 = tail call i32 (...) @test_Deque_insert_2()
%5 = tail call i32 (...) @test_Deque_erase()
%6 = tail call i32 (...) @test_Deque_erase_2()
%7 = tail call i32 (...) @test_Deque_front_back()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 10;
  printf("Hello World: %d!\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
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    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Hello World: %d!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
char **my_str_to_wordtab(char *, char);
char *path(char **);
char **check_path(char **env) {
  char *str;
  char **tab;
  if ((str = malloc(sizeof(char) * 4096)) == NULL)
    return (0);
  if ((str = path(env)) == 0)
    return (0);
  else
    tab = my_str_to_wordtab(str, ':');
  free(str);
  return (tab);
}


x86 assembly (clang, -O0):
<check_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1000,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1171 <check_path+0x31>
movq   $0x0,-0x8(%rbp)
jmp    11b8 <check_path+0x78>
mov    -0x10(%rbp),%rdi
call   1050 <path@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1195 <check_path+0x55>
movq   $0x0,-0x8(%rbp)
jmp    11b8 <check_path+0x78>
mov    -0x18(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <my_str_to_wordtab@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_path>:
push   %r14
push   %rbx
push   %rax
call   1050 <path@plt>
test   %rax,%rax
je     115e <check_path+0x2e>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3a,%esi
call   1040 <my_str_to_wordtab@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1160 <check_path+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @check_path(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8**
store i8** %0, i8*** %3
%6 = call i8* @malloc(i32 4096)
store i8* %6, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8** null, i8*** %2
br label %21
9: ; preds = %1
%10 = load i8**, i8*** %3
%11 = call i8* @path(i8** %10)
store i8* %11, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %9
store i8** null, i8*** %2
br label %21
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = call i8** @my_str_to_wordtab(i8* %15, i8 signext 58)
store i8** %16, i8*** %5
br label %17
17: ; preds = %14
%18 = load i8*, i8** %4
%19 = call i32 @free(i8* %18)
%20 = load i8**, i8*** %5
store i8** %20, i8*** %2
br label %21
21: ; preds = %17, %13, %8
%22 = load i8**, i8*** %2
ret i8** %22
}

LLVM IR (-O2):
define i8** @check_path(i8** %0) {
%2 = tail call i8* @path(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8** @my_str_to_wordtab(i8* %2, i8 signext 58)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i8** [ %5, %4 ], [ null, %1 ]
ret i8** %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf(argv[1]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
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 @printf(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void matrix_copy(double **Y, double **X, int n, int m) {
  memcpy(Y[0], X[0], n * m * sizeof(double));
}


x86 assembly (clang, -O0):
<matrix_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_copy>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
imul   %ecx,%edx
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @matrix_copy(double** %0, double** %1, i32 %2, i32 %3) {
%5 = alloca double**
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
store double** %0, double*** %5
store double** %1, double*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double**, double*** %5
%10 = getelementptr inbounds double*, double** %9, i64 0
%11 = load double*, double** %10
%12 = load double**, double*** %6
%13 = getelementptr inbounds double*, double** %12, i64 0
%14 = load double*, double** %13
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = mul nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
%21 = call i32 @memcpy(double* %11, double* %14, i32 %20)
ret void
}

LLVM IR (-O2):
define void @matrix_copy(double** nocapture %0, double** nocapture %1, i32 %2, i32 %3) {
%5 = load double*, double** %0
%6 = load double*, double** %1
%7 = shl i32 %2, 3
%8 = mul i32 %7, %3
%9 = tail call i32 @memcpy(double* %5, double* %6, i32 %8)
ret void
}
int main() {
  int a = 0;
  int i = 0;
  for (; i < 10; i++) {
    a++;
  }
  if (a != i || i != 10) {
    goto ERROR;
  }
  return 0;
ERROR:
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1150 <main+0x50>
cmpl   $0xa,-0xc(%rbp)
je     1155 <main+0x55>
jmp    1161 <main+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1168 <main+0x68>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%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
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp ne i32 %14, %15
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 10
br i1 %19, label %20, label %21
20: ; preds = %17, %13
br label %22
21: ; preds = %17
store i32 0, i32* %1
br label %23
22: ; preds = %20
store i32 -1, i32* %1
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Qt_setColor(char *, int, int, int, int);
void Qt_setColorScale(char *widget, int r, int g, int b, int alpha) {
  (void)(widget);
  Qt_setColor("scaleColor", r, g, b, alpha);
}


x86 assembly (clang, -O0):
<Qt_setColorScale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xec3(%rip),%rdi
call   1030 <Qt_setColor@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"scaleColor\00"
define void @Qt_setColorScale(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @Qt_setColor(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"scaleColor\00"
define void @Qt_setColorScale(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @Qt_setColor(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
int test_imm_D4int8_mem(signed char *val) {
  return ((*val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D4int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -44
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void commit_discard_idcache(void) {}


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

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

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

LLVM IR (-O2):
define void @commit_discard_idcache() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  pid_t pid;
  pid = getpid();
  printf("pid = %d\n", pid);
  sleep(60);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3c,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pid = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getpid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sleep(i32 60)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"pid = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 60)
ret i32 0
}
/* Variables and functions */
int printf(char *, char const *);
int notify(int player, const char *msg) {
  (void)player;
  return printf("%s\n", msg);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @notify(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @notify(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_nl();
int /*<<< orphan*/ print_str(char *);
int /*<<< orphan*/ print_uptr(void *);
void print_uptr_nl(char *s, void *v) {
  print_str(s);
  print_uptr(v);
  print_nl();
}


x86 assembly (clang, -O0):
<print_uptr_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <print_str@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print_uptr@plt>
mov    $0x0,%al
call   1030 <print_nl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uptr_nl>:
push   %rbx
mov    %rsi,%rbx
call   1040 <print_str@plt>
mov    %rbx,%rdi
call   1050 <print_uptr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <print_nl@plt>

LLVM IR (-O0):
define void @print_uptr_nl(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 = call i32 @print_str(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @print_uptr(i8* %7)
%9 = call i32 (...) @print_nl()
ret void
}

LLVM IR (-O2):
define void @print_uptr_nl(i8* %0, i8* %1) {
%3 = tail call i32 @print_str(i8* %0)
%4 = tail call i32 @print_uptr(i8* %1)
%5 = tail call i32 (...) @print_nl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc14(void) {
  printf("Executing exitfunc14.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc14>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc14>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc14.\0A\00"
define void @exitfunc14() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc14.\00"
define void @exitfunc14() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  int array1[1] = {1};
  int array2[2][1] = {{1}, {0}};
  if (array1[0] != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1154 <main+0x34>
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):
@__const.main.array1 = [1 x i32] [i32 1]
@__const.main.array2 = [2 x [1 x i32]] [[1 x i32] [i32 1], [1 x i32] zeroinitializer]
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca [2 x [1 x i32]]
store i32 0, i32* %1
%4 = bitcast [1 x i32]* %2 to i8*
%5 = bitcast [2 x [1 x i32]]* %3 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *strdup(char const *);
char *strdupx(const char *str) {
  if (!str)
    return NULL;
  return strdup(str);
}


x86 assembly (clang, -O0):
<strdupx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strdupx+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <strdupx+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupx>:
test   %rdi,%rdi
je     111a <strdupx+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strdupx(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @strdupx(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
char *string_escape_character_array(char *, char *, char *);
char *string_escape_quote_dollar(char *destination, char *source) {
  return string_escape_character_array(destination, source, "$'");
}


x86 assembly (clang, -O0):
<string_escape_quote_dollar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <string_escape_character_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_escape_quote_dollar>:
lea    0xee9(%rip),%rdx
jmp    1030 <string_escape_character_array@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"$'\00"
define i8* @string_escape_quote_dollar(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 i8* @string_escape_character_array(i8* %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"$'\00"
define i8* @string_escape_quote_dollar(i8* %0, i8* %1) {
%3 = tail call i8* @string_escape_character_array(i8* %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int BIT(int);
int wpa_key_mgmt_sae(int akm) { return !!(akm & (BIT(10) | BIT(11))); }


x86 assembly (clang, -O0):
<wpa_key_mgmt_sae>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <BIT@plt>
mov    %eax,-0xc(%rbp)
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
or     %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_sae>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0xb,%edi
call   1030 <BIT@plt>
or     %ebp,%eax
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_sae(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 10)
%5 = call i32 @BIT(i32 11)
%6 = or i32 %4, %5
%7 = and i32 %3, %6
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_sae(i32 %0) {
%2 = tail call i32 @BIT(i32 10)
%3 = tail call i32 @BIT(i32 11)
%4 = or i32 %3, %2
%5 = and i32 %4, %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}