xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void displayString(FILE *fp, void *v) { fprintf(fp, "\"%s\"", (char *)v); }


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

x86 assembly (clang, -O2):
<displayString>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define void @displayString(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c();
__attribute__((no)) void b() { c(); }


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

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

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @c()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned char const *, int);
void GLUE_SET_PX_FROM_WTP(void *b, int wv) {
  static const unsigned char tab[3][2] = {
      {0x89, 0xF0},
      {0x89, 0xF7},
      {0x89, 0xF1},
  };
  memcpy(b, tab[wv], 2);
}


x86 assembly (clang, -O0):
<GLUE_SET_PX_FROM_WTP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    0xed2(%rip),%rsi
shl    $0x1,%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_SET_PX_FROM_WTP>:
movslq %esi,%rax
lea    0xee6(%rip),%rcx
lea    (%rcx,%rax,2),%rsi
mov    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@GLUE_SET_PX_FROM_WTP.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"\89\F0", [2 x i8] c"\89\F7", [2 x i8] c"\89\F1"]
define void @GLUE_SET_PX_FROM_WTP(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 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_SET_PX_FROM_WTP.tab, i64 0, i64 %7
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 2)
ret void
}

LLVM IR (-O2):
@GLUE_SET_PX_FROM_WTP.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"\89\F0", [2 x i8] c"\89\F7", [2 x i8] c"\89\F1"]
define void @GLUE_SET_PX_FROM_WTP(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_SET_PX_FROM_WTP.tab, i64 0, i64 %3, i64 0
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ food(double *);
void testdouble() {
  double d = 2.0;
  food(&d);
}


x86 assembly (clang, -O0):
<testdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <food@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdouble>:
push   %rax
movabs $0x4000000000000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <food@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @testdouble() {
%1 = alloca double
store double 2.000000e+00, double* %1
%2 = call i32 @food(double* %1)
ret void
}

LLVM IR (-O2):
define void @testdouble() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 2.000000e+00, double* %1
%3 = call i32 @food(double* %1)
ret void
}
void __attribute__((no, noclone)) fn6(void) {
  int i = 5;
  volatile int a[i];
  volatile int j;
  fn_p(a[i]);
  asm("" : : "r"(&a) : "memory");
  j = a[foo_5()];
}


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x28(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    $0x0,%al
call   1030 <fn_p@plt>
mov    -0x28(%rbp),%rax
mov    $0x0,%al
call   1040 <foo_5@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
sub    $0x28,%rsp
mov    0x24(%rsp),%edi
xor    %eax,%eax
call   1030 <fn_p@plt>
lea    0x10(%rsp),%rax
xor    %eax,%eax
call   1040 <foo_5@plt>
cltq
mov    0x10(%rsp,%rax,4),%eax
mov    %eax,0xc(%rsp)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @fn6() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i32 5, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i32, i64 %6
store i64 %6, i64* %3
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load volatile i32, i32* %11
%13 = call i32 (i32, ...) bitcast (i32 (...)* @fn_p to i32 (i32, ...)*)(i32 %12)
%14 = call i32 (...) @foo_5()
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %8, i64 %15
%17 = load volatile i32, i32* %16
store volatile i32 %17, i32* %4
%18 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @fn6() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 5
%6 = load volatile i32, i32* %5
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @fn_p to i32 (i32, ...)*)(i32 %6)
%8 = call i32 (...) @foo_5()
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %9
%11 = load volatile i32, i32* %10
store volatile i32 %11, i32* %1
ret void
}
int qcmp(int *a, int *b) { return (*a < *b) ? -1 : (*a > *b) ? 1 : 0; }


x86 assembly (clang, -O0):
<qcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    112b <qcmp+0x2b>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <qcmp+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qcmp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = icmp sgt i32 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ -1, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @qcmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = icmp sgt i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int c(void *arg) { return *(int *)arg; }


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

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

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

