xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void yyerror(void *state, void *scanner, char const *s) {
  fprintf(stderr, "%s\n", s);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %6
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int cclcmp(const void *a, const void *b) {
  if (!*(const unsigned char *)a)
    return 1;
  else if (!*(const unsigned char *)b)
    return -1;
  else
    return *(const unsigned char *)a - *(const unsigned char *)b;
}


x86 assembly (clang, -O0):
<cclcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1125 <cclcmp+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1151 <cclcmp+0x51>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <cclcmp+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <cclcmp+0x51>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cclcmp>:
movzbl (%rdi),%eax
test   %eax,%eax
je     1111 <cclcmp+0x11>
movzbl (%rsi),%ecx
test   %ecx,%ecx
je     1117 <cclcmp+0x17>
sub    %ecx,%eax
ret
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @cclcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = zext i8 %3 to i32
%10 = zext i8 %6 to i32
%11 = sub nsw i32 %9, %10
br label %12
12: ; preds = %5, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ -1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int printVectorDouble(double *ma, int dim) {
  int i;
  for (i = 0; i < dim; i++) {
    printf("%i: %e \n", i, ma[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<printVectorDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <printVectorDouble+0x4c>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printVectorDouble+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVectorDouble>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1149 <printVectorDouble+0x39>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printVectorDouble+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%i: %e \0A\00"
define i32 @printVectorDouble(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load double*, double** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, double %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%i: %e \0A\00"
define i32 @printVectorDouble(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, double %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printBin(int number) {
  if (number > 0 && number / 2 != 0)
    printBin(number / 2);
  printf("%i", number % 2);
}


x86 assembly (clang, -O0):
<printBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115b <printBin+0x3b>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     115b <printBin+0x3b>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <printBin@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBin>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1131 <printBin+0x11>
mov    %ebx,%edi
shr    %edi
call   1030 <printBin@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define void @printBin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 2
br label %12
12: ; preds = %9, %5, %1
%13 = load i32, i32* %2
%14 = srem i32 %13, 2
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @printBin(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
tail call void @printBin(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = srem i32 %0, 2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
char const *pubnub_sdk_name(void) { return "POSIX"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"POSIX\00"
define i8* @pubnub_sdk_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct updates_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct updates_queue *);
int /*<<< orphan*/ uq_clear(struct updates_queue *);
void free_uq(struct updates_queue *q) {
  uq_clear(q);
  free(q);
}


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

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

LLVM IR (-O0):
%struct.updates_queue = type { i32 }
define void @free_uq(%struct.updates_queue* %0) {
%2 = alloca %struct.updates_queue*
store %struct.updates_queue* %0, %struct.updates_queue** %2
%3 = load %struct.updates_queue*, %struct.updates_queue** %2
%4 = call i32 @uq_clear(%struct.updates_queue* %3)
%5 = load %struct.updates_queue*, %struct.updates_queue** %2
%6 = call i32 @free(%struct.updates_queue* %5)
ret void
}

LLVM IR (-O2):
%struct.updates_queue = type { i32 }
define void @free_uq(%struct.updates_queue* %0) {
%2 = tail call i32 @uq_clear(%struct.updates_queue* %0)
%3 = tail call i32 @free(%struct.updates_queue* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int executeExitCommand() {
  exit(0);
  return -1;
}


x86 assembly (clang, -O0):
<executeExitCommand>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<executeExitCommand>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @executeExitCommand() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @executeExitCommand() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double exp2l(double volatile);
int /*<<< orphan*/ printf(char *, double volatile);
int main() {
  volatile double x, y;
  x = 1e16;
  y = exp2l(x);
  printf("%e\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <exp2l@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x4341c37937e08000,%rax
c3 41 43
mov    %rax,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <exp2l@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
store volatile double 1.000000e+16, double* %1
%5 = load volatile double, double* %1
%6 = tail call double @exp2l(double %5)
store volatile double %6, double* %2
%7 = load volatile double, double* %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}
int indirect_ipccall(struct tcb *tcp) { return 1; }


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @indirect_ipccall(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @indirect_ipccall(%struct.tcb* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *acquire_output_buffer(void *context, size_t size,
                            void **acquired_handle) {
  void *mem;
  ((void)(context));
  mem = malloc(size);
  *acquired_handle = mem;
  fprintf(stderr, "acquired output buffer, handle %p", *acquired_handle);
  return mem;
}


x86 assembly (clang, -O0):
<acquire_output_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acquire_output_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,(%r14)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"acquired output buffer, handle %p\00"
define i8* @acquire_output_buffer(i8* %0, i64 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8**, i8*** %6
store i8* %11, i8** %12
%13 = load i32, i32* @stderr
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"acquired output buffer, handle %p\00"
define i8* @acquire_output_buffer(i8* nocapture readnone %0, i64 %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @malloc(i64 %1)
store i8* %4, i8** %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ParOuImpar();
int /*<<< orphan*/ fatorial();
int /*<<< orphan*/ potencia();
main() {
  fatorial();
  ParOuImpar();
  potencia();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fatorial@plt>
mov    $0x0,%al
call   1030 <ParOuImpar@plt>
mov    $0x0,%al
call   1050 <potencia@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fatorial()
%3 = call i32 (...) @ParOuImpar()
%4 = call i32 (...) @potencia()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fatorial()
%2 = tail call i32 (...) @ParOuImpar()
%3 = tail call i32 (...) @potencia()
ret i32 0
}
void foo523() {}


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

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

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

LLVM IR (-O2):
define void @foo523() {
ret void
}
void f(int a[20]) {}


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

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

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

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int string_to_uint_upto(char const *const, int /*<<< orphan*/);
int string_to_uint(const char *const str) {
  return string_to_uint_upto(str, INT_MAX);
}


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

x86 assembly (clang, -O2):
<string_to_uint>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <string_to_uint_upto@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @string_to_uint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @INT_MAX
%5 = call i32 @string_to_uint_upto(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @string_to_uint(i8* %0) {
%2 = load i32, i32* @INT_MAX
%3 = tail call i32 @string_to_uint_upto(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello.\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"hello.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rfc4175_set_line_offset(uint8_t *buf, uint16_t offset) {
  buf[4] |= (offset >> 8) & 0x7f;
  buf[5] = offset & 0xff;
}


x86 assembly (clang, -O0):
<rfc4175_set_line_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0x7f,%ecx
mov    -0x8(%rbp),%rax
or     0x10(%rax),%ecx
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_set_line_offset>:
movzbl %sil,%eax
shr    $0x8,%esi
and    $0x7f,%esi
or     %esi,0x10(%rdi)
mov    %eax,0x14(%rdi)
ret

LLVM IR (-O0):
define void @rfc4175_set_line_offset(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 127
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 4
%10 = load i32, i32* %9
%11 = or i32 %10, %7
store i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = and i32 %12, 255
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 5
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
define void @rfc4175_set_line_offset(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 127
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
%8 = and i32 %1, 255
%9 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %8, i32* %9
ret void
}
int execute_fork() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_fork() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_fork() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t find_millivolts_from_vid(uint32_t vid) { return 1550 - vid * 25; }


x86 assembly (clang, -O0):
<find_millivolts_from_vid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x19,-0x4(%rbp),%ecx
mov    $0x60e,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_millivolts_from_vid>:
imul   $0xffffffe7,%edi,%eax
add    $0x60e,%eax
ret

LLVM IR (-O0):
define i32 @find_millivolts_from_vid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 25
%5 = sub nsw i32 1550, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @find_millivolts_from_vid(i32 %0) {
%2 = mul i32 %0, -25
%3 = add i32 %2, 1550
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int suma(int, int);
int main() { printf("%d\n", suma(1, 14)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0xe,%esi
call   1040 <suma@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0xe,%esi
call   1040 <suma@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @suma(i32 1, i32 14)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
char *smalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *smalloc_strdup(const char *str) {
  char *ptr;
  ptr = smalloc(strlen(str) + 1);
  strcpy(ptr, str);
  return ptr;
}


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

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

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

LLVM IR (-O2):
define i8* @smalloc_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @smalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int val = 5;
  printf("Factorial of %d using recursion is %d", val, fact(val));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fact@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"Factorial of %d using recursion is %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 5, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @fact(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Factorial of %d using recursion is %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fact(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 5, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ status_print(int);
void ayt_status(int a) {
  (void)a;
  status_print(1);
}


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

x86 assembly (clang, -O2):
<ayt_status>:
mov    $0x1,%edi
jmp    1030 <status_print@plt>

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

LLVM IR (-O2):
define void @ayt_status(i32 %0) {
%2 = tail call i32 @status_print(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("O primeiro programa a gente nunca esquece\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"O primeiro programa a gente nunca esquece\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [42 x i8] c"O primeiro programa a gente nunca esquece\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print1(char *str) {
  printf("test.c print1(char *str)\n");
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<print1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [25 x i8] c"test.c print1(char *str)\00"
define void @print1(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_user_section() { write("msproject.xml", "<Resources>\n", NULL); }


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

x86 assembly (clang, -O2):
<init_user_section>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [13 x i8] c"<Resources>\0A\00"
define void @init_user_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [13 x i8] c"<Resources>\0A\00"
define void @init_user_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int parse_read(char **, char **, int /*<<< orphan*/);
int /*<<< orphan*/ strcspn(char *, char *);
int parse_read_to(char **buf, char **readbuf, char *reject) {
  return parse_read(buf, readbuf, strcspn(*buf, reject));
}


x86 assembly (clang, -O0):
<parse_read_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcspn@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <parse_read@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_read_to>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    %rdx,%rsi
call   1040 <strcspn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <parse_read@plt>

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

LLVM IR (-O2):
define i32 @parse_read_to(i8** %0, i8** %1, i8* nocapture %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @strcspn(i8* %4, i8* %2)
%6 = tail call i32 @parse_read(i8** %0, i8** %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
double sqrt(double);
double my_sqrt(double aa) { return aa <= 0.0 ? 0.0 : sqrt(aa); }


x86 assembly (clang, -O0):
<my_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1138 <my_sqrt+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <my_sqrt+0x37>
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    112b <my_sqrt+0x1b>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1130 <my_sqrt+0x20>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @my_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @sqrt(double %7)
br label %9
9: ; preds = %6, %5
%10 = phi double [ 0.000000e+00, %5 ], [ %8, %6 ]
ret double %10
}

LLVM IR (-O2):
define double @my_sqrt(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void int_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<int_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @int_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setpaca(int, int);
int /*<<< orphan*/ writelcd(int);
void clear(void) {
  int i = 0;
  setpaca(0x00, 0x00);
  for (i = 0; i < (132 * 8); i++) {
    writelcd(0x00);
  }
  writelcd(0x0F);
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <setpaca@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x420,-0x4(%rbp)
jge    1161 <clear+0x41>
xor    %edi,%edi
call   1040 <writelcd@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <clear+0x1f>
mov    $0xf,%edi
call   1040 <writelcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <setpaca@plt>
mov    $0x420,%ebx
nop
xor    %edi,%edi
call   1040 <writelcd@plt>
add    $0xffffffff,%ebx
jne    1130 <clear+0x10>
mov    $0xf,%edi
pop    %rbx
jmp    1040 <writelcd@plt>

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

LLVM IR (-O2):
define void @clear() {
%1 = tail call i32 @setpaca(i32 0, i32 0)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @writelcd(i32 0)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 1056
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @writelcd(i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
void markdown() { yyparse(); }


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

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

LLVM IR (-O0):
define void @markdown() {
%1 = call i32 (...) @yyparse()
ret void
}

LLVM IR (-O2):
define void @markdown() {
%1 = tail call i32 (...) @yyparse()
ret void
}
/* Variables and functions */
double tan(double);
double tosReal_tan(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<tosReal_tan>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @tosReal_tan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t gcd(uint32_t a, uint32_t b) {
  uint32_t c;
  while (1) {
    c = a % b;
    if (c == 0) {
      return b;
    }
    a = b;
    b = c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1123 <gcd+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void username2() {
  printf("<username> likes metals with lots of nickel and  copper.\n");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"<username> likes metals with lots of nickel and copper.\0A\00"
define void @username2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c"<username> likes metals with lots of nickel and copper.\00"
define void @username2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret void
}
int do_514() { return 514; }


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

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

LLVM IR (-O0):
define i32 @do_514() {
ret i32 514
}

LLVM IR (-O2):
define i32 @do_514() {
ret i32 514
}
/* Variables and functions */
int /*<<< orphan*/ draw_hand(int *, int *, int);
int /*<<< orphan*/ init_deck(int *, int);
int is_four_suits(int *);
int test_one_hand(int tid) {
  int deck[52];
  int hand[4];
  init_deck(deck, tid);
  draw_hand(deck, hand, tid);
  return is_four_suits(hand);
}


x86 assembly (clang, -O0):
<test_one_hand>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <init_deck@plt>
lea    -0xe0(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1040 <draw_hand@plt>
lea    -0xf0(%rbp),%rdi
call   1050 <is_four_suits@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_hand>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %edi,%ebx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <init_deck@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <draw_hand@plt>
mov    %r15,%rdi
call   1050 <is_four_suits@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @test_one_hand(i32 %0) {
%2 = alloca i32
%3 = alloca [52 x i32]
%4 = alloca [4 x i32]
store i32 %0, i32* %2
%5 = getelementptr inbounds [52 x i32], [52 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @init_deck(i32* %5, i32 %6)
%8 = getelementptr inbounds [52 x i32], [52 x i32]* %3, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i32 @draw_hand(i32* %8, i32* %9, i32 %10)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%13 = call i32 @is_four_suits(i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_one_hand(i32 %0) {
%2 = alloca [52 x i32]
%3 = alloca [4 x i32]
%4 = bitcast [52 x i32]* %2 to i8*
%5 = bitcast [4 x i32]* %3 to i8*
%6 = getelementptr inbounds [52 x i32], [52 x i32]* %2, i64 0, i64 0
%7 = call i32 @init_deck(i32* %6, i32 %0)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%9 = call i32 @draw_hand(i32* %6, i32* %8, i32 %0)
%10 = call i32 @is_four_suits(i32* %8)
ret i32 %10
}
/* Variables and functions */
int sin(double);
double fpp(double x) { return (2 * (-sin(x)) - 1 / 5.); }


x86 assembly (clang, -O0):
<fpp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec4(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp>:
push   %rax
call   1030 <sin@plt>
add    %eax,%eax
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xed7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fpp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = sub nsw i32 0, %4
%6 = mul nsw i32 2, %5
%7 = sitofp i32 %6 to double
%8 = fsub double %7, 2.000000e-01
ret double %8
}

LLVM IR (-O2):
define double @fpp(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = mul i32 %2, -2
%4 = sitofp i32 %3 to double
%5 = fadd double %4, -2.000000e-01
ret double %5
}
void test55_TestProg_targetInit__I() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @av_opt_set_int() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART_write(char const);
void UART_write_str(const char *s) {
  while (*s) {
    UART_write(*s);
    s++;
  }
}


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

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

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

LLVM IR (-O2):
define void @UART_write_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @UART_write(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void error_exit(char *errmsg) {
  printf("%s", errmsg);
  printf("Usage: clock [--sys] | [--set YY/MM/DD HH:MM] [--stop]\n");
  printf("YY 00-98 = 20xx, Use 24Hr Format\n");
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [56 x i8] c"Usage: clock [--sys] | [--set YY/MM/DD HH:MM] [--stop]\0A\00"
@.str.2 = [34 x i8] c"YY 00-98 = 20xx, Use 24Hr Format\0A\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@str = [55 x i8] c"Usage: clock [--sys] | [--set YY/MM/DD HH:MM] [--stop]\00"
@str.3 = [33 x i8] c"YY 00-98 = 20xx, Use 24Hr Format\00"
define void @error_exit(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
float plus10(float v) { return (v + 10.0); }


x86 assembly (clang, -O0):
<plus10>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus10>:
addss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @plus10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 1.000000e+01
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @plus10(float %0) {
%2 = fadd float %0, 1.000000e+01
ret float %2
}
/* Variables and functions */
size_t encoded_output_length(size_t input_length) {
  return 4 * ((input_length + 2) / 3);
}


x86 assembly (clang, -O0):
<encoded_output_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoded_output_length>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
lea    (%rdx,%rdx,1),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @encoded_output_length(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = udiv i64 %4, 3
%6 = mul i64 4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @encoded_output_length(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
ret i64 %4
}