xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ checkResolution(int);
int normalizeResolution(int res) {
  if (!checkResolution(res)) {
    return 12;
  }
  return res;
}


x86 assembly (clang, -O0):
<normalizeResolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <checkResolution@plt>
cmp    $0x0,%eax
jne    1138 <normalizeResolution+0x28>
movl   $0xc,-0x4(%rbp)
jmp    113e <normalizeResolution+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalizeResolution>:
push   %rbx
mov    %edi,%ebx
call   1030 <checkResolution@plt>
test   %eax,%eax
mov    $0xc,%eax
cmovne %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @normalizeResolution(i32 %0) {
%2 = tail call i32 @checkResolution(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 12, i32 %0
ret i32 %4
}
void av_free() {}


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

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

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

LLVM IR (-O2):
define void @av_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_des() { MIPS_SET_BIT((0xB0000000 + 0x28), 13); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_des>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0xd,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_des>:
mov    $0xb0000028,%edi
mov    $0xd,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_des() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 13)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_des() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *printid(void *i) {
  printf("current tid is 0x%lx\n", pthread_self());
  return (void *)0;
}


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

x86 assembly (clang, -O2):
<printid>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"current tid is 0x%lx\0A\00"
define i8* @printid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [22 x i8] c"current tid is 0x%lx\0A\00"
define noalias i8* @printid(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @glutSwapBuffers()
ret void
}
void print_answer(char *buffer, int num_bytes) {}


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

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

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

LLVM IR (-O2):
define void @print_answer(i8* nocapture %0, i32 %1) {
ret void
}
void free_contiguous_mem3(void ***mem) {
  free(mem[0][0]);
  free(mem[0]);
  free(mem);
}


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

x86 assembly (clang, -O2):
<free_contiguous_mem3>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_contiguous_mem3(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i8*** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i8*** %0 to i8*
tail call void @free(i8* %6)
ret void
}
void transform(double source[], double target[], int size,
               double (*func)(double)) {
  int i;
  for (i = 0; i < size; i++) {
    target[i] = func(source[i]);
  }
}


x86 assembly (clang, -O0):
<transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1158 <transform+0x58>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
call   *%rax
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111e <transform+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1138 <transform+0x38>
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm0
call   *%r14
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1120 <transform+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @transform(double* nocapture %0, double* nocapture writeonly %1, i32 %2, double (double)* nocapture %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = tail call double %3(double %11)
%13 = getelementptr inbounds double, double* %1, i64 %9
store double %12, double* %13
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int cado_pclose2(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int cado_pclose(FILE *stream) { return cado_pclose2(stream, NULL); }


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

x86 assembly (clang, -O2):
<cado_pclose>:
xor    %esi,%esi
jmp    1030 <cado_pclose2@plt>

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

LLVM IR (-O2):
define i32 @cado_pclose(i32* %0) {
%2 = tail call i32 @cado_pclose2(i32* %0, i32* null)
ret i32 %2
}
void load_CFA(char *a) { return; }


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

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

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

LLVM IR (-O2):
define void @load_CFA(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ non_fatal(int /*<<< orphan*/, char *);
int /*<<< orphan*/ readline(char *, int, int);
void pragerror() {
  char msgbuf[510];
  non_fatal(readline(msgbuf, 510, 0x0001), "");
}


x86 assembly (clang, -O0):
<pragerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rdi
mov    $0x1fe,%esi
mov    $0x1,%edx
call   1030 <readline@plt>
mov    %eax,%edi
lea    0xeb6(%rip),%rsi
call   1040 <non_fatal@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pragerror>:
sub    $0x208,%rsp
mov    %rsp,%rdi
mov    $0x1fe,%esi
mov    $0x1,%edx
call   1030 <readline@plt>
lea    0xec0(%rip),%rsi
mov    %eax,%edi
call   1040 <non_fatal@plt>
add    $0x208,%rsp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @pragerror() {
%1 = alloca [510 x i8]
%2 = getelementptr inbounds [510 x i8], [510 x i8]* %1, i64 0, i64 0
%3 = call i32 @readline(i8* %2, i32 510, i32 1)
%4 = call i32 @non_fatal(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @pragerror() {
%1 = alloca [510 x i8]
%2 = getelementptr inbounds [510 x i8], [510 x i8]* %1, i64 0, i64 0
%3 = call i32 @readline(i8* %2, i32 510, i32 1)
%4 = call i32 @non_fatal(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
size_t fwrite(void const *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ nasm_error(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void nasm_write(const void *ptr, size_t size, FILE *f) {
  size_t n = fwrite(ptr, 1, size, f);
  if (n != size)
    nasm_error(0x00000002, "unable to write output: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<nasm_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     118d <nasm_write+0x5d>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xe78(%rip),%rsi
call   1030 <nasm_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_write>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    $0x1,%esi
mov    %rbx,%rdx
call   1040 <fwrite@plt>
cmp    %rbx,%rax
jne    114b <nasm_write+0x1b>
pop    %rbx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea0(%rip),%rsi
mov    $0x2,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <nasm_error@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"unable to write output: %s\00"
@errno = global i32 0
define void @nasm_write(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i32*, i32** %6
%11 = call i64 @fwrite(i8* %8, i32 1, i64 %9, i32* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %5
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* @errno
%17 = call i32 @strerror(i32 %16)
%18 = call i32 @nasm_error(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"unable to write output: %s\00"
@errno = global i32 0
define void @nasm_write(i8* nocapture %0, i64 %1, i32* nocapture %2) {
%4 = tail call i64 @fwrite(i8* %0, i32 1, i64 %1, i32* %2)
%5 = icmp eq i64 %4, %1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @nasm_error(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %3
ret void
}
void pmem_fence(void) { __builtin_ia32_sfence(); }


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

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

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

LLVM IR (-O2):
define void @pmem_fence() {
tail call void @llvm.x86.sse.sfence()
ret void
}
void send_v6() {}


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

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

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

LLVM IR (-O2):
define void @send_v6() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
void doubles_copy(const double *src, double *dst, int n) {
  memcpy(dst, src, n * sizeof(double));
}


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

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

LLVM IR (-O0):
define void @doubles_copy(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %5
%8 = load double*, double** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(double* %7, double* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @doubles_copy(double* %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @memcpy(double* %1, double* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outArrInt(int *, int);
int /*<<< orphan*/ printf(char *);
void outMat(int **xs, int r, int c) {
  for (int i = 0; i < r; i++)
    outArrInt(xs[i], c);
  printf("\n");
}


x86 assembly (clang, -O0):
<outMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <outMat+0x47>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
call   1040 <outArrInt@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <outMat+0x19>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outMat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <outMat+0x35>
mov    %edx,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
mov    %r14d,%esi
call   1040 <outArrInt@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <outMat+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @outMat(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
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32**, i32*** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32*, i32** %13, i64 %15
%17 = load i32*, i32** %16
%18 = load i32, i32* %6
%19 = call i32 @outArrInt(i32* %17, i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @outMat(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9, %3
%8 = tail call i32 @putchar(i32 10)
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds i32*, i32** %0, i64 %10
%12 = load i32*, i32** %11
%13 = tail call i32 @outArrInt(i32* %12, i32 %2)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %7, label %9
}
int myadd(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<myadd>:
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):
<myadd>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @myadd(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 @myadd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int ex_get_partial_coord(int, int /*<<< orphan*/, int /*<<< orphan*/, void *,
                         void *, void *);
int ex_get_n_coord(int exoid, int64_t start_node_num, int64_t num_nodes,
                   void *x_coor, void *y_coor, void *z_coor) {
  return ex_get_partial_coord(exoid, start_node_num, num_nodes, x_coor, y_coor,
                              z_coor);
}


x86 assembly (clang, -O0):
<ex_get_n_coord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <ex_get_partial_coord@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_get_n_coord>:
jmp    1030 <ex_get_partial_coord@plt>

LLVM IR (-O0):
define i32 @ex_get_n_coord(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i32 @ex_get_partial_coord(i32 %13, i32 %14, i32 %15, i8* %16, i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @ex_get_n_coord(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @ex_get_partial_coord(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  long tid;
  tid = (long)threadid;
  printf("Hello World!, It's me , thread %ld\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Hello World!, It's me , thread %ld\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [36 x i8] c"Hello World!, It's me , thread %ld\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int __linux_eventfd(int, int);
int eventfd(int __count, int __flags) {
  return __linux_eventfd(__count, __flags);
}


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

x86 assembly (clang, -O2):
<eventfd>:
jmp    1030 <__linux_eventfd@plt>

LLVM IR (-O0):
define i32 @eventfd(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 @__linux_eventfd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @eventfd(i32 %0, i32 %1) {
%3 = tail call i32 @__linux_eventfd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ halt(int /*<<< orphan*/);
int /*<<< orphan*/ wheatLog(int, char *);
void handleTerm() {
  wheatLog(4, "Signal term");
  halt(0);
}


x86 assembly (clang, -O0):
<handleTerm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
lea    0xed0(%rip),%rsi
call   1030 <wheatLog@plt>
xor    %edi,%edi
call   1040 <halt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleTerm>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x4,%edi
call   1030 <wheatLog@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Signal term\00"
define void @handleTerm() {
%1 = call i32 @wheatLog(i32 4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @halt(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Signal term\00"
define void @handleTerm() {
%1 = tail call i32 @wheatLog(i32 4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @halt(i32 0)
ret void
}
int number_of_nodes_needed(int bdrs_length) {
  int n = bdrs_length;
  int b = bdrs_length;
  while (b > 1) {
    b = (b + 1) / 2;
    n += b;
  }
  return n;
}


x86 assembly (clang, -O0):
<number_of_nodes_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    113c <number_of_nodes_needed+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <number_of_nodes_needed+0x13>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_nodes_needed>:
cmp    $0x2,%edi
jl     111f <number_of_nodes_needed+0x1f>
mov    %edi,%eax
nopw   0x0(%rax,%rax,1)
lea    0x1(%rdi),%ecx
shr    %ecx
add    %ecx,%eax
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <number_of_nodes_needed+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @number_of_nodes_needed(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %6, 1
%8 = add nsw i32 %7, %5
%9 = icmp ugt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ %0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int reboot(int);
int /*<<< orphan*/ sync();
void cmd_reboot(int argc, char *argv[]) {
  sync();
  if (reboot(0x01234567) == -1)
    perror("reboot");
}


x86 assembly (clang, -O0):
<cmd_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sync@plt>
mov    $0x1234567,%edi
call   1050 <reboot@plt>
cmp    $0xffffffff,%eax
jne    1165 <cmd_reboot+0x35>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_reboot>:
push   %rax
xor    %eax,%eax
call   1030 <sync@plt>
mov    $0x1234567,%edi
call   1050 <reboot@plt>
cmp    $0xffffffff,%eax
je     1149 <cmd_reboot+0x19>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"reboot\00"
define void @cmd_reboot(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @sync()
%6 = call i32 @reboot(i32 19088743)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"reboot\00"
define void @cmd_reboot(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
%4 = tail call i32 @reboot(i32 19088743)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
void le_string_txt(char *spr, char *cam_arq) {
  FILE *arq;
  arq = fopen(cam_arq, "r");
  fscanf(arq, "%s", spr);
  fclose(arq);
}


x86 assembly (clang, -O0):
<le_string_txt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_string_txt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeaf(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fscanf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%s\00"
define void @le_string_txt(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_output(char *);
void gtp_version(int gtp_argc, char gtp_argv[][20]) {
  add_output("0.1");
  return;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"0.1\00"
define void @gtp_version(i32 %0, [20 x i8]* %1) {
%3 = alloca i32
%4 = alloca [20 x i8]*
store i32 %0, i32* %3
store [20 x i8]* %1, [20 x i8]** %4
%5 = call i32 @add_output(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"0.1\00"
define void @gtp_version(i32 %0, [20 x i8]* nocapture readnone %1) {
%3 = tail call i32 @add_output(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int_least16_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_int_least16_t(int_least16_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int_least16_t(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int __sbmaskrune(int, int);
int digittoint(int c) { return (__sbmaskrune(c, 0xFF)); }


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

x86 assembly (clang, -O2):
<digittoint>:
mov    $0xff,%esi
jmp    1030 <__sbmaskrune@plt>

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

LLVM IR (-O2):
define i32 @digittoint(i32 %0) {
%2 = tail call i32 @__sbmaskrune(i32 %0, i32 255)
ret i32 %2
}
void gtk_radio_tool_button_get_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_tool_button_get_group() {
ret void
}
void win32_backslashify(char *path) {
  char *p = path;
  while (*p) {
    if (*p == '/')
      *p = '\\';
    p++;
  }
}


x86 assembly (clang, -O0):
<win32_backslashify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <win32_backslashify+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1134 <win32_backslashify+0x34>
mov    -0x10(%rbp),%rax
movb   $0x5c,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <win32_backslashify+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<win32_backslashify>:
jmp    1117 <win32_backslashify+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5c,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <win32_backslashify+0x10>
test   %al,%al
jne    1113 <win32_backslashify+0x13>
ret

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

LLVM IR (-O2):
define void @win32_backslashify(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 47, label %5
]
5: ; preds = %2
store i8 92, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ETH_Read8();
int /*<<< orphan*/ putch(int /*<<< orphan*/);
void udp_test(int len) {
  while (len--)
    putch(ETH_Read8());
}


x86 assembly (clang, -O0):
<udp_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1152 <udp_test+0x32>
mov    $0x0,%al
call   1030 <ETH_Read8@plt>
mov    %eax,%edi
call   1040 <putch@plt>
jmp    112b <udp_test+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_test>:
push   %rbx
test   %edi,%edi
je     1143 <udp_test+0x23>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ETH_Read8@plt>
mov    %eax,%edi
call   1040 <putch@plt>
add    $0xffffffff,%ebx
jne    1130 <udp_test+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @udp_test(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @ETH_Read8()
%7 = tail call i32 @putch(i32 %6)
%8 = icmp eq i32 %5, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
void fb_console_init(void) {}


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

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

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

LLVM IR (-O2):
define void @fb_console_init() {
ret void
}
int section(char type) {
  switch (type) {
  case 'T':
  case 't':
    return 0;
  case 'D':
  case 'd':
    return 1;
  case 'R':
  case 'r':
    return 2;
  case 'C':
    return 3;
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<section>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x31,%eax
ja     1164 <section+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <section+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <section+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <section+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <section+0x6b>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<section>:
add    $0xffffffbd,%edi
cmp    $0x31,%edi
ja     112c <section+0x2c>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @section(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 84, label %6
i32 116, label %6
i32 68, label %7
i32 100, label %7
i32 82, label %8
i32 114, label %8
i32 67, label %9
]
6: ; preds = %1, %1
store i32 0, i32* %2
br label %11
7: ; preds = %1, %1
store i32 1, i32* %2
br label %11
8: ; preds = %1, %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 4, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @section(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 84, label %7
i32 116, label %7
i32 68, label %3
i32 100, label %3
i32 82, label %4
i32 114, label %4
i32 67, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
long long timerabs(struct timeval a) {
  return (long long)a.tv_sec * 1000000 + a.tv_usec;
}


x86 assembly (clang, -O0):
<timerabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerabs>:
imul   $0xf4240,%rsi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timerabs(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @timerabs(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, 1000000
%4 = add nsw i64 %3, %0
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_getattr_np(pthread_t thread, pthread_attr_t *attr) {
  ;
  return -1;
}


x86 assembly (clang, -O0):
<pthread_getattr_np>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_getattr_np(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
int LSHF(int value, int amount) { return (value << amount) & 0xFFFF; }


x86 assembly (clang, -O0):
<LSHF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSHF>:
mov    %esi,%ecx
shl    %cl,%edi
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @LSHF(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 = shl i32 %5, %6
%8 = and i32 %7, 65535
ret i32 %8
}

LLVM IR (-O2):
define i32 @LSHF(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = and i32 %3, 65535
ret i32 %4
}
/* Variables and functions */
short *malloc(int);
int main() {
  volatile short *s = malloc(sizeof(short));
  *s = 23;
  return *s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movw   $0x17,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <malloc@plt>
movw   $0x17,(%rax)
movswl (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16*
store i32 0, i32* %1
%3 = call i16* @malloc(i32 2)
store i16* %3, i16** %2
%4 = load i16*, i16** %2
store volatile i16 23, i16* %4
%5 = load i16*, i16** %2
%6 = load volatile i16, i16* %5
%7 = sext i16 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i16* @malloc(i32 2)
store volatile i16 23, i16* %1
%2 = load volatile i16, i16* %1
%3 = sext i16 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_serial_data_until_is_empty(unsigned short, char const);
void write_serial_console(unsigned short com, const char *message, int length) {
  int i;
  for (i = 0; i < length; i++) {
    write_serial_data_until_is_empty(com, message[i]);
  }
}


x86 assembly (clang, -O0):
<write_serial_console>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <write_serial_console+0x4f>
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzwl %dx,%edi
movsbl (%rax,%rcx,1),%esi
call   1030 <write_serial_data_until_is_empty@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <write_serial_console+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial_console>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <write_serial_console+0x35>
mov    %rsi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
movzwl %di,%ebp
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %ebp,%edi
call   1030 <write_serial_data_until_is_empty@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <write_serial_console+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @write_serial_console(i16 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i16, i16* %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @write_serial_data_until_is_empty(i16 zeroext %13, i8 signext %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @write_serial_console(i16 zeroext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @write_serial_data_until_is_empty(i16 zeroext %0, i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
void irq_enable(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @irq_enable() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
float f_lerp(float a, float b, float t) { return t * a + (1.0f - t) * b; }


x86 assembly (clang, -O0):
<f_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xedb(%rip),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm2,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @f_lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = load float, float* %6
%10 = fsub float 1.000000e+00, %9
%11 = load float, float* %5
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %8, float %12)
ret float %13
}

LLVM IR (-O2):
define float @f_lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %4, %1
%6 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_get_balance() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_get_balance"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_cvolume_get_balance\0A\00"
define i32 @pa_cvolume_get_balance() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_cvolume_get_balance\00"
define i32 @pa_cvolume_get_balance() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}