xunge/DecIR huggingface dataset:
/* Variables and functions */
int test1();
int test2();
int main() {
  int rc = 0;
  rc |= test1();
  rc |= test2();
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test1@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test2@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <test1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <test2@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test1()
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @test2()
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = or i32 %2, %1
ret i32 %3
}
__attribute__((weak)) void midi_clock_run_state_changed(int running) {}


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

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

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

LLVM IR (-O2):
define weak void @midi_clock_run_state_changed(i32 %0) {
ret void
}
/* Variables and functions */
unsigned char *flag_table_3_3_location(unsigned char **);
int set_flag_table_3_3(unsigned char **sec, unsigned int flag) {
  unsigned char *p;
  p = flag_table_3_3_location(sec);
  if (p == NULL)
    return 1;
  *p = flag;
  return 0;
}


x86 assembly (clang, -O0):
<set_flag_table_3_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <flag_table_3_3_location@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <set_flag_table_3_3+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1155 <set_flag_table_3_3+0x45>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flag_table_3_3>:
push   %rbx
mov    %esi,%ebx
call   1030 <flag_table_3_3_location@plt>
test   %rax,%rax
je     1123 <set_flag_table_3_3+0x13>
mov    %bl,(%rax)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @set_flag_table_3_3(i8** %0, i32 %1) {
%3 = tail call i8* @flag_table_3_3_location(i8** %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
store i8 %6, i8* %3
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ executeSQLCommand(int /*<<< orphan*/ *, char *);
void listUsers(sqlite3 *db) {
  executeSQLCommand(db, "Select Username From Database Order by Username;");
}


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

x86 assembly (clang, -O2):
<listUsers>:
lea    0xee9(%rip),%rsi
jmp    1030 <executeSQLCommand@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Select Username From Database Order by Username;\00"
define void @listUsers(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @executeSQLCommand(i32* %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Select Username From Database Order by Username;\00"
define void @listUsers(i32* %0) {
%2 = tail call i32 @executeSQLCommand(i32* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_int_equals(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ parse_long(char *);
void test_parse_kilobytes(void) {
  __assert_int_equals("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/headius/jato/refs/"
                      "heads/master/test/unit/vm/parse-test.c",
                      18, (64 * 1024), (parse_long("64k")));
}


x86 assembly (clang, -O0):
<test_parse_kilobytes>:
push   %rbp
mov    %rsp,%rbp
lea    0xf68(%rip),%rdi
call   1030 <parse_long@plt>
mov    %eax,%ecx
lea    0xec7(%rip),%rdi
mov    $0x12,%esi
mov    $0x10000,%edx
call   1040 <__assert_int_equals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_parse_kilobytes>:
push   %rax
lea    0xf6b(%rip),%rdi
call   1030 <parse_long@plt>
lea    0xecc(%rip),%rdi
mov    $0x12,%esi
mov    $0x10000,%edx
mov    %eax,%ecx
pop    %rax
jmp    1040 <__assert_int_equals@plt>

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/parse-test.c\00"
@.str.1 = [4 x i8] c"64k\00"
define void @test_parse_kilobytes() {
%1 = call i32 @parse_long(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @__assert_int_equals(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 18, i32 65536, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/parse-test.c\00"
@.str.1 = [4 x i8] c"64k\00"
define void @test_parse_kilobytes() {
%1 = tail call i32 @parse_long(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @__assert_int_equals(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 18, i32 65536, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ chroot(char *);
int main(void) {
  if (chroot("/") < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <chroot@plt>
cmp    $0x0,%rax
jge    1141 <main+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <main+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <chroot@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @main() {
%1 = tail call i64 @chroot(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int iscompress) {
  if (iscompress)
    (void)fprintf(stderr, "usage: compress [-cdfv] [-b bits] [file ...]\n");
  else
    (void)fprintf(stderr, "usage: uncompress [-cdfv] [-b bits] [file ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <usage+0x2f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1164 <usage+0x44>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
test   %edi,%edi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xefb(%rip),%rax
lea    0xec6(%rip),%rsi
cmove  %rax,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"usage: compress [-cdfv] [-b bits] [file ...]\0A\00"
@.str.1 = [48 x i8] c"usage: uncompress [-cdfv] [-b bits] [file ...]\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: compress [-cdfv] [-b bits] [file ...]\0A\00"
@.str.1 = [48 x i8] c"usage: uncompress [-cdfv] [-b bits] [file ...]\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = select i1 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @fprintf(i32 %3, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int HLT(int inst_actual, int dir, int I) { return -1; }


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

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

LLVM IR (-O0):
define i32 @HLT(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @HLT(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
mysysex(leng, mess) int leng;
char *mess;
{
  prtime();
  printf("SysEx");
  prhex(mess, leng);
}


x86 assembly (clang, -O0):
<mysysex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <prtime@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <prhex@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysysex>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <prtime@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <prhex@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"SysEx\00"
define i32 @mysysex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = call i32 (...) @prtime()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @prhex to i32 (i8*, i32, ...)*)(i8* %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"SysEx\00"
define i32 @mysysex(i32 %0, i8* %1) {
%3 = tail call i32 (...) @prtime()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @prhex to i32 (i8*, i32, ...)*)(i8* %1, i32 %0)
ret i32 undef
}
struct pt_sandbox *ptrace_sandbox_alloc() {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pt_sandbox = type opaque
define %struct.pt_sandbox* @ptrace_sandbox_alloc() {
ret %struct.pt_sandbox* null
}

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define noalias %struct.pt_sandbox* @ptrace_sandbox_alloc() {
ret %struct.pt_sandbox* null
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *getCopy(const char *str) {
  char *new = (char *)malloc(strlen(str) + 1);
  strcpy(new, str);
  return new;
}


x86 assembly (clang, -O0):
<getCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getCopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @getCopy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
uint8_t direct_read8(volatile uint8_t *addr) { return *addr; }


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

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

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

LLVM IR (-O2):
define i32 @direct_read8(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
float *g() {
  float *a = (float *)malloc(2 * sizeof(float));
  a[0] = 1.0;
  a[1] = 1.1;
  return a;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xed2(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xebe(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0x3f8ccccd3f800000,%rcx
cc 8c 3f
mov    %rcx,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define float* @g() {
%1 = alloca float*
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to float*
store float* %3, float** %1
%4 = load float*, float** %1
%5 = getelementptr inbounds float, float* %4, i64 0
store float 1.000000e+00, float* %5
%6 = load float*, float** %1
%7 = getelementptr inbounds float, float* %6, i64 1
store float 0x3FF19999A0000000, float* %7
%8 = load float*, float** %1
ret float* %8
}

LLVM IR (-O2):
define float* @g() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to float*
store float 1.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %2, i64 1
store float 0x3FF19999A0000000, float* %3
ret float* %2
}
void disable_kernel_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_kernel_fp() {
ret void
}
void f(__attribute__((type_annotate("tainted"))) int p) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
void gtk_clipboard_wait_is_text_available() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_wait_is_text_available() {
ret void
}
void macpart_fix_string(char *stg, int len) {
  int i;
  for (i = len - 1; i >= 0 && stg[i] == ' '; i--)
    stg[i] = 0;
}


x86 assembly (clang, -O0):
<macpart_fix_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jl     1138 <macpart_fix_string+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <macpart_fix_string+0x48>
jmp    1162 <macpart_fix_string+0x62>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <macpart_fix_string+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<macpart_fix_string>:
test   %esi,%esi
jle    1127 <macpart_fix_string+0x27>
mov    %esi,%eax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rax),%ecx
cmpb   $0x20,(%rdi,%rcx,1)
jne    1127 <macpart_fix_string+0x27>
movb   $0x0,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1110 <macpart_fix_string+0x10>
ret

LLVM IR (-O0):
define void @macpart_fix_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br label %19
19: ; preds = %11, %8
%20 = phi i1 [ false, %8 ], [ %18, %11 ]
br i1 %20, label %21, label %29
21: ; preds = %19
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %21
%27 = load i32, i32* %5
%28 = add nsw i32 %27, -1
store i32 %28, i32* %5
br label %8
29: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @macpart_fix_string(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %5, %4 ], [ %8, %13 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %6
store i8 0, i8* %10
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %13, %2
ret void
}
int test_imm_02int8_mem(signed char *val) {
  return ((*val) & (0x02 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_02int8_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, 2
%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_02int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 2
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void transferusage() {
  printf("clitent $path-to-file-will-be-translated "
         "$path-storename-in-serverside $server-ip $server-port \n"
         "$path-to-file-will-be-translated : absolute path of file that will "
         "be transed \n"
         "$path-storename-in-serverside : if the server receive the content, "
         "where and by which name it will be stored \n"
         "$server-ip : internet address of the server listen on given port "
         "that will receiving the data \n"
         "$server-port : internet address port \n");
}


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

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

LLVM IR (-O0):
@.str = [419 x i8] c"clitent $path-to-file-will-be-translated $path-storename-in-serverside $server-ip $server-port \0A$path-to-file-will-be-translated : absolute path of file that will be transed \0A$path-storename-in-serverside : if the server receive the content, where and by which name it will be stored \0A$server-ip : internet address of the server listen on given port that will receiving the data \0A$server-port : internet address port \0A\00"
define void @transferusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([419 x i8], [419 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [418 x i8] c"clitent $path-to-file-will-be-translated $path-storename-in-serverside $server-ip $server-port \0A$path-to-file-will-be-translated : absolute path of file that will be transed \0A$path-storename-in-serverside : if the server receive the content, where and by which name it will be stored \0A$server-ip : internet address of the server listen on given port that will receiving the data \0A$server-port : internet address port \00"
define void @transferusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([418 x i8], [418 x i8]* @str, i64 0, i64 0))
ret void
}
const char *ajResourceinTypeGetQlinks(void) { return "|"; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
define i8* @ajResourceinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_textcopyfunc(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_textcopyfunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_textcopyfunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
main() { echo("Cau"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"Cau\00"
define i32 @main() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CONSOL_SendCh(int /*<<< orphan*/);
void CONSOL_SendString(char *pbString) {
  while (*pbString)
    CONSOL_SendCh(*pbString++);
}


x86 assembly (clang, -O0):
<CONSOL_SendString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <CONSOL_SendString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <CONSOL_SendCh@plt>
jmp    111c <CONSOL_SendString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONSOL_SendString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <CONSOL_SendString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <CONSOL_SendCh@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <CONSOL_SendString+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @CONSOL_SendString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @CONSOL_SendCh(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @CONSOL_SendString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @CONSOL_SendCh(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int n, n2, n3;
  n = 5;
  n2 = n * n;
  n3 = n2 * n;
  printf("n = %d, n squared = %d, n cubed = %d\n", n, n2, n3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb6(%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    $0x5,%esi
mov    $0x19,%edx
mov    $0x7d,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [38 x i8] c"n = %d, n squared = %d, n cubed = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 5, i32 25, i32 125)
ret i32 0
}
/* Variables and functions */
int getopt_internal(int, char *const *, char const *, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *, int /*<<< orphan*/);
int pkg_getopt(int nargc, char *const *nargv, const char *options) {
  return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
}


x86 assembly (clang, -O0):
<pkg_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkg_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <getopt_internal@plt>

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

LLVM IR (-O2):
define i32 @pkg_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, i32* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
double pow(double, double);
double from_linear(double c) {
  if (c <= 0.0031308)
    return 12.92 * c;
  else
    return 1.055 * pow(c, 1.0 / 2.4) - 0.055;
}


x86 assembly (clang, -O0):
<from_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1147 <from_linear+0x37>
movsd  0xee8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <from_linear+0x66>
movsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xea7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_linear>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113e <from_linear+0x2e>
movsd  0xee9(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee4(%rip),%xmm0
addsd  0xee4(%rip),%xmm0
pop    %rax
ret
mulsd  0xec2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @from_linear(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 3.130800e-03
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double 1.292000e+01, %7
store double %8, double* %2
br label %13
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @pow(double %10, double 0x3FDAAAAAAAAAAAAB)
%12 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %11, double -5.500000e-02)
store double %12, double* %2
br label %13
13: ; preds = %9, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @from_linear(double %0) {
%2 = fcmp ugt double %0, 3.130800e-03
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fmul double %0, 1.292000e+01
br label %8
5: ; preds = %1
%6 = tail call double @pow(double %0, double 0x3FDAAAAAAAAAAAAB)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.055000e+00, double -5.500000e-02)
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ rul___emit_decr_indent();
int /*<<< orphan*/ rul___emit_eos_and_newline();
void rul__emit_stack_tmp_end(void) {
  rul___emit_decr_indent();
  rul___emit_decr_indent();
  rul___emit_eos_and_newline();
}


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

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

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

LLVM IR (-O2):
define void @rul__emit_stack_tmp_end() {
%1 = tail call i32 (...) @rul___emit_decr_indent()
%2 = tail call i32 (...) @rul___emit_decr_indent()
%3 = tail call i32 (...) @rul___emit_eos_and_newline()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ed_swap_4(uint32_t v) {
  v = ((v & 0x0000FFFFU) << 16) | (v >> 16);
  return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8);
}


x86 assembly (clang, -O0):
<ed_swap_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ed_swap_4>:
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @ed_swap_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 16711935
%11 = shl i32 %10, 8
%12 = load i32, i32* %2
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ed_swap_4(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %0, 16
%4 = or i32 %2, %3
%5 = shl i32 %4, 8
%6 = and i32 %5, -16711936
%7 = lshr i32 %4, 8
%8 = and i32 %7, 16711935
%9 = or i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int test_functions(void) {
  char buf[100];
  char *message = "I'M THE BOSS\n";
  puts("something something");
  printf("whatever whatever\n");
  gets(buf);
  puts(buf);
  _exit(0);
  return 2;
}


x86 assembly (clang, -O0):
<test_functions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xeae(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb9(%rip),%rdi
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<test_functions>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"I'M THE BOSS\0A\00"
@.str.1 = [20 x i8] c"something something\00"
@.str.2 = [19 x i8] c"whatever whatever\0A\00"
define i32 @test_functions() {
%1 = alloca [100 x i8]
%2 = alloca i8*
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"something something\00"
@str = [18 x i8] c"whatever whatever\00"
define i32 @test_functions() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = call i32 @gets(i8* %2)
%6 = call i32 @puts(i8* %2)
%7 = call i32 @_exit(i32 0)
unreachable
}
void jerasure_free_schedule(int **schedule) {
  int i;
  for (i = 0; schedule[i][0] >= 0; i++)
    free(schedule[i]);
  free(schedule[i]);
  free(schedule);
}


x86 assembly (clang, -O0):
<jerasure_free_schedule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmpl   $0x0,(%rax)
jl     1157 <jerasure_free_schedule+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <jerasure_free_schedule+0x13>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jerasure_free_schedule>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
cmpl   $0x0,(%rdi)
js     1141 <jerasure_free_schedule+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
cmpl   $0x0,(%rdi)
jns    1130 <jerasure_free_schedule+0x20>
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @jerasure_free_schedule(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %14
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i32* [ %11, %5 ], [ %2, %1 ]
%8 = bitcast i32* %7 to i8*
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, -1
br i1 %13, label %5, label %14
14: ; preds = %5, %1
%15 = phi i32* [ %2, %1 ], [ %11, %5 ]
%16 = bitcast i32* %15 to i8*
tail call void @free(i8* %16)
%17 = bitcast i32** %0 to i8*
tail call void @free(i8* %17)
ret void
}
/* Variables and functions */
double floor(double);
double ceil(double x) { return floor(x) + 1; }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  0xed1(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
call   1030 <floor@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
%5 = fadd double %4, 1.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
struct vec2i {
  int dummy;
};
struct vec2 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_assign_vec2(int /*<<< orphan*/ *, float *);
__attribute__((always_)) struct vec2i *psvec2i_assign_vec2(struct vec2i *result,
                                                           struct vec2 *a) {
  vec2i_assign_vec2((int32_t *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec2i_assign_vec2>:
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 <vec2i_assign_vec2@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2i_assign_vec2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_assign_vec2@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
%struct.vec2 = type { i32 }
define %struct.vec2i* @psvec2i_assign_vec2(%struct.vec2i* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2i*
%4 = alloca %struct.vec2*
store %struct.vec2i* %0, %struct.vec2i** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2i*, %struct.vec2i** %3
%6 = bitcast %struct.vec2i* %5 to i32*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call i32 @vec2i_assign_vec2(i32* %6, float* %8)
%10 = load %struct.vec2i*, %struct.vec2i** %3
ret %struct.vec2i* %10
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
%struct.vec2 = type { i32 }
define %struct.vec2i* @psvec2i_assign_vec2(%struct.vec2i* returned %0, %struct.vec2* %1) {
%3 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call i32 @vec2i_assign_vec2(i32* %3, float* %4)
ret %struct.vec2i* %0
}
/* Variables and functions */
int MS_INVALIDATE;
int MS_SYNC;
int msync(void *, size_t, int);
int sync_shm(void *ptr, size_t size) {
  return msync(ptr, size, MS_SYNC | MS_INVALIDATE);
}


x86 assembly (clang, -O0):
<sync_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
or     (%rax),%edx
call   1030 <msync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_shm>:
mov    0x2ec1(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
jmp    1030 <msync@plt>

LLVM IR (-O0):
@MS_SYNC = global i32 0
@MS_INVALIDATE = global i32 0
define i32 @sync_shm(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @MS_SYNC
%8 = load i32, i32* @MS_INVALIDATE
%9 = or i32 %7, %8
%10 = call i32 @msync(i8* %5, i64 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@MS_SYNC = global i32 0
@MS_INVALIDATE = global i32 0
define i32 @sync_shm(i8* %0, i64 %1) {
%3 = load i32, i32* @MS_SYNC
%4 = load i32, i32* @MS_INVALIDATE
%5 = or i32 %4, %3
%6 = tail call i32 @msync(i8* %0, i64 %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main(int argc, char *argv[]) { _exit(1); }


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    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

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 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ squares();
int main() { squares(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @squares()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @squares()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long sum(int);
int main() {
  unsigned long temp = sum(2000000);
  printf("%lu\n", temp);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e8480,%edi
call   1040 <sum@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i64 @sum(i32 2000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Type definitions */
struct winsize {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
scalar_t__ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
void resize_pty(int pty) {
  struct winsize sz;
  if (ioctl(0, TIOCGWINSZ, &sz) < 0)
    return;
}


x86 assembly (clang, -O0):
<resize_pty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    113e <resize_pty+0x2e>
jmp    113e <resize_pty+0x2e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_pty>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define void @resize_pty(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.winsize
store i32 %0, i32* %2
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i64 @ioctl(i32 0, i32 %4, %struct.winsize* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define void @resize_pty(i32 %0) {
%2 = alloca %struct.winsize
%3 = bitcast %struct.winsize* %2 to i8*
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i64 @ioctl(i32 0, i32 %4, %struct.winsize* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int invalid(char *name) { printf("Invalid command : %s\n", name); }


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

x86 assembly (clang, -O2):
<invalid>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"Invalid command : %s\0A\00"
define i32 @invalid(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}