xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ psw_write_bit(int, int);
void psw_write_cy(int cy) { psw_write_bit(7, cy); }


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

x86 assembly (clang, -O2):
<psw_write_cy>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <psw_write_bit@plt>

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

LLVM IR (-O2):
define void @psw_write_cy(i32 %0) {
%2 = tail call i32 @psw_write_bit(i32 7, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_POLYGON;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2f(double, double);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glBegin(GL_POLYGON);
  glVertex2f(-0.5, -0.5);
  glVertex2f(-0.5, 0.5);
  glVertex2f(0.5, 0.5);
  glVertex2f(0.5, -0.5);
  glEnd();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xea0(%rip),%xmm1
movaps %xmm1,%xmm0
call   1050 <glVertex2f@plt>
movsd  0xe90(%rip),%xmm0
movsd  0xe80(%rip),%xmm1
call   1050 <glVertex2f@plt>
movsd  0xe73(%rip),%xmm1
movaps %xmm1,%xmm0
call   1050 <glVertex2f@plt>
movsd  0xe63(%rip),%xmm0
movsd  0xe63(%rip),%xmm1
call   1050 <glVertex2f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xe9b(%rip),%xmm0
movaps %xmm0,%xmm1
call   1050 <glVertex2f@plt>
movsd  0xe93(%rip),%xmm1
movsd  0xe83(%rip),%xmm0
call   1050 <glVertex2f@plt>
movsd  0xe7e(%rip),%xmm0
movaps %xmm0,%xmm1
call   1050 <glVertex2f@plt>
movsd  0xe6e(%rip),%xmm0
movsd  0xe5e(%rip),%xmm1
call   1050 <glVertex2f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_POLYGON
%4 = call i32 @glBegin(i32 %3)
%5 = call i32 @glVertex2f(double -5.000000e-01, double -5.000000e-01)
%6 = call i32 @glVertex2f(double -5.000000e-01, double 5.000000e-01)
%7 = call i32 @glVertex2f(double 5.000000e-01, double 5.000000e-01)
%8 = call i32 @glVertex2f(double 5.000000e-01, double -5.000000e-01)
%9 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_POLYGON
%4 = tail call i32 @glBegin(i32 %3)
%5 = tail call i32 @glVertex2f(double -5.000000e-01, double -5.000000e-01)
%6 = tail call i32 @glVertex2f(double -5.000000e-01, double 5.000000e-01)
%7 = tail call i32 @glVertex2f(double 5.000000e-01, double 5.000000e-01)
%8 = tail call i32 @glVertex2f(double 5.000000e-01, double -5.000000e-01)
%9 = tail call i32 (...) @glEnd()
ret void
}
/* Variables and functions */
int makefilename(char *, size_t, char const *, char const *);
int c0x_mkdirname(char *path, size_t max, const char *dir, const char *sub) {
  return (makefilename(path, max, dir, sub));
}


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

x86 assembly (clang, -O2):
<c0x_mkdirname>:
jmp    1030 <makefilename@plt>

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

LLVM IR (-O2):
define i32 @c0x_mkdirname(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = tail call i32 @makefilename(i8* %0, i64 %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CBUF_Empty();
int /*<<< orphan*/ REPORT_loop();
int COMMAND_APP_Info(void) {
  if (!CBUF_Empty())
    return -1;
  REPORT_loop();
  return 0;
}


x86 assembly (clang, -O0):
<COMMAND_APP_Info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <CBUF_Empty@plt>
cmp    $0x0,%eax
jne    1144 <COMMAND_APP_Info+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <COMMAND_APP_Info+0x32>
mov    $0x0,%al
call   1040 <REPORT_loop@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COMMAND_APP_Info>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <CBUF_Empty@plt>
test   %eax,%eax
je     1137 <COMMAND_APP_Info+0x17>
xor    %eax,%eax
call   1040 <REPORT_loop@plt>
jmp    113c <COMMAND_APP_Info+0x1c>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @COMMAND_APP_Info() {
%1 = tail call i32 (...) @CBUF_Empty()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @REPORT_loop()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main(int argc, char **argv) { printf("sizeof(char)=%d\n", sizeof(char)); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"sizeof(char)=%d\0A\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void close_thread_log(void *thread_log) {
  fprintf((FILE *)thread_log, "Thread exiting...\n");
  fclose((FILE *)thread_log);
}


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

x86 assembly (clang, -O2):
<close_thread_log>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Thread exiting...\0A\00"
define void @close_thread_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Thread exiting...\0A\00"
define void @close_thread_log(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 18, i64 1, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int CRYPTO_mem_leaks_fp(FILE *fp) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_mem_leaks_fp(i32* nocapture readnone %0) {
ret i32 -1
}
__attribute__((no)) int fce(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<fce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fce>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fce(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fce(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct au_nhash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ au_nhash_fin(struct au_nhash *);
int /*<<< orphan*/ kfree(struct au_nhash *);
void au_nhash_del(struct au_nhash *nhash) {
  au_nhash_fin(nhash);
  kfree(nhash);
}


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

x86 assembly (clang, -O2):
<au_nhash_del>:
push   %rbx
mov    %rdi,%rbx
call   1040 <au_nhash_fin@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.au_nhash = type { i32 }
define void @au_nhash_del(%struct.au_nhash* %0) {
%2 = alloca %struct.au_nhash*
store %struct.au_nhash* %0, %struct.au_nhash** %2
%3 = load %struct.au_nhash*, %struct.au_nhash** %2
%4 = call i32 @au_nhash_fin(%struct.au_nhash* %3)
%5 = load %struct.au_nhash*, %struct.au_nhash** %2
%6 = call i32 @kfree(%struct.au_nhash* %5)
ret void
}

LLVM IR (-O2):
%struct.au_nhash = type { i32 }
define void @au_nhash_del(%struct.au_nhash* %0) {
%2 = tail call i32 @au_nhash_fin(%struct.au_nhash* %0)
%3 = tail call i32 @kfree(%struct.au_nhash* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR4F_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR4F_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR4F_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void logStatus() {}


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

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

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

LLVM IR (-O2):
define void @logStatus() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteMAC(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
void wiznetSetSocketDestMAC(uint8_t socket, uint8_t *mac) {
  wiznetRegWriteMAC(socket, (0x0000 + 0x0006), mac);
}


x86 assembly (clang, -O0):
<wiznetSetSocketDestMAC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x6,%esi
call   1030 <wiznetRegWriteMAC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiznetSetSocketDestMAC>:
mov    %rsi,%rdx
mov    $0x6,%esi
jmp    1030 <wiznetRegWriteMAC@plt>

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

LLVM IR (-O2):
define void @wiznetSetSocketDestMAC(i32 %0, i32* %1) {
%3 = tail call i32 @wiznetRegWriteMAC(i32 %0, i32 6, i32* %1)
ret void
}
/* Variables and functions */
char *sqlite3MallocRaw(scalar_t__, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *sqlite3StrDup(const char *z) {
  char *zNew;
  if (z == 0)
    return 0;
  zNew = sqlite3MallocRaw(strlen(z) + 1, 1);
  if (zNew)
    strcpy(zNew, z);
  return zNew;
}


x86 assembly (clang, -O0):
<sqlite3StrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <sqlite3StrDup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1192 <sqlite3StrDup+0x62>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <sqlite3MallocRaw@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118a <sqlite3StrDup+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3StrDup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1164 <sqlite3StrDup+0x34>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <sqlite3MallocRaw@plt>
test   %rax,%rax
je     1164 <sqlite3StrDup+0x34>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1166 <sqlite3StrDup+0x36>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sqlite3StrDup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @sqlite3MallocRaw(i64 %5, i32 1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ null, %1 ], [ %6, %8 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int f68(int *);
int f69(int *p) { return f68(p); }


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

x86 assembly (clang, -O2):
<f69>:
jmp    1030 <f68@plt>

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

LLVM IR (-O2):
define i32 @f69(i32* %0) {
%2 = tail call i32 @f68(i32* %0)
ret i32 %2
}
int mkdir(char *dirname, long mode) {}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mkdir(i8* nocapture readnone %0, i64 %1) {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ isnan(float);
uint32_t value_as_int(float value) {
  union {
    float f;
    uint32_t i;
  } u = {.f = value};
  if (isnan(value))
    return 0x7fffffff;
  return u.i;
}


x86 assembly (clang, -O0):
<value_as_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1147 <value_as_int+0x37>
movl   $0x7fffffff,-0x4(%rbp)
jmp    114d <value_as_int+0x3d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_as_int>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
movd   0x4(%rsp),%xmm0
movd   %xmm0,%ecx
mov    $0x7fffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @value_as_int(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %3
%5 = bitcast %union.anon* %4 to float*
%6 = load float, float* %3
store float %6, float* %5
%7 = load float, float* %3
%8 = call i64 @isnan(float %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 2147483647, i32* %2
br label %14
11: ; preds = %1
%12 = bitcast %union.anon* %4 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @value_as_int(float %0) {
%2 = tail call i64 @isnan(float %0)
%3 = icmp eq i64 %2, 0
%4 = bitcast float %0 to i32
%5 = select i1 %3, i32 %4, i32 2147483647
ret i32 %5
}
void foo() {
  for (int i = 0; i < 10; i++) {
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <foo+0x28>
jmp    111a <foo+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
void transpose0(double *out, _Atomic double *in) {}


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

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

LLVM IR (-O0):
define void @transpose0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
ret void
}

LLVM IR (-O2):
define void @transpose0(double* nocapture %0, double* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ restore_irq_pri(int /*<<< orphan*/);
void enable_irq(uint32_t irq_state) { restore_irq_pri(irq_state); }


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

x86 assembly (clang, -O2):
<enable_irq>:
jmp    1030 <restore_irq_pri@plt>

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

LLVM IR (-O2):
define void @enable_irq(i32 %0) {
%2 = tail call i32 @restore_irq_pri(i32 %0)
ret void
}
void swap(int *perm, int a, int b) {
  int tmp = perm[a];
  perm[a] = perm[b];
  perm[b] = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ assert(int);
scalar_t__ lseek(int, scalar_t__, int /*<<< orphan*/);
int SeekFile(int fd, off_t position) {
  assert(fd != -1);
  if (lseek(fd, position, SEEK_SET) != position)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<SeekFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    -0x10(%rbp),%rax
je     116b <SeekFile+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <SeekFile+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeekFile>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0xffffffff,%ebp
setne  %dil
call   1040 <assert@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <lseek@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @SeekFile(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %4
%11 = load i64, i64* %5
%12 = load i32, i32* @SEEK_SET
%13 = call i64 @lseek(i32 %10, i64 %11, i32 %12)
%14 = load i64, i64* %5
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 -1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @SeekFile(i32 %0, i64 %1) {
%3 = icmp ne i32 %0, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i64 @lseek(i32 %0, i64 %1, i32 %6)
%8 = icmp ne i64 %7, %1
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ f(int **);
int main() {
  int n = 0;
  int *pn = &n;
  int *t = pn;
  f(&pn);
  assert(n);
  assert(pn == t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <f@plt>
mov    -0x8(%rbp),%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <f@plt>
mov    0x4(%rsp),%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmp    %rbx,0x8(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 @f(i32** %2)
%6 = load i32, i32* %1
%7 = call i32 @assert(i32 %6)
%8 = load i32*, i32** %2
%9 = icmp eq i32* %8, %1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t mbrlen(char const *, size_t, int /*<<< orphan*/ *);
size_t mbrlen_l(const char *__restrict p, size_t l, mbstate_t *__restrict v,
                locale_t loc) {
  return mbrlen(p, l, v);
}


x86 assembly (clang, -O0):
<mbrlen_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <mbrlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbrlen_l>:
jmp    1030 <mbrlen@plt>

LLVM IR (-O0):
define i64 @mbrlen_l(i8* noalias %0, i64 %1, i32* noalias %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = call i64 @mbrlen(i8* %9, i64 %10, i32* %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @mbrlen_l(i8* noalias %0, i64 %1, i32* noalias %2, i32 %3) {
%5 = tail call i64 @mbrlen(i8* %0, i64 %1, i32* %2)
ret i64 %5
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ bzero(char *, int);
void socketaddr_init(struct sockaddr_in *socketaddr) {
  bzero((char *)socketaddr, sizeof(*socketaddr));
  socketaddr->sin_family = AF_INET;
}


x86 assembly (clang, -O0):
<socketaddr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <bzero@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketaddr_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%esi
call   1030 <bzero@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define void @socketaddr_init(%struct.sockaddr_in* %0) {
%2 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %2
%3 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%4 = bitcast %struct.sockaddr_in* %3 to i8*
%5 = call i32 @bzero(i8* %4, i32 4)
%6 = load i32, i32* @AF_INET
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define void @socketaddr_init(%struct.sockaddr_in* nocapture writeonly %0) {
%2 = bitcast %struct.sockaddr_in* %0 to i8*
%3 = tail call i32 @bzero(i8* %2, i32 4)
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
store i32 %4, i32* %5
ret void
}
/* Type definitions */
struct huffman {
  int dummy;
};
struct bitstream {
  int dummy;
};

/* Variables and functions */
int bits_get_unsigned_vlc(struct bitstream *, struct huffman const *);
int bits_get_signed_vlc(struct bitstream *bits, const struct huffman *h) {
  int v = bits_get_unsigned_vlc(bits, h);
  return ((v >> 1) ^ ((v & 1) - 1)) + 1;
}


x86 assembly (clang, -O0):
<bits_get_signed_vlc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <bits_get_unsigned_vlc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    -0x14(%rbp),%ecx
and    $0x1,%ecx
sub    $0x1,%ecx
xor    %ecx,%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_get_signed_vlc>:
push   %rax
call   1030 <bits_get_unsigned_vlc@plt>
mov    %eax,%ecx
sar    %ecx
and    $0x1,%eax
add    $0xffffffff,%eax
xor    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bitstream = type { i32 }
%struct.huffman = type { i32 }
define i32 @bits_get_signed_vlc(%struct.bitstream* %0, %struct.huffman* %1) {
%3 = alloca %struct.bitstream*
%4 = alloca %struct.huffman*
%5 = alloca i32
store %struct.bitstream* %0, %struct.bitstream** %3
store %struct.huffman* %1, %struct.huffman** %4
%6 = load %struct.bitstream*, %struct.bitstream** %3
%7 = load %struct.huffman*, %struct.huffman** %4
%8 = call i32 @bits_get_unsigned_vlc(%struct.bitstream* %6, %struct.huffman* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = ashr i32 %9, 1
%11 = load i32, i32* %5
%12 = and i32 %11, 1
%13 = sub nsw i32 %12, 1
%14 = xor i32 %10, %13
%15 = add nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
%struct.bitstream = type { i32 }
%struct.huffman = type { i32 }
define i32 @bits_get_signed_vlc(%struct.bitstream* %0, %struct.huffman* %1) {
%3 = tail call i32 @bits_get_unsigned_vlc(%struct.bitstream* %0, %struct.huffman* %1)
%4 = ashr i32 %3, 1
%5 = and i32 %3, 1
%6 = add nsw i32 %5, -1
%7 = xor i32 %6, %4
%8 = add nsw i32 %7, 1
ret i32 %8
}
/* Variables and functions */
scalar_t__ athame_select(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
char athame_get_first_char(int instream) {
  char return_val = '\0';
  if (athame_select(instream, -1, 0, 0, 0) > 0) {
    read(instream, &return_val, 1);
  }
  return return_val;
}


x86 assembly (clang, -O0):
<athame_get_first_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <athame_select@plt>
cmp    $0x0,%rax
jle    1160 <athame_get_first_char+0x40>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<athame_get_first_char>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movb   $0x0,0x7(%rsp)
xor    %ebp,%ebp
mov    $0xffffffff,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <athame_select@plt>
test   %rax,%rax
jle    1158 <athame_get_first_char+0x38>
lea    0x7(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x7(%rsp),%bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @athame_get_first_char(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
%5 = call i64 @athame_select(i32 %4, i32 -1, i32 0, i32 0, i32 0)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @read(i32 %8, i8* %3, i32 1)
br label %10
10: ; preds = %7, %1
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @athame_get_first_char(i32 %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = tail call i64 @athame_select(i32 %0, i32 -1, i32 0, i32 0, i32 0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @read(i32 %0, i8* %2, i32 1)
%7 = load i8, i8* %2
br label %8
8: ; preds = %5, %1
%9 = phi i8 [ %7, %5 ], [ 0, %1 ]
ret i8 %9
}
void rop3_123_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_123_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_123_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %dl,%cl
mov    %ecx,%r9d
and    %sil,%cl
mov    %esi,%eax
not    %al
or     %al,%r9b
and    %dl,%al
not    %dl
and    %r9b,%dl
and    %r8b,%al
or     %cl,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_123_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_123_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = xor i8 %1, -1
%7 = or i8 %5, %6
%8 = and i8 %5, %1
%9 = xor i8 %2, -1
%10 = and i8 %7, %9
%11 = and i8 %6, %2
%12 = and i8 %11, %4
%13 = or i8 %8, %12
%14 = or i8 %13, %10
store i8 %14, i8* %0
ret void
}
void format_error(err) int err;
{
  printf("\n  Greplace: format error %d\n\n", err);
  exit(1);
}


x86 assembly (clang, -O0):
<format_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<format_error>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0A Greplace: format error %d\0A\0A\00"
define void @format_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A Greplace: format error %d\0A\0A\00"
define void @format_error(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
tail call void @exit(i32 1)
unreachable
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ term_prompt(struct terminal *);
int /*<<< orphan*/ term_write(struct terminal *, ...);
void term_log(struct terminal *term, unsigned char *s) {
  unsigned char tmp[10];
  if (!term)
    return;
  term_write(term, "\r");
  term_write(term, s);
  term_prompt(term);
}


x86 assembly (clang, -O0):
<term_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <term_log+0x20>
jmp    116a <term_log+0x4a>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <term_write@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <term_write@plt>
mov    -0x8(%rbp),%rdi
call   1040 <term_prompt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_log>:
test   %rdi,%rdi
je     1159 <term_log+0x39>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
xor    %eax,%eax
call   1030 <term_write@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <term_write@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <term_prompt@plt>
ret

LLVM IR (-O0):
%struct.terminal = type { i32 }
@.str = [2 x i8] c"\0D\00"
define void @term_log(%struct.terminal* %0, i8* %1) {
%3 = alloca %struct.terminal*
%4 = alloca i8*
%5 = alloca [10 x i8]
store %struct.terminal* %0, %struct.terminal** %3
store i8* %1, i8** %4
%6 = load %struct.terminal*, %struct.terminal** %3
%7 = icmp ne %struct.terminal* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
br label %17
9: ; preds = %2
%10 = load %struct.terminal*, %struct.terminal** %3
%11 = call i32 (%struct.terminal*, ...) @term_write(%struct.terminal* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load %struct.terminal*, %struct.terminal** %3
%13 = load i8*, i8** %4
%14 = call i32 (%struct.terminal*, ...) @term_write(%struct.terminal* %12, i8* %13)
%15 = load %struct.terminal*, %struct.terminal** %3
%16 = call i32 @term_prompt(%struct.terminal* %15)
br label %17
17: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
@.str = [2 x i8] c"\0D\00"
define void @term_log(%struct.terminal* %0, i8* %1) {
%3 = icmp eq %struct.terminal* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (%struct.terminal*, ...) @term_write(%struct.terminal* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (%struct.terminal*, ...) @term_write(%struct.terminal* %0, i8* %1)
%7 = tail call i32 @term_prompt(%struct.terminal* %0)
br label %8
8: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Strcpy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  char a[] = "ravindra";
  char b[9];
  printf("%s\n", b);
  Strcpy(a, b);
  printf("%s\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x12(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x9(%rbp),%rdi
lea    -0x12(%rbp),%rsi
call   1030 <Strcpy@plt>
lea    -0x12(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6172646e69766172,%rax
64 72 61
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xec8(%rip),%r14
lea    0xf(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <Strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [9 x i8] c"ravindra\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [9 x i8]
%2 = alloca [9 x i8]
%3 = bitcast [9 x i8]* %1 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%8 = call i32 @Strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@__const.main.a = [9 x i8] c"ravindra\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [9 x i8]
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @Strcpy(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void ARGBToYJRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToYJRow_SSSE3() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int usage(int status) {
  if (status == EXIT_SUCCESS)
    fprintf(stderr, "WTF");
  else {
    fprintf(stdout, "Usage: -c <number of mounts to check> -t <file system "
                    "type, eg: ext3, ext4, nfs, fuse.s3fs> -n <nagios mode> "
                    "(Returns nagios values for OK, Warn, Crit) \n");
  }
  return (status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
jne    1147 <usage+0x37>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115c <usage+0x4c>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
cmp    %edi,(%rax)
lea    0xedd(%rip),%rax
lea    0xeda(%rip),%rsi
cmove  %rax,%rsi
mov    0x2ea3(%rip),%rax
cmove  0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [4 x i8] c"WTF\00"
@stdout = global i32 0
@.str.1 = [154 x i8] c"Usage: -c <number of mounts to check> -t <file system type, eg: ext3, ext4, nfs, fuse.s3fs> -n <nagios mode> (Returns nagios values for OK, Warn, Crit) \0A\00"
define i32 @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EXIT_SUCCESS
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %1
%10 = load i32, i32* @stdout
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [4 x i8] c"WTF\00"
@stdout = global i32 0
@.str.1 = [154 x i8] c"Usage: -c <number of mounts to check> -t <file system type, eg: ext3, ext4, nfs, fuse.s3fs> -n <nagios mode> (Returns nagios values for OK, Warn, Crit) \0A\00"
define i32 @usage(i32 returned %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = icmp eq i32 %2, %0
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0)
%5 = load i32, i32* @stderr
%6 = load i32, i32* @stdout
%7 = select i1 %3, i32 %5, i32 %6
%8 = tail call i32 @fprintf(i32 %7, i8* %4)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void naturalN(int N) {
  if (N < 0)
    return;
  printf("%d ", N);
  return naturalN(N - 2);
}


x86 assembly (clang, -O0):
<naturalN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113a <naturalN+0x1a>
jmp    1154 <naturalN+0x34>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <naturalN@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalN>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     1144 <naturalN+0x34>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xfffffffe,%ebx
mov    %ebx,%eax
add    $0x2,%eax
jae    1130 <naturalN+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @naturalN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 2
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @naturalN(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -2
%7 = icmp ult i32 %4, 2
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}