xunge/DecIR huggingface dataset:
void sub(double *r, const double *a, const double *b) {
  r[0] = a[0] - b[0];
  r[1] = a[1] - b[1];
  r[2] = a[2] - b[2];
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
movsd  (%rsi),%xmm0
subsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
subsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
subsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @sub(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @sub(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
/* Type definitions */
struct archive {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ archive_filter_bytes(struct archive *, int);
int64_t _alpm_archive_compressed_ftell(struct archive *archive) {
  return archive_filter_bytes(archive, -1);
}


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

x86 assembly (clang, -O2):
<_alpm_archive_compressed_ftell>:
mov    $0xffffffff,%esi
jmp    1030 <archive_filter_bytes@plt>

LLVM IR (-O0):
%struct.archive = type { i32 }
define i32 @_alpm_archive_compressed_ftell(%struct.archive* %0) {
%2 = alloca %struct.archive*
store %struct.archive* %0, %struct.archive** %2
%3 = load %struct.archive*, %struct.archive** %2
%4 = call i32 @archive_filter_bytes(%struct.archive* %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
%struct.archive = type { i32 }
define i32 @_alpm_archive_compressed_ftell(%struct.archive* %0) {
%2 = tail call i32 @archive_filter_bytes(%struct.archive* %0, i32 -1)
ret i32 %2
}
int h(int x) { int y; }


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

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

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int intlen(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 51234;
  printf("%d\n", intlen(a));
  printf("%d\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc822,%edi
call   1030 <intlen@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xc822,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @intlen(i32 51234)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 51234)
ret i32 0
}
/* Variables and functions */
long div(int);
int /*<<< orphan*/ printf(char *, long, long);
int main() {
  long ret = 0;
  ret = div(3) + div(5) - div(15);
  printf("The sum of all the multiples of 3 or 5 below %lu: %lu\n", ((long)999),
         ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <div@plt>
mov    %rax,-0x18(%rbp)
mov    $0x5,%edi
call   1040 <div@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0xf,%edi
call   1040 <div@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rdi
mov    $0x3e7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <div@plt>
mov    %rax,%rbx
mov    $0x5,%edi
call   1040 <div@plt>
add    %rax,%rbx
mov    $0xf,%edi
call   1040 <div@plt>
sub    %rax,%rbx
lea    0xeb1(%rip),%rdi
mov    $0x3e7,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"The sum of all the multiples of 3 or 5 below %lu: %lu\0A\00"
define i32 @main() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @div(i32 3)
%3 = call i64 @div(i32 5)
%4 = add nsw i64 %2, %3
%5 = call i64 @div(i32 15)
%6 = sub nsw i64 %4, %5
store i64 %6, i64* %1
%7 = load i64, i64* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 999, i64 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"The sum of all the multiples of 3 or 5 below %lu: %lu\0A\00"
define i32 @main() {
%1 = tail call i64 @div(i32 3)
%2 = tail call i64 @div(i32 5)
%3 = add nsw i64 %2, %1
%4 = tail call i64 @div(i32 15)
%5 = sub i64 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 999, i64 %5)
ret i32 0
}
void memory_barrier() { __asm__ volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @memory_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void show_usage(const char *progname) {
  fprintf(stderr, "USAGE: %s <config1> <config2>\n", progname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"USAGE: %s <config1> <config2>\0A\00"
@EXIT_FAILURE = global i32 0
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"USAGE: %s <config1> <config2>\0A\00"
@EXIT_FAILURE = global i32 0
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
char ConvertIntDigitToChar(int input) { return input + '0'; }


x86 assembly (clang, -O0):
<ConvertIntDigitToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertIntDigitToChar>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @ConvertIntDigitToChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @ConvertIntDigitToChar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Variables and functions */
int buscaO(int, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int elem = 23;
  int tam = 5;
  int vetor[] = {5, 10, 15, 20, 23};
  int result = buscaO(elem, tam, vetor);
  printf("Index: %d", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb7(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x20(%rbp),%rdx
call   1040 <buscaO@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x17,%edi
mov    $0x5,%esi
call   1040 <buscaO@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.vetor = [5 x i32] [i32 5, i32 10, i32 15, i32 20, i32 23]
@.str = [10 x i8] c"Index: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca i32
store i32 0, i32* %1
store i32 23, i32* %2
store i32 5, i32* %3
%6 = bitcast [5 x i32]* %4 to i8*
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%10 = call i32 @buscaO(i32 %7, i32 %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vetor = [5 x i32] [i32 5, i32 10, i32 15, i32 20, i32 23]
@.str = [10 x i8] c"Index: %d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @buscaO(i32 23, i32 5, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void __egl_array_fill_nil(void *arr, int64_t ct) {
  memset(arr, 0, ct * sizeof(void *));
}


x86 assembly (clang, -O0):
<__egl_array_fill_nil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__egl_array_fill_nil>:
lea    0x0(,%rsi,8),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @__egl_array_fill_nil(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 = sext i32 %6 to i64
%8 = mul i64 %7, 8
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i8* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @__egl_array_fill_nil(i8* %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i32 @memset(i8* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
void strcpy(char *dst, const char *src) {
  while (*src != '\0')
    *dst++ = *src++;
  *dst = '\0';
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <strcpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
int ascii_to_integer(char *string) {
  int value;
  int digit;
  value = 0;
  while (*string >= '0' && *string <= '9') {
    value *= 10;
    value += *string - '0';
  }
  if (*string != '\0')
    value = 0;
  return value;
}


x86 assembly (clang, -O0):
<ascii_to_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1134 <ascii_to_integer+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1144 <ascii_to_integer+0x44>
jmp    1160 <ascii_to_integer+0x60>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ascii_to_integer+0xf>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <ascii_to_integer+0x77>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ascii_to_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -58
%4 = icmp ult i8 %3, -10
ret i32 0
}
int intMin(int i, int j) { return i < j ? i : j; }


x86 assembly (clang, -O0):
<intMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <intMin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <intMin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intMin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @intMin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @intMin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int partition(long *, int, int);
void quicksort(long int x[], int low, int high) {
  int pivot, i;
  if (high > low) {
    pivot = partition(x, low, high);
    quicksort(x, low, pivot - 1);
    quicksort(x, pivot + 1, high);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %3
%13 = load i64*, i64** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i64* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i64*, i64** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i64*, i64** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i64* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i64* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i64* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void become_daemon(void) {}


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

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

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

LLVM IR (-O2):
define void @become_daemon() {
ret void
}
long long int P(long long int k) {
  long long int arr[] = {6, 2, 4, 8};
  if (k < 1)
    return 1;
  else
    return arr[k % 4];
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    0xef1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jge    114c <P+0x4c>
movq   $0x1,-0x8(%rbp)
jmp    1163 <P+0x63>
mov    -0x10(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
mov    -0x30(%rbp,%rdx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
test   %rdi,%rdi
jle    1114 <P+0x14>
and    $0x3,%edi
lea    0xef1(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@__const.P.arr = [4 x i64] [i64 6, i64 2, i64 4, i64 8]
define i64 @P(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca [4 x i64]
store i64 %0, i64* %3
%5 = bitcast [4 x i64]* %4 to i8*
%6 = load i64, i64* %3
%7 = icmp slt i64 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 1, i64* %2
br label %14
9: ; preds = %1
%10 = load i64, i64* %3
%11 = srem i64 %10, 4
%12 = getelementptr inbounds [4 x i64], [4 x i64]* %4, i64 0, i64 %11
%13 = load i64, i64* %12
store i64 %13, i64* %2
br label %14
14: ; preds = %9, %8
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
@__const.P.arr = [4 x i64] [i64 6, i64 2, i64 4, i64 8]
define i64 @P(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = and i64 %0, 3
%5 = getelementptr inbounds [4 x i64], [4 x i64]* @__const.P.arr, i64 0, i64 %4
%6 = load i64, i64* %5
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ 1, %1 ]
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pclose(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_pclose(FILE *stream) {
  return pclose(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_pclose>:
jmp    1030 <pclose@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_pclose(i32* %0) {
%2 = tail call i32 @pclose(i32* %0)
ret i32 %2
}
unsigned int get_cpu_speed() { return (700); }


x86 assembly (clang, -O0):
<get_cpu_speed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2bc,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_cpu_speed() {
ret i32 700
}

LLVM IR (-O2):
define i32 @get_cpu_speed() {
ret i32 700
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  char buf[128];
  fgets(buf, 128, stdin);
  fputs(buf, stdout);
  fputc('\n', stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1050 <fgets@plt>
lea    -0x90(%rbp),%rdi
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%esi
call   1050 <fgets@plt>
mov    0x2e7e(%rip),%rbx
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 128, i32 %4)
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* %6, i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fputc(i8 signext 10, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 128, i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* %2, i32 %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fputc(i8 signext 10, i32 %7)
ret i32 0
}
void tex_disp_sum(struct list *lst, double stot, double utot, double ftot,
                  double ifitot, double ifatot) {}


x86 assembly (clang, -O0):
<tex_disp_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.list = type opaque
define void @tex_disp_sum(%struct.list* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca %struct.list*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store %struct.list* %0, %struct.list** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
ret void
}

LLVM IR (-O2):
%struct.list = type opaque
define void @tex_disp_sum(%struct.list* nocapture %0, double %1, double %2, double %3, double %4, double %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x98() {
  Assert_real((islower(152) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              765, ("islower should be 0 for 0x98"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x98\00"
define void @t_islower_0x98() {
%1 = tail call i64 @islower(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ VIM_HAPI_SetPreviewParameter(unsigned short, unsigned short,
                                        unsigned short, unsigned short);
unsigned char V5H_Preview_Parameter(unsigned short Lcd_OffsetW,
                                    unsigned short Lcd_OffsetH,
                                    unsigned short Width,
                                    unsigned short Height) {
  return ((unsigned short)VIM_HAPI_SetPreviewParameter(Lcd_OffsetW, Lcd_OffsetH,
                                                       Width, Height));
}


x86 assembly (clang, -O0):
<V5H_Preview_Parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movzwl %dx,%edi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0x8(%rbp),%ecx
call   1030 <VIM_HAPI_SetPreviewParameter@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V5H_Preview_Parameter>:
push   %rax
call   1030 <VIM_HAPI_SetPreviewParameter@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @V5H_Preview_Parameter(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %7
%12 = load i16, i16* %8
%13 = call i64 @VIM_HAPI_SetPreviewParameter(i16 zeroext %9, i16 zeroext %10, i16 zeroext %11, i16 zeroext %12)
%14 = trunc i64 %13 to i16
%15 = trunc i16 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @V5H_Preview_Parameter(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i64 @VIM_HAPI_SetPreviewParameter(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3)
%6 = trunc i64 %5 to i8
ret i8 %6
}
unsigned char get_user_byte(const char *addr) { return *addr; }


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

x86 assembly (clang, -O2):
<get_user_byte>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @get_user_byte(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ moveCursorToLeftBy(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void printCommand(char command[], int curPos) {
  printf("%c[2K", 27);
  moveCursorToLeftBy(100);
  printf("obdosh -> %s", command);
  moveCursorToLeftBy((strlen(command) - curPos));
}


x86 assembly (clang, -O0):
<printCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x1b,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x64,%edi
call   1050 <moveCursorToLeftBy@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
sub    -0xc(%rbp),%edi
call   1050 <moveCursorToLeftBy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCommand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    $0x1b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
call   1050 <moveCursorToLeftBy@plt>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
sub    %ebp,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <moveCursorToLeftBy@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%c[2K\00"
@.str.1 = [13 x i8] c"obdosh -> %s\00"
define void @printCommand(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
%6 = call i32 @moveCursorToLeftBy(i32 100)
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call i32 @moveCursorToLeftBy(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c[2K\00"
@.str.1 = [13 x i8] c"obdosh -> %s\00"
define void @printCommand(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
%4 = tail call i32 @moveCursorToLeftBy(i32 100)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @strlen(i8* %0)
%7 = sub nsw i32 %6, %1
%8 = tail call i32 @moveCursorToLeftBy(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t to_unix_time(struct tm *ptm) { return mktime(ptm); }


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

x86 assembly (clang, -O2):
<to_unix_time>:
jmp    1030 <mktime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @to_unix_time(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i32 @mktime(%struct.tm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @to_unix_time(%struct.tm* nocapture %0) {
%2 = tail call i32 @mktime(%struct.tm* %0)
ret i32 %2
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
int __iswgraph_ascii(wint_t c) { return (unsigned int)(c - '!') < 127u - '!'; }


x86 assembly (clang, -O0):
<__iswgraph_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x21,%eax
cmp    $0x5e,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswgraph_ascii>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @__iswgraph_ascii(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 33
%6 = icmp ult i32 %5, 94
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @__iswgraph_ascii(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -33
%4 = icmp ult i32 %3, 94
%5 = zext i1 %4 to i32
ret i32 %5
}
int sys$faol(void *ctrstr, short int *outlen, void *outbuf, int *prmlst) {
  return ({
    unsigned long resultvar;
    register long int _a4 asm("r10") = (long)(prmlst);
    register long int _a3 asm("rdx") = (long)(outbuf);
    register long int _a2 asm("rsi") = (long)(outlen);
    register long int _a1 asm("rdi") = (long)(ctrstr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(80), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$faol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%r10
mov    $0x50,%rax
int    $0x81
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$faol>:
mov    %rcx,%r10
mov    $0x50,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$faol"(i8* %0, i16* %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i16*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i8* %0, i8** %5
store i16* %1, i16** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%15 = load i32*, i32** %8
%16 = ptrtoint i32* %15 to i64
store i64 %16, i64* %10
%17 = load i8*, i8** %7
%18 = ptrtoint i8* %17 to i64
store i64 %18, i64* %11
%19 = load i16*, i16** %6
%20 = ptrtoint i16* %19 to i64
store i64 %20, i64* %12
%21 = load i8*, i8** %5
%22 = ptrtoint i8* %21 to i64
store i64 %22, i64* %13
%23 = load i64, i64* %13
%24 = load i64, i64* %12
%25 = load i64, i64* %11
%26 = load i64, i64* %10
%27 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 80, i64 %23, i64 %24, i64 %25, i64 %26)
store i64 %27, i64* %9
%28 = load i64, i64* %9
store i64 %28, i64* %14
%29 = load i64, i64* %14
%30 = trunc i64 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @"sys$faol"(i8* %0, i16* %1, i8* %2, i32* %3) {
%5 = ptrtoint i32* %3 to i64
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i16* %1 to i64
%8 = ptrtoint i8* %0 to i64
%9 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 80, i64 %8, i64 %7, i64 %6, i64 %5)
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Type definitions */
struct cdfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bfree(void *);
void cdfs_relblk(struct cdfs *cdfs, void *cookie) { bfree(cookie); }


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

x86 assembly (clang, -O2):
<cdfs_relblk>:
mov    %rsi,%rdi
jmp    1030 <bfree@plt>

LLVM IR (-O0):
%struct.cdfs = type { i32 }
define void @cdfs_relblk(%struct.cdfs* %0, i8* %1) {
%3 = alloca %struct.cdfs*
%4 = alloca i8*
store %struct.cdfs* %0, %struct.cdfs** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @bfree(i8* %5)
ret void
}

LLVM IR (-O2):
%struct.cdfs = type { i32 }
define void @cdfs_relblk(%struct.cdfs* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @bfree(i8* %1)
ret void
}
int psxdev_filename_psx_to_unix(char *filename) {
  int i = 0;
  for (i = 0; filename[i] != 0; i++) {
    if (filename[i] == '/')
      filename[i] = '\\';
  }
  return i;
}


x86 assembly (clang, -O0):
<psxdev_filename_psx_to_unix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <psxdev_filename_psx_to_unix+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    114c <psxdev_filename_psx_to_unix+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x5c,(%rax,%rcx,1)
jmp    1151 <psxdev_filename_psx_to_unix+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <psxdev_filename_psx_to_unix+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psxdev_filename_psx_to_unix>:
xor    %eax,%eax
jmp    1118 <psxdev_filename_psx_to_unix+0x18>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x5c,(%rdi,%rax,1)
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
cmp    $0x2f,%cl
je     1110 <psxdev_filename_psx_to_unix+0x10>
test   %cl,%cl
jne    1114 <psxdev_filename_psx_to_unix+0x14>
ret

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

LLVM IR (-O2):
define i32 @psxdev_filename_psx_to_unix(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 47, label %6
]
6: ; preds = %2
store i8 92, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
%10 = trunc i64 %3 to i32
ret i32 %10
}
int test_stream_nonzero(void) {
  printf("%s\n", __FUNCTION__);
  return _test_stream(0);
}


x86 assembly (clang, -O0):
<test_stream_nonzero>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <_test_stream@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__FUNCTION__.test_stream_nonzero = [20 x i8] c"test_stream_nonzero\00"
define i32 @test_stream_nonzero() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_stream_nonzero, i64 0, i64 0))
%2 = call i32 (i32, ...) bitcast (i32 (...)* @_test_stream to i32 (i32, ...)*)(i32 0)
ret i32 %2
}

LLVM IR (-O2):
@__FUNCTION__.test_stream_nonzero = [20 x i8] c"test_stream_nonzero\00"
define i32 @test_stream_nonzero() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_stream_nonzero, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @_test_stream to i32 (i32, ...)*)(i32 0)
ret i32 %2
}
int msm_routing_put_dolby_dap_param_visualizer_control(
    struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_put_dolby_dap_param_visualizer_control(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_value* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_value*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_value* %1, %struct.snd_ctl_elem_value** %4
ret i32 0
}

LLVM IR (-O2):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_put_dolby_dap_param_visualizer_control(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_value* nocapture readnone %1) {
ret i32 0
}
void g_idle_source_new() {}


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

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

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

LLVM IR (-O2):
define void @g_idle_source_new() {
ret void
}