xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(int);
int /*<<< orphan*/ *strchr(char *, int);
int is_separator(int c) {
  int result;
  result =
      ((isspace(c)) || (c == '\0') || (strchr(",.()+-/*=~%<>[];", c) != NULL));
  return result;
}


x86 assembly (clang, -O0):
<is_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    116d <is_separator+0x4d>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     116d <is_separator+0x4d>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_separator>:
push   %rbx
mov    %edi,%ebx
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %ebx,%ebx
je     1152 <is_separator+0x32>
test   %rcx,%rcx
jne    1152 <is_separator+0x32>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c",.()+-/*=~%<>[];\00"
define i32 @is_separator(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @isspace(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32* @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ne i32* %12, null
br label %14
14: ; preds = %10, %7, %1
%15 = phi i1 [ true, %7 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [17 x i8] c",.()+-/*=~%<>[];\00"
define i32 @is_separator(i32 %0) {
%2 = tail call i64 @isspace(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32* @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "c-sieve: usage: c-sieve [<limit>]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"c-sieve: usage: c-sieve [<limit>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"c-sieve: usage: c-sieve [<limit>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void print_number(int *ptr_int) {
  assert(ptr_int != NULL);
  printf("%d\n", *ptr_int);
}


x86 assembly (clang, -O0):
<print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_number>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%esi
lea    0xec5(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_number(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_number(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
main() {
  printf("hello\n");
  fork();
  printf("hello\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.1, i64 0, i64 0))
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
int tcdrain(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tcdrain(i32 %0) {
ret i32 0
}
void Render_PutDataWordPLUSNULL(int HorizontalCount, unsigned long GraphicsData,
                                int Line, unsigned long Mask, int *pPixels) {}


x86 assembly (clang, -O0):
<Render_PutDataWordPLUSNULL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Render_PutDataWordPLUSNULL(i32 %0, i64 %1, i32 %2, i64 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32*
store i32 %0, i32* %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32* %4, i32** %10
ret void
}

LLVM IR (-O2):
define void @Render_PutDataWordPLUSNULL(i32 %0, i64 %1, i32 %2, i64 %3, i32* nocapture %4) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t tag_arity(uint32_t tag) { return (uint32_t)(tag >> 3); }


x86 assembly (clang, -O0):
<tag_arity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_arity>:
mov    %edi,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @tag_arity(i32 %0) {
%2 = ashr i32 %0, 3
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int existe(char *nombreFichero) {
  FILE *pf = NULL;
  int exis = 0;
  if ((pf = fopen(nombreFichero, "r")) != NULL) {
    exis = 1;
    fclose(pf);
  }
  return exis;
}


x86 assembly (clang, -O0):
<existe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1169 <existe+0x49>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<existe>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <existe+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @existe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
store i32* null, i32** %3
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
store i32 1, i32* %4
%9 = load i32*, i32** %3
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @existe(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int func(double, ...);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int a = func(2, 3);
  int b = func(2.3);
  printf("%d %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeca(%rip),%xmm0
mov    $0x3,%edi
mov    $0x1,%al
call   1040 <func@plt>
mov    %eax,-0x14(%rbp)
movsd  0xeab(%rip),%xmm0
mov    $0x1,%al
call   1040 <func@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
mov    $0x3,%edi
mov    $0x1,%al
call   1040 <func@plt>
mov    %eax,%ebx
movsd  0xec9(%rip),%xmm0
mov    $0x1,%al
call   1040 <func@plt>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (double, ...) @func(double 2.000000e+00, i32 3)
store i32 %8, i32* %6
%9 = call i32 (double, ...) @func(double 2.300000e+00)
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (double, ...) @func(double 2.000000e+00, i32 3)
%4 = tail call i32 (double, ...) @func(double 2.300000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main(void) {
  int i;
  for (i = 0; i < 3000; ++i)
    (void)putchar(i % 10 + '0');
  (void)putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xbb8,-0x8(%rbp)
jge    1159 <main+0x49>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xbb8,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzwl %bx,%eax
imul   $0xcccd,%eax,%eax
shr    $0x12,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
mov    %ebx,%ecx
sub    %al,%cl
or     $0x30,%cl
movsbl %cl,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 3000
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 10
%9 = add nsw i32 %8, 48
%10 = trunc i32 %9 to i8
%11 = call i32 @putchar(i8 signext %10)
br label %12
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = trunc i32 %2 to i16
%4 = urem i16 %3, 10
%5 = trunc i16 %4 to i8
%6 = or i8 %5, 48
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 3000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NoDepB_func();
void NoDepA_func() { NoDepB_func(); }


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

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

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

LLVM IR (-O2):
define void @NoDepA_func() {
%1 = tail call i32 (...) @NoDepB_func()
ret void
}
long _sum(long EV_number) {
  long EV_total;
  EV_total = 0;
  while ((EV_number > 0)) {
    EV_total = (EV_total + EV_number);
    EV_number = (EV_number - 1);
  }
  return EV_total;
}


x86 assembly (clang, -O0):
<_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1138 <_sum+0x38>
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <_sum+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sum>:
test   %rdi,%rdi
jle    1126 <_sum+0x26>
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
imul   %rax,%rcx
lea    -0x2(%rdi),%rdx
mul    %rdx
shld   $0x3f,%rax,%rdx
add    %rdi,%rcx
sub    %rdx,%rcx
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @_sum(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i64 %0, -1
%5 = mul i64 %4, %4
%6 = zext i64 %4 to i65
%7 = add nsw i64 %0, -2
%8 = zext i64 %7 to i65
%9 = mul i65 %6, %8
%10 = lshr i65 %9, 1
%11 = trunc i65 %10 to i64
%12 = add i64 %5, %0
%13 = sub i64 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %13, %3 ]
ret i64 %15
}
void ARGBGrayTo() {}


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

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

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

LLVM IR (-O2):
define void @ARGBGrayTo() {
ret void
}
void *mem_malloc_debug(n, fil, lin)
unsigned n;
char *fil;
int lin;
{
  void *p;
  p = mem_calloc_debug(n, fil, lin);
  if (p)
    memset(p, 0xEE, n);
  return p;
}


x86 assembly (clang, -O0):
<mem_malloc_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <mem_calloc_debug@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1167 <mem_malloc_debug+0x47>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%eax
mov    %eax,%edx
mov    $0xee,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_malloc_debug>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <mem_calloc_debug@plt>
movslq %eax,%rbx
test   %ebx,%ebx
je     1142 <mem_malloc_debug+0x22>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    $0xee,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @mem_malloc_debug(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mem_calloc_debug to i32 (i32, i8*, i32, ...)*)(i32 %8, i8* %9, i32 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load i8*, i8** %7
%18 = load i32, i32* %4
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %16, %3
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
define i8* @mem_malloc_debug(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mem_calloc_debug to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %4, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = zext i32 %0 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %6, i8 -18, i64 %9, i1 false)
br label %10
10: ; preds = %8, %3
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_al(void) { m68ki_write_8(EA_AL_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_al>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AL_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_al>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AL_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bswap(int /*<<< orphan*/);
uint32_t be32dec(const void *buf) { return _bswap(*((uint32_t *)buf)); }


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

x86 assembly (clang, -O2):
<be32dec>:
mov    (%rdi),%edi
jmp    1030 <_bswap@plt>

LLVM IR (-O0):
define i32 @be32dec(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
%6 = call i32 @_bswap(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @be32dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @_bswap(i32 %3)
ret i32 %4
}
void RTReqRetain(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqRetain() {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutex_timedlock(pthread_mutex_t *a, const struct timespec *b) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_mutex_timedlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_timedlock>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @pthread_mutex_timedlock(i32* %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.timespec*
store i32* %0, i32** %4
store %struct.timespec* %1, %struct.timespec** %5
%6 = call i32 @assert(i32 0)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @pthread_mutex_timedlock(i32* nocapture readnone %0, %struct.timespec* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
int mDB_search(fn, idx, key, rows, dst) {
  return mDBi_msg('s', fn, idx, rows, key, 0, 0, dst);
}


x86 assembly (clang, -O0):
<mDB_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x14(%rbp),%eax
mov    $0x73,%edi
xor    %r9d,%r9d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_search>:
push   %rax
mov    %r8d,%r10d
mov    %edx,%r8d
mov    %esi,%edx
mov    %edi,%esi
mov    $0x73,%edi
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_search(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = load i32, i32* %8
%15 = load i32, i32* %10
%16 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 115, i32 %11, i32 %12, i32 %13, i32 %14, i32 0, i32 0, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @mDB_search(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 115, i32 %0, i32 %1, i32 %3, i32 %2, i32 0, i32 0, i32 %4)
ret i32 %6
}
void rop3_135_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_135_0_0>:
and    (%rdi),%sil
xor    %dl,%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_135_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_135_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, %2
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
void flip_convert(void) {}


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

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

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

LLVM IR (-O2):
define void @flip_convert() {
ret void
}
/* Variables and functions */
double DymolaTimerCounterSince(double *, int);
double MyCPUTime(void) {
  static int i = 0;
  static double d;
  double res = DymolaTimerCounterSince(&d, i);
  i = 1;
  return res;
}


x86 assembly (clang, -O0):
<MyCPUTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f12(%rip),%esi
lea    0x2f13(%rip),%rdi
call   1030 <DymolaTimerCounterSince@plt>
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,0x2ef7(%rip)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyCPUTime>:
push   %rax
movzbl 0x2f18(%rip),%esi
lea    0x2f19(%rip),%rdi
call   1030 <DymolaTimerCounterSince@plt>
movb   $0x1,0x2f05(%rip)
pop    %rax
ret

LLVM IR (-O0):
@MyCPUTime.i = internal global i32 0
@MyCPUTime.d = internal global double 0.000000e+00
define double @MyCPUTime() {
%1 = alloca double
%2 = load i32, i32* @MyCPUTime.i
%3 = call double @DymolaTimerCounterSince(double* @MyCPUTime.d, i32 %2)
store double %3, double* %1
store i32 1, i32* @MyCPUTime.i
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@MyCPUTime.i = internal unnamed_addr global i1 false
@MyCPUTime.d = internal global double 0.000000e+00
define double @MyCPUTime() {
%1 = load i1, i1* @MyCPUTime.i
%2 = zext i1 %1 to i32
%3 = tail call double @DymolaTimerCounterSince(double* @MyCPUTime.d, i32 %2)
store i1 true, i1* @MyCPUTime.i
ret double %3
}
int LRU_get(int *list) { return list[0]; }


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

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

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

LLVM IR (-O2):
define i32 @LRU_get(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void i2d_EC_PUBKEY_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_EC_PUBKEY_bio() {
ret void
}
int test_imm_77uint8_mem(unsigned char *val) {
  return ((*val) & (-0x77 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_77uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_77uint8_mem>:
testb  $0x89,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_77uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -119
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_77uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -119
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int create_quaddobl_Laurent_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(794, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<create_quaddobl_Laurent_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x31a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_quaddobl_Laurent_homotopy>:
mov    $0x31a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @create_quaddobl_Laurent_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 794, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @create_quaddobl_Laurent_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 794, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main() {
  sleep(2);
  fputs("OK\n", stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 2)
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"OK\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @sleep(i32 2)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ G_LuaInit();
int /*<<< orphan*/ G_LuaShutdown();
void Svcmd_LuaRestart_f(void) {
  G_LuaShutdown();
  G_LuaInit();
}


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

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

LLVM IR (-O0):
define void @Svcmd_LuaRestart_f() {
%1 = call i32 (...) @G_LuaShutdown()
%2 = call i32 (...) @G_LuaInit()
ret void
}

LLVM IR (-O2):
define void @Svcmd_LuaRestart_f() {
%1 = tail call i32 (...) @G_LuaShutdown()
%2 = tail call i32 (...) @G_LuaInit()
ret void
}
void hfi1_dbg_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @hfi1_dbg_exit() {
ret void
}
/* Variables and functions */
void clob1(int n) {
  char buf[512];
  char *cp;
  if (n <= 0)
    return;
  for (cp = buf; cp < &buf[512]; *cp++ = 0xFF)
    ;
  clob1(n - 1);
}


x86 assembly (clang, -O0):
<clob1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112d <clob1+0x1d>
jmp    1186 <clob1+0x76>
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x218(%rbp),%rax
lea    -0x210(%rbp),%rcx
add    $0x200,%rcx
cmp    %rcx,%rax
jae    117b <clob1+0x6b>
jmp    115e <clob1+0x4e>
mov    -0x218(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x218(%rbp)
movb   $0xff,(%rax)
jmp    113b <clob1+0x2b>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <clob1@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clob1>:
test   %edi,%edi
jle    1121 <clob1+0x11>
push   %rax
add    $0xffffffff,%edi
call   1030 <clob1@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clob1(i32 %0) {
%2 = alloca i32
%3 = alloca [512 x i8]
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %21
8: ; preds = %1
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
store i8* %9, i8** %4
br label %10
10: ; preds = %15, %8
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 512
%13 = icmp ult i8* %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
store i8 -1, i8* %16
br label %10
18: ; preds = %10
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 1
br label %21
21: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
define void @clob1(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ random();
uint32_t ws_random_mask() {
  if (sizeof(long) >= 4) {
    return (uint32_t)random();
  } else if (sizeof(long) == 2) {
    return (uint32_t)random() << 16 | (uint32_t)random();
  }
}


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

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

LLVM IR (-O0):
define i32 @ws_random_mask() {
%1 = call i64 (...) @random()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @ws_random_mask() {
%1 = tail call i64 (...) @random()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
struct cras_expr_value {
  int dummy;
};
struct cras_expr_env {
  int dummy;
};

/* Variables and functions */
struct cras_expr_value *find_or_insert_value(struct cras_expr_env *,
                                             char const *);
int /*<<< orphan*/ value_set_string(struct cras_expr_value *, char const *);
void cras_expr_env_set_variable_string(struct cras_expr_env *env,
                                       const char *name, const char *str) {
  struct cras_expr_value *value = find_or_insert_value(env, name);
  value_set_string(value, str);
}


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

x86 assembly (clang, -O2):
<cras_expr_env_set_variable_string>:
push   %rbx
mov    %rdx,%rbx
call   1040 <find_or_insert_value@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <value_set_string@plt>

LLVM IR (-O0):
%struct.cras_expr_env = type { i32 }
%struct.cras_expr_value = type { i32 }
define void @cras_expr_env_set_variable_string(%struct.cras_expr_env* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cras_expr_env*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.cras_expr_value*
store %struct.cras_expr_env* %0, %struct.cras_expr_env** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.cras_expr_env*, %struct.cras_expr_env** %4
%9 = load i8*, i8** %5
%10 = call %struct.cras_expr_value* @find_or_insert_value(%struct.cras_expr_env* %8, i8* %9)
store %struct.cras_expr_value* %10, %struct.cras_expr_value** %7
%11 = load %struct.cras_expr_value*, %struct.cras_expr_value** %7
%12 = load i8*, i8** %6
%13 = call i32 @value_set_string(%struct.cras_expr_value* %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.cras_expr_env = type { i32 }
%struct.cras_expr_value = type { i32 }
define void @cras_expr_env_set_variable_string(%struct.cras_expr_env* %0, i8* %1, i8* %2) {
%4 = tail call %struct.cras_expr_value* @find_or_insert_value(%struct.cras_expr_env* %0, i8* %1)
%5 = tail call i32 @value_set_string(%struct.cras_expr_value* %4, i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ floor(scalar_t__);
scalar_t__ sqrt(long);
long npix2nside(long npix) {
  long res = (long)floor(sqrt(npix / 12.) + 0.5);
  return res;
}


x86 assembly (clang, -O0):
<npix2nside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npix2nside>:
push   %rax
cvtsi2sd %rdi,%xmm0
divsd  0xed2(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xec0(%rip),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i64 @npix2nside(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i64
%8 = call i64 @sqrt(i64 %7)
%9 = sitofp i64 %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i64
%12 = call i64 @floor(i64 %11)
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @npix2nside(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fdiv double %2, 1.200000e+01
%4 = fptosi double %3 to i64
%5 = tail call i64 @sqrt(i64 %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i64
%9 = tail call i64 @floor(i64 %8)
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ strspn(int /*<<< orphan*/, char *);
int main(void) {
  const char *a = "abc";
  const char *b = a;
  strspn(b++, "");
  if (b != a + 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    %eax,%edi
lea    0xeb9(%rip),%rsi
call   1030 <strspn@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
je     1170 <main+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1177 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @strspn(i32 ptrtoint ([4 x i8]* @.str to i32), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void gdk_gc_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_get_type() {
ret void
}
void rop3_17_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | S;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_17_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_17_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helper(char *, char *, int *);
scalar_t__ malloc(int);
char *removeDuplicateLetters(char *s) {
  char *t = (char *)malloc(sizeof(char) * 27);
  int size = 0;
  helper(s, t, &size);
  t[size] = '\0';
  return t;
}


x86 assembly (clang, -O0):
<removeDuplicateLetters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1b,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <helper@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeDuplicateLetters>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1b,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <helper@plt>
movslq 0x4(%rsp),%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @removeDuplicateLetters(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i64 @malloc(i32 27)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
store i32 0, i32* %4
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = call i32 @helper(i8* %7, i8* %8, i32* %4)
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @removeDuplicateLetters(i8* %0) {
%2 = alloca i32
%3 = tail call i64 @malloc(i32 27)
%4 = inttoptr i64 %3 to i8*
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = call i32 @helper(i8* %0, i8* %4, i32* %2)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
ret i8* %4
}
int gcd(int primoNumero, int secondoNumero) {
  int temp;
  while (secondoNumero != 0) {
    temp = primoNumero % secondoNumero;
    primoNumero = secondoNumero;
    secondoNumero = temp;
  }
  return primoNumero;
}


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

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%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 = %9, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
void func_d() {}


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

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

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

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