LLVM IR (-O2):
define i32 @c(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ err(int, char *);
int main(int argc, char **argv) {
  if (argc == 1)
    return 0;
  if (argc > 2)
    err(1, "Too much arguments");
  return atoi(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1177 <main+0x57>
cmpl   $0x2,-0x8(%rbp)
jle    1167 <main+0x47>
mov    $0x1,%edi
lea    0xe9e(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jne    1128 <main+0x8>
xor    %eax,%eax
ret
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
jl     1142 <main+0x22>
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    0x8(%rbx),%rdi
pop    %rbx
jmp    1040 <atoi@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Too much arguments\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %19
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [19 x i8] c"Too much arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x72() {
  Assert_real((isgraph(114)),
              "/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_isgraph.c",
              575, ("isgraph should be 1 for r"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x72>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23f,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x72>:
push   %rax
mov    $0x72,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x23f,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for r\00"
define void @t_isgraph_0x72() {
%1 = call i32 @isgraph(i32 114)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for r\00"
define void @t_isgraph_0x72() {
%1 = tail call i32 @isgraph(i32 114)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
eat(c) register int c;
{
  register i;
  while ((i = (unsigned)(0177777 & (getch()))) != c && i != '\n')
    ;
  return (i);
}


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,%ecx
and    $0xffff,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1145 <eat+0x35>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1155 <eat+0x45>
jmp    115a <eat+0x4a>
jmp    111b <eat+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getch@plt>
movzwl %ax,%eax
cmp    %ebx,%eax
je     1133 <eat+0x23>
cmp    $0xa,%eax
jne    1120 <eat+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @eat(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = call i32 (...) @getch()
%6 = and i32 65535, %5
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %9, %4
%13 = phi i1 [ false, %4 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @eat(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @getch()
%4 = and i32 %3, 65535
%5 = icmp ne i32 %4, %0
%6 = icmp ne i32 %4, 10
%7 = and i1 %5, %6
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %4
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
void mostra_tela(void *cria_tela) {
  char Enter;
  do {
    printf("\tAperte em qualquer tecla e/ou Enter Para começar\n");
    Enter = getchar();
    printf("\n");
  } while (Enter != '\n');
}


x86 assembly (clang, -O0):
<mostra_tela>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    112c <mostra_tela+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra_tela>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0xa,%bl
jne    1140 <mostra_tela+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\09Aperte em qualquer tecla e/ou Enter Para come\C3\A7ar\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @mostra_tela(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %8, %1
%5 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %4
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %4, label %12
12: ; preds = %8
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"\09Aperte em qualquer tecla e/ou Enter Para come\C3\A7ar\00"
define void @mostra_tela(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%4 = tail call signext i8 (...) @getchar()
%5 = tail call i32 @putchar(i32 10)
%6 = icmp eq i8 %4, 10
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
/* Variables and functions */
long _InterlockedAdd(long volatile *, long);
long test_InterlockedAdd(long volatile *Addend, long Value) {
  return _InterlockedAdd(Addend, Value);
}


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

x86 assembly (clang, -O2):
<test_InterlockedAdd>:
jmp    1030 <_InterlockedAdd@plt>

LLVM IR (-O0):
define i64 @test_InterlockedAdd(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i64 @_InterlockedAdd(i64* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @test_InterlockedAdd(i64* %0, i64 %1) {
%3 = tail call i64 @_InterlockedAdd(i64* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int hexwide(unsigned long);
int /*<<< orphan*/ int2hex(char *, unsigned long, int);
int writexactly(int, char *, int);
int writeLong(int fd, unsigned long int n) {
  char buf[20];
  int w = hexwide(n);
  int2hex(buf, w, 2);
  int2hex(buf + 2, n, w);
  return writexactly(fd, buf, w + 2);
}


x86 assembly (clang, -O0):
<writeLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <hexwide@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
movslq -0x34(%rbp),%rsi
mov    $0x2,%edx
call   1040 <int2hex@plt>
lea    -0x30(%rbp),%rdi
add    $0x2,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1040 <int2hex@plt>
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
add    $0x2,%edx
call   1030 <writexactly@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLong>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1050 <hexwide@plt>
movslq %eax,%rbp
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x2,%edx
call   1040 <int2hex@plt>
lea    0x2(%rsp),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <int2hex@plt>
add    $0x2,%ebp
mov    %r14d,%edi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <writexactly@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @writeLong(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [20 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @hexwide(i64 %7)
store i32 %8, i32* %6
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = call i32 @int2hex(i8* %9, i64 %11, i32 2)
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i64, i64* %4
%16 = load i32, i32* %6
%17 = call i32 @int2hex(i8* %14, i64 %15, i32 %16)
%18 = load i32, i32* %3
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 2
%22 = call i32 @writexactly(i32 %18, i8* %19, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @writeLong(i32 %0, i64 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @hexwide(i64 %1)
%6 = sext i32 %5 to i64
%7 = call i32 @int2hex(i8* %4, i64 %6, i32 2)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 2
%9 = call i32 @int2hex(i8* %8, i64 %1, i32 %5)
%10 = add nsw i32 %5, 2
%11 = call i32 @writexactly(i32 %0, i8* %4, i32 %10)
ret i32 %11
}
/* Variables and functions */
int floor(double);
int Day(double t) { return floor(t / (((24.0 * 60.0) * 60.0) * 1000.0)); }


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

x86 assembly (clang, -O2):
<Day>:
divsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @Day(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 8.640000e+07
%5 = call i32 @floor(double %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Day(double %0) {
%2 = fdiv double %0, 8.640000e+07
%3 = tail call i32 @floor(double %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(int const, int const, int const, int const);
void glWindowPos4iv(const int v[4]) { glWindowPos4f(v[0], v[1], v[2], v[3]); }


x86 assembly (clang, -O0):
<glWindowPos4iv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos4iv>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    0xc(%rdi),%ecx
mov    %eax,%edi
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos4iv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = call i32 @glWindowPos4f(i32 %5, i32 %8, i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
define void @glWindowPos4iv(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = tail call i32 @glWindowPos4f(i32 %2, i32 %4, i32 %6, i32 %8)
ret void
}
void co_tokenizer_nextsym(struct co_tokenizer_t *tokenizer) {}


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

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

LLVM IR (-O0):
%struct.co_tokenizer_t = type opaque
define void @co_tokenizer_nextsym(%struct.co_tokenizer_t* %0) {
%2 = alloca %struct.co_tokenizer_t*
store %struct.co_tokenizer_t* %0, %struct.co_tokenizer_t** %2
ret void
}

LLVM IR (-O2):
%struct.co_tokenizer_t = type opaque
define void @co_tokenizer_nextsym(%struct.co_tokenizer_t* nocapture %0) {
ret void
}
void *test_anti_range_110(signed char n) {
  extern void *alloc_anti_range_110(signed char) __attribute__((alloc_size(1)));
  if ((-0x7f - 1) + 2 <= n && n <= -1)
    n = (-0x7f - 1) + 2 - 1;
  return alloc_anti_range_110(n);
}


x86 assembly (clang, -O0):
<test_anti_range_110>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xffffff82,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_110+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0xffffffff,%eax
jg     1140 <test_anti_range_110+0x30>
movb   $0x81,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_110@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_110>:
cmp    $0x81,%dil
mov    $0x81,%eax
cmovb  %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_110@plt>

LLVM IR (-O0):
define i8* @test_anti_range_110(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 -126, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -127, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_110(i8 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_110(i8 signext %0) {
%2 = icmp ult i8 %0, -127
%3 = select i1 %2, i8 %0, i8 -127
%4 = tail call i8* @alloc_anti_range_110(i8 signext %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void CheckNoArgs() {
#pragma omp target
  { printf("hello, world!"); }
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world!\00"
define void @CheckNoArgs() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world!\00"
define void @CheckNoArgs() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float log(float);
float call_logf(float x) { return log((float)x); }


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

x86 assembly (clang, -O2):
<call_logf>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define float @call_logf(float %0) {
%2 = tail call float @log(float %0)
ret float %2
}
/* Variables and functions */
double cos(double);
double sin(double);
double rx(double x, double y, double t) {
  t *= (3.141592653589793 / 180);
  return (x * cos(t) - y * sin(t));
}


x86 assembly (clang, -O0):
<rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xec1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx>:
sub    $0x28,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
movapd %xmm2,%xmm0
mulsd  0xec4(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @rx(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* %6
%8 = fmul double %7, 0x3F91DF46A2529D39
store double %8, double* %6
%9 = load double, double* %4
%10 = load double, double* %6
%11 = call double @cos(double %10)
%12 = load double, double* %5
%13 = load double, double* %6
%14 = call double @sin(double %13)
%15 = fmul double %12, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %9, double %11, double %16)
ret double %17
}

LLVM IR (-O2):
define double @rx(double %0, double %1, double %2) {
%4 = fmul double %2, 0x3F91DF46A2529D39
%5 = tail call double @cos(double %4)
%6 = tail call double @sin(double %4)
%7 = fneg double %6
%8 = fmul double %7, %1
%9 = tail call double @llvm.fmuladd.f64(double %0, double %5, double %8)
ret double %9
}
/* Variables and functions */
float fabs(float);
float pow(float, int);
float sqrt(float);
float dist(float x1, float y1, float x2, float y2) {
  float result;
  result = (pow(x2 - x1, 2) + pow(y2 - y1, 2));
  result = sqrt(result);
  return fabs(result);
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <fabs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
sub    $0x18,%rsp
movss  %xmm3,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
subss  %xmm0,%xmm2
movaps %xmm2,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
subss  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1171 <dist+0x51>
sqrtss %xmm0,%xmm0
jmp    1176 <dist+0x56>
call   1040 <sqrt@plt>
andps  0xe83(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @dist(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %7
%11 = load float, float* %5
%12 = fsub float %10, %11
%13 = call float @pow(float %12, i32 2)
%14 = load float, float* %8
%15 = load float, float* %6
%16 = fsub float %14, %15
%17 = call float @pow(float %16, i32 2)
%18 = fadd float %13, %17
store float %18, float* %9
%19 = load float, float* %9
%20 = call float @sqrt(float %19)
store float %20, float* %9
%21 = load float, float* %9
%22 = call float @fabs(float %21)
ret float %22
}

LLVM IR (-O2):
define float @dist(float %0, float %1, float %2, float %3) {
%5 = fsub float %2, %0
%6 = tail call float @pow(float %5, i32 2)
%7 = fsub float %3, %1
%8 = tail call float @pow(float %7, i32 2)
%9 = fadd float %6, %8
%10 = tail call float @sqrt(float %9)
%11 = tail call float @llvm.fabs.f32(float %10)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n = 31;
  char s[256];
  printf("%d\n", n);
  itob(n, s, 16);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    -0x110(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    $0x1f,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    $0x1f,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1050 <itob@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 31)
%4 = call i32 @itob(i32 31, i8* %2, i32 16)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
void proc27() {}


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

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

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

LLVM IR (-O2):
define void @proc27() {
ret void
}
/* Variables and functions */
char *normalize_path(char *, char);
char *win_path(char *str) { return normalize_path(str, '\\'); }


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

x86 assembly (clang, -O2):
<win_path>:
mov    $0x5c,%esi
jmp    1030 <normalize_path@plt>

LLVM IR (-O0):
define i8* @win_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @normalize_path(i8* %3, i8 signext 92)
ret i8* %4
}

LLVM IR (-O2):
define i8* @win_path(i8* %0) {
%2 = tail call i8* @normalize_path(i8* %0, i8 signext 92)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ initDefaultRAMAllocationPoint();
int /*<<< orphan*/ init_memory_lock();
void initGC(void) {
  init_memory_lock();
  initDefaultRAMAllocationPoint();
}


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

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

LLVM IR (-O0):
define void @initGC() {
%1 = call i32 (...) @init_memory_lock()
%2 = call i32 (...) @initDefaultRAMAllocationPoint()
ret void
}

LLVM IR (-O2):
define void @initGC() {
%1 = tail call i32 (...) @init_memory_lock()
%2 = tail call i32 (...) @initDefaultRAMAllocationPoint()
ret void
}
unsigned long SIO1_readMode32(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1_readMode32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_readMode32() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ isxdigit(char);
unsigned int hexlen(char *str) {
  unsigned int sum = 0;
  while (1) {
    char chh = *str;
    if (!isxdigit(chh))
      break;
    str++;
    sum++;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<hexlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    1143 <hexlen+0x33>
jmp    115d <hexlen+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hexlen+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexlen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isxdigit@plt>
add    $0x1,%rbx
add    $0x1,%ebp
test   %eax,%eax
jne    1120 <hexlen+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i8* [ %0, %1 ], [ %8, %2 ]
%5 = load i8, i8* %4
%6 = tail call i32 @isxdigit(i8 signext %5)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = add i32 %3, 1
br i1 %7, label %10, label %2
10: ; preds = %2
ret i32 %3
}
/* Type definitions */
struct sysinfo {
  long uptime;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
long uptime(void) {
  struct sysinfo info;
  sysinfo(&info);
  return info.uptime;
}


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

x86 assembly (clang, -O2):
<uptime>:
push   %rax
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i64 }
define i64 @uptime() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
%struct.sysinfo = type { i64 }
define i64 @uptime() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
void gf8mul_00001001(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm6\n"
                       "\tpxor    %xmm7, %xmm5\n"
                       "\tpxor    %xmm7, %xmm3\n"
                       "\tpxor    %xmm7, %xmm1\n"
                       "\tpxor    %xmm7, %xmm0\n"
                       "\tpxor    %xmm6, %xmm7\n"
                       "\tpxor    %xmm6, %xmm5\n"
                       "\tpxor    %xmm6, %xmm4\n"
                       "\tpxor    %xmm6, %xmm3\n"
                       "\tpxor    %xmm6, %xmm2\n"
                       "\tpxor    %xmm6, %xmm1\n"
                       "\tpxor    %xmm6, %xmm0\n"
                       "\tpxor    %xmm7, %xmm6\n"
                       "\tpxor    %xmm5, %xmm7\n"
                       "\tpxor    %xmm5, %xmm4\n"
                       "\tpxor    %xmm5, %xmm2\n"
                       "\tpxor    %xmm5, %xmm0\n"
                       "\tpxor    %xmm7, %xmm5\n"
                       "\tpxor    %xmm4, %xmm7\n"
                       "\tpxor    %xmm3, %xmm6\n"
                       "\tpxor    %xmm2, %xmm5\n"
                       "\tpxor    %xmm1, %xmm4\n"
                       "\tpxor    %xmm0, %xmm3\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm6
pxor   %xmm7,%xmm5
pxor   %xmm7,%xmm3
pxor   %xmm7,%xmm1
pxor   %xmm7,%xmm0
pxor   %xmm6,%xmm7
pxor   %xmm6,%xmm5
pxor   %xmm6,%xmm4
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm6,%xmm1
pxor   %xmm6,%xmm0
pxor   %xmm7,%xmm6
pxor   %xmm5,%xmm7
pxor   %xmm5,%xmm4
pxor   %xmm5,%xmm2
pxor   %xmm5,%xmm0
pxor   %xmm7,%xmm5
pxor   %xmm4,%xmm7
pxor   %xmm3,%xmm6
pxor   %xmm2,%xmm5
pxor   %xmm1,%xmm4
pxor   %xmm0,%xmm3
pop    %rbp
ret

x86 assembly (clang, -O2):
pxor   %xmm7,%xmm6
pxor   %xmm7,%xmm5
pxor   %xmm7,%xmm3
pxor   %xmm7,%xmm1
pxor   %xmm7,%xmm0
pxor   %xmm6,%xmm7
pxor   %xmm6,%xmm5
pxor   %xmm6,%xmm4
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm6,%xmm1
pxor   %xmm6,%xmm0
pxor   %xmm7,%xmm6
pxor   %xmm5,%xmm7
pxor   %xmm5,%xmm4
pxor   %xmm5,%xmm2
pxor   %xmm5,%xmm0
pxor   %xmm7,%xmm5
pxor   %xmm4,%xmm7
pxor   %xmm3,%xmm6
pxor   %xmm2,%xmm5
pxor   %xmm1,%xmm4
pxor   %xmm0,%xmm3
ret

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

LLVM IR (-O2):
define void @gf8mul_00001001() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm6\0A\09pxor %xmm7, %xmm5\0A\09pxor %xmm7, %xmm3\0A\09pxor %xmm7, %xmm1\0A\09pxor %xmm7, %xmm0\0A\09pxor %xmm6, %xmm7\0A\09pxor %xmm6, %xmm5\0A\09pxor %xmm6, %xmm4\0A\09pxor %xmm6, %xmm3\0A\09pxor %xmm6, %xmm2\0A\09pxor %xmm6, %xmm1\0A\09pxor %xmm6, %xmm0\0A\09pxor %xmm7, %xmm6\0A\09pxor %xmm5, %xmm7\0A\09pxor %xmm5, %xmm4\0A\09pxor %xmm5, %xmm2\0A\09pxor %xmm5, %xmm0\0A\09pxor %xmm7, %xmm5\0A\09pxor %xmm4, %xmm7\0A\09pxor %xmm3, %xmm6\0A\09pxor %xmm2, %xmm5\0A\09pxor %xmm1, %xmm4\0A\09pxor %xmm0, %xmm3\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset();
void nand_init() {
  (*(volatile unsigned long *)0x70200000) |=
      ((0x2 << 12) | (0xf << 8) | (0x7 << 4));
  (*(volatile unsigned long *)0x70200004) = 1 | (1 << 1);
  reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200000,%eax
mov    (%rax),%rcx
or     $0x2f70,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200004,%eax
movq   $0x3,(%rax)
mov    $0x0,%al
call   1030 <reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
orq    $0x2f70,0x70200000
movq   $0x3,0x70200004
xor    %eax,%eax
jmp    1030 <reset@plt>

LLVM IR (-O0):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%2 = or i64 %1, 12144
store volatile i64 %2, i64* inttoptr (i64 1881145344 to i64*)
store volatile i64 3, i64* inttoptr (i64 1881145348 to i64*)
%3 = call i32 (...) @reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%2 = or i64 %1, 12144
store volatile i64 %2, i64* inttoptr (i64 1881145344 to i64*)
store volatile i64 3, i64* inttoptr (i64 1881145348 to i64*)
%3 = tail call i32 (...) @reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end_interface() {
  if (0)
    printf("End interface\n");
}


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

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

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

LLVM IR (-O2):
define void @end_interface() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int mapcon_coefficients_of_map(int dim, int ind, int nvr, double *cff) {
  int a[3], *b, fail;
  a[0] = dim;
  a[1] = ind;
  a[2] = nvr;
  fail = _ada_use_c2phc4c(436, a, b, cff, 0);
  return fail;
}


x86 assembly (clang, -O0):
<mapcon_coefficients_of_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1b4,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapcon_coefficients_of_map>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x1b4,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @mapcon_coefficients_of_map(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca [3 x i32]
%10 = alloca i32*
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%19 = load i32*, i32** %10
%20 = load double*, double** %8
%21 = call i32 @_ada_use_c2phc4c(i32 436, i32* %18, i32* %19, double* %20, i32 0)
store i32 %21, i32* %11
%22 = load i32, i32* %11
ret i32 %22
}

LLVM IR (-O2):
define i32 @mapcon_coefficients_of_map(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc4c(i32 436, i32* %7, i32* undef, double* %3, i32 0)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Print(int A[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", A[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<Print>:
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    1159 <Print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <Print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <Print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @Print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}