xunge/DecIR huggingface dataset:
void endRepeating2RBRA() {}


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

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

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

LLVM IR (-O2):
define void @endRepeating2RBRA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n = 0;
  if (n < 0) {
    n = n * (-1);
  }
  if (n < 10000) {
    scanf("%d", &n);
    printf("%d", n * n);
  } else {
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1147 <main+0x27>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    117c <main+0x5c>
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
movl   $0x0,-0x4(%rbp)
jmp    118f <main+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
double fabs(double);
double k_bilin(double x, double a) {
  x = fabs(x);
  if (x <= 1.0)
    return 1 - x;
  else
    return 0;
}


x86 assembly (clang, -O0):
<k_bilin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xef6(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed5(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     114d <k_bilin+0x4d>
movsd  0xec2(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <k_bilin+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_bilin>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
cmpnlesd %xmm1,%xmm0
andnpd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @k_bilin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call double @llvm.fabs.f64(double %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp ole double %8, 1.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load double, double* %4
%12 = fsub double 1.000000e+00, %11
store double %12, double* %3
br label %14
13: ; preds = %2
store double 0.000000e+00, double* %3
br label %14
14: ; preds = %13, %10
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @k_bilin(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fcmp ugt double %3, 1.000000e+00
%5 = fsub double 1.000000e+00, %3
%6 = select i1 %4, double 0.000000e+00, double %5
ret double %6
}
/* Type definitions */
struct qu_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void obstack_chunk_free(struct qu_parser *ctx, void *ptr) {
  (void)ctx;
  free(ptr);
}


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

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

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

LLVM IR (-O2):
%struct.qu_parser = type { i32 }
define void @obstack_chunk_free(%struct.qu_parser* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
int print_binlog_rotate_event(struct rotate_event *event) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rotate_event = type opaque
define i32 @print_binlog_rotate_event(%struct.rotate_event* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char testopen(char *filename) {
  FILE *fptr;
  fptr = fopen(filename, "r");
  if (fptr != NULL) {
    fclose(fptr);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<testopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115d <testopen+0x3d>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movb   $0x1,-0x1(%rbp)
jmp    1161 <testopen+0x41>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define signext i8 @testopen(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 = %1, %4
%7 = phi i8 [ 1, %4 ], [ 0, %1 ]
ret i8 %7
}
/* Variables and functions */
int base64toValue(char const, unsigned char *);
size_t numberOfBase64Characters(const char *encodedString) {
  size_t length = 0;
  unsigned char junkChar;
  while (base64toValue(encodedString[length], &junkChar) != -1) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<numberOfBase64Characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rsi
movsbl (%rax,%rcx,1),%edi
call   1030 <base64toValue@plt>
cmp    $0xffffffff,%eax
je     1153 <numberOfBase64Characters+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <numberOfBase64Characters+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfBase64Characters>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
lea    0xf(%rsp),%r15
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
mov    %r15,%rsi
call   1030 <base64toValue@plt>
add    $0x1,%rbx
cmp    $0xffffffff,%eax
jne    1130 <numberOfBase64Characters+0x20>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @numberOfBase64Characters(i8* nocapture %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = call i32 @base64toValue(i8 signext %6, i8* %2)
%8 = icmp eq i32 %7, -1
%9 = add i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int y;
  int z;
  for (y = 0; y < 10; ++y)
    foo(y);
  for (z = 0; z < 100; ++z)
    foo(z);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    116d <main+0x5d>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x3d>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x7,%edi
call   1030 <foo@plt>
mov    $0x8,%edi
call   1030 <foo@plt>
mov    $0x9,%edi
call   1030 <foo@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <foo@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1180 <main+0x70>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @foo(i32 2)
%4 = tail call i32 @foo(i32 3)
%5 = tail call i32 @foo(i32 4)
%6 = tail call i32 @foo(i32 5)
%7 = tail call i32 @foo(i32 6)
%8 = tail call i32 @foo(i32 7)
%9 = tail call i32 @foo(i32 8)
%10 = tail call i32 @foo(i32 9)
br label %11
11: ; preds = %0, %11
%12 = phi i32 [ %14, %11 ], [ 0, %0 ]
%13 = tail call i32 @foo(i32 %12)
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, 100
br i1 %15, label %16, label %11
16: ; preds = %11
ret i32 1
}
/* Variables and functions */
void *__mingw_aligned_malloc(int, int);
int main() {
  void *result = __mingw_aligned_malloc(32 * sizeof(double), sizeof(double));
  return result ? 0 : -2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100,%edi
mov    $0x8,%esi
call   1030 <__mingw_aligned_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0xfffffffe,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x100,%edi
mov    $0x8,%esi
call   1030 <__mingw_aligned_malloc@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @__mingw_aligned_malloc(i32 256, i32 8)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 -2
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @__mingw_aligned_malloc(i32 256, i32 8)
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i32 -2, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, char const *const, char const *const);
scalar_t__ strcmp(char const *const, char const *const);
int string_equal_display_error(const char *const left,
                               const char *const right) {
  if (strcmp(left, right) == 0) {
    return 1;
  }
  print_error("                "
              "\"%s\" != \"%s\"\n",
              left, right);
  return 0;
}


x86 assembly (clang, -O0):
<string_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1153 <string_equal_display_error+0x33>
movl   $0x1,-0x4(%rbp)
jmp    116e <string_equal_display_error+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9e(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
test   %rax,%rax
je     114a <string_equal_display_error+0x2a>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <print_error@plt>
xor    %eax,%eax
jmp    114f <string_equal_display_error+0x2f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c" \22%s\22 != \22%s\22\0A\00"
define i32 @string_equal_display_error(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @print_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [30 x i8] c" \22%s\22 != \22%s\22\0A\00"
define i32 @string_equal_display_error(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @print_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ output_string(char *);
int /*<<< orphan*/ print_tab();
void output_with_tab(char ptr[]) {
  print_tab();
  output_string(ptr);
}


x86 assembly (clang, -O0):
<output_with_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <print_tab@plt>
mov    -0x8(%rbp),%rdi
call   1030 <output_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_with_tab>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <print_tab@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <output_string@plt>

LLVM IR (-O0):
define void @output_with_tab(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @print_tab()
%4 = load i8*, i8** %2
%5 = call i32 @output_string(i8* %4)
ret void
}

LLVM IR (-O2):
define void @output_with_tab(i8* %0) {
%2 = tail call i32 (...) @print_tab()
%3 = tail call i32 @output_string(i8* %0)
ret void
}
int compare(const void *d1, const void *d2) {
  unsigned int *data1 = (unsigned int *)d1;
  unsigned int *data2 = (unsigned int *)d2;
  if (*data1 < *data2) {
    return -1;
  }
  if (*data1 > *data2) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jae    113a <compare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jbe    1158 <compare+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <compare+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
%8 = icmp ugt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void _asm_generic1parm_end(void) {}


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

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

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

LLVM IR (-O2):
define void @_asm_generic1parm_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jwObj_raw(char *, char *);
void jwObj_null(char *key) { jwObj_raw(key, "null"); }


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

x86 assembly (clang, -O2):
<jwObj_null>:
lea    0xee9(%rip),%rsi
jmp    1030 <jwObj_raw@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
define void @jwObj_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @jwObj_raw(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define void @jwObj_null(i8* %0) {
%2 = tail call i32 @jwObj_raw(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct dw_ranges_struct {
  int dummy;
};

/* Variables and functions */
scalar_t__ ggc_test_and_set_mark(struct dw_ranges_struct *const);
void gt_ggc_mx_dw_ranges_struct(void *x_p) {
  struct dw_ranges_struct *const x = (struct dw_ranges_struct *)x_p;
  if (ggc_test_and_set_mark(x)) {
  }
}


x86 assembly (clang, -O0):
<gt_ggc_mx_dw_ranges_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ggc_test_and_set_mark@plt>
cmp    $0x0,%rax
je     113c <gt_ggc_mx_dw_ranges_struct+0x2c>
jmp    113c <gt_ggc_mx_dw_ranges_struct+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_ggc_mx_dw_ranges_struct>:
jmp    1030 <ggc_test_and_set_mark@plt>

LLVM IR (-O0):
%struct.dw_ranges_struct = type { i32 }
define void @gt_ggc_mx_dw_ranges_struct(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.dw_ranges_struct*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.dw_ranges_struct*
store %struct.dw_ranges_struct* %5, %struct.dw_ranges_struct** %3
%6 = load %struct.dw_ranges_struct*, %struct.dw_ranges_struct** %3
%7 = call i64 @ggc_test_and_set_mark(%struct.dw_ranges_struct* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.dw_ranges_struct = type { i32 }
define void @gt_ggc_mx_dw_ranges_struct(i8* %0) {
%2 = bitcast i8* %0 to %struct.dw_ranges_struct*
%3 = tail call i64 @ggc_test_and_set_mark(%struct.dw_ranges_struct* %2)
ret void
}
void m_copy(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    i++;
}


x86 assembly (clang, -O0):
<m_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <m_copy+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <m_copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <m_copy+0x10>
ret

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

LLVM IR (-O2):
define void @m_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ g(int);
int main() {
  int x;
  x = f(1);
  g(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @g(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pfring_zc_numa_get_cpu_node(int);
int /*<<< orphan*/ pfring_zc_numa_set_numa_affinity(int /*<<< orphan*/);
int bind2node(int core_id) {
  if (core_id < 0)
    return -1;
  pfring_zc_numa_set_numa_affinity(pfring_zc_numa_get_cpu_node(core_id));
  return 0;
}


x86 assembly (clang, -O0):
<bind2node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1141 <bind2node+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <bind2node+0x37>
mov    -0x8(%rbp),%edi
call   1040 <pfring_zc_numa_get_cpu_node@plt>
mov    %eax,%edi
call   1030 <pfring_zc_numa_set_numa_affinity@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind2node>:
test   %edi,%edi
js     1138 <bind2node+0x18>
push   %rax
call   1040 <pfring_zc_numa_get_cpu_node@plt>
mov    %eax,%edi
call   1030 <pfring_zc_numa_set_numa_affinity@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bind2node(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @pfring_zc_numa_get_cpu_node(i32 %0)
%5 = tail call i32 @pfring_zc_numa_set_numa_affinity(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %7
}
int double_compare(double a, double b) { return (a == b); }


x86 assembly (clang, -O0):
<double_compare>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_compare>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @double_compare(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @double_compare(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ aes_encrypt(unsigned char const *, int const,
                               unsigned char *, void *, unsigned char const *,
                               int);
void aes_256_encrypt(const unsigned char *plaintext, const int plaintext_len,
                     unsigned char ciphertext[], void *iv,
                     const unsigned char *key) {
  aes_encrypt(plaintext, plaintext_len, ciphertext, iv, key, 32);
}


x86 assembly (clang, -O0):
<aes_256_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x20,%r9d
call   1030 <aes_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_256_encrypt>:
mov    $0x20,%r9d
jmp    1030 <aes_encrypt@plt>

LLVM IR (-O0):
define void @aes_256_encrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @aes_encrypt(i8* %11, i32 %12, i8* %13, i8* %14, i8* %15, i32 32)
ret void
}

LLVM IR (-O2):
define void @aes_256_encrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @aes_encrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 32)
ret void
}
int get_direction(int n1, int n2) {
  if (n1 < n2) {
    return 1;
  } else if (n1 > n2) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_direction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <get_direction+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1141 <get_direction+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <get_direction+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <get_direction+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_direction>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_direction(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
int make_wireway_peer(char *srcname, char *dstname) {}


x86 assembly (clang, -O0):
<make_wireway_peer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @make_wireway_peer(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
double exp(double);
double pw(double p) { return exp(p); }


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

x86 assembly (clang, -O2):
<pw>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @pw(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
struct timeval time_now() {
  struct timeval t = {0, 0};
  gettimeofday(&t, NULL);
  return t;
}


x86 assembly (clang, -O0):
<time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_now>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @time_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = bitcast %struct.timeval* %1 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @time_now() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.timeval*
store i64 0, i64* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = load i64, i64* %1
ret i64 %4
}
/* Variables and functions */
unsigned short _BigUnsignedShort(unsigned short);
unsigned short BigUnsignedShort(unsigned short l) {
  return _BigUnsignedShort(l);
}


x86 assembly (clang, -O0):
<BigUnsignedShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <_BigUnsignedShort@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigUnsignedShort>:
jmp    1030 <_BigUnsignedShort@plt>

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

LLVM IR (-O2):
define zeroext i16 @BigUnsignedShort(i16 zeroext %0) {
%2 = tail call zeroext i16 @_BigUnsignedShort(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int in_byte(int);
int bgetc(int port) {
  while ((in_byte(port + 5) & 0x01) == 0)
    ;
  return (in_byte(port + 0) & 0x7F);
}


x86 assembly (clang, -O0):
<bgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x5,%edi
call   1030 <in_byte@plt>
and    $0x1,%eax
cmp    $0x0,%eax
jne    1137 <bgetc+0x27>
jmp    111b <bgetc+0xb>
mov    -0x4(%rbp),%edi
add    $0x0,%edi
call   1030 <in_byte@plt>
and    $0x7f,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgetc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x5(%rbx),%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <in_byte@plt>
test   $0x1,%al
je     1120 <bgetc+0x10>
mov    %ebx,%edi
call   1030 <in_byte@plt>
and    $0x7f,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bgetc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 5
%6 = call i32 @in_byte(i32 %5)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 0
%13 = call i32 @in_byte(i32 %12)
%14 = and i32 %13, 127
ret i32 %14
}

LLVM IR (-O2):
define i32 @bgetc(i32 %0) {
%2 = add nsw i32 %0, 5
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @in_byte(i32 %2)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = tail call i32 @in_byte(i32 %0)
%9 = and i32 %8, 127
ret i32 %9
}
/* Type definitions */
struct event_set {
  int dummy;
};

/* Variables and functions */
struct event_set *event_set_init_scalable(int *, unsigned int);
struct event_set *event_set_init_simple(int *, unsigned int);
struct event_set *event_set_init(int *maxevents, unsigned int flags) {
  if (flags & (1 << 1)) {
    return event_set_init_simple(maxevents, flags);
  } else {
    return event_set_init_scalable(maxevents, flags);
  }
}


x86 assembly (clang, -O0):
<event_set_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1153 <event_set_init+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <event_set_init_simple@plt>
mov    %rax,-0x8(%rbp)
jmp    1163 <event_set_init+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <event_set_init_scalable@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_set_init>:
test   $0x2,%sil
jne    112b <event_set_init+0xb>
jmp    1040 <event_set_init_scalable@plt>
jmp    1030 <event_set_init_simple@plt>

LLVM IR (-O0):
%struct.event_set = type { i32 }
define %struct.event_set* @event_set_init(i32* %0, i32 %1) {
%3 = alloca %struct.event_set*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = and i32 %6, 2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = call %struct.event_set* @event_set_init_simple(i32* %10, i32 %11)
store %struct.event_set* %12, %struct.event_set** %3
br label %17
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = call %struct.event_set* @event_set_init_scalable(i32* %14, i32 %15)
store %struct.event_set* %16, %struct.event_set** %3
br label %17
17: ; preds = %13, %9
%18 = load %struct.event_set*, %struct.event_set** %3
ret %struct.event_set* %18
}

LLVM IR (-O2):
%struct.event_set = type { i32 }
define %struct.event_set* @event_set_init(i32* %0, i32 %1) {
%3 = and i32 %1, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.event_set* @event_set_init_simple(i32* %0, i32 %1)
br label %9
7: ; preds = %2
%8 = tail call %struct.event_set* @event_set_init_scalable(i32* %0, i32 %1)
br label %9
9: ; preds = %7, %5
%10 = phi %struct.event_set* [ %6, %5 ], [ %8, %7 ]
ret %struct.event_set* %10
}
void do_not_used() {}


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

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

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

LLVM IR (-O2):
define void @do_not_used() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int spi_write(int, int *, int);
int do_sector_erase(int fd, int addr) {
  uint8_t buf[4] = {0xD8, (addr & 0xff0000) >> 16, (addr & 0xff00) >> 8,
                    addr & 0xff};
  return spi_write(fd, buf, 4);
}


x86 assembly (clang, -O0):
<do_sector_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xd8,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1030 <spi_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sector_erase>:
sub    $0x18,%rsp
mov    %esi,%eax
movl   $0xd8,(%rsp)
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,0x4(%rsp)
mov    %ecx,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <spi_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @do_sector_erase(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 216, i32* %6
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %4
%9 = and i32 %8, 16711680
%10 = ashr i32 %9, 16
store i32 %10, i32* %7
%11 = getelementptr inbounds i32, i32* %7, i64 1
%12 = load i32, i32* %4
%13 = and i32 %12, 65280
%14 = ashr i32 %13, 8
store i32 %14, i32* %11
%15 = getelementptr inbounds i32, i32* %11, i64 1
%16 = load i32, i32* %4
%17 = and i32 %16, 255
store i32 %17, i32* %15
%18 = load i32, i32* %3
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%20 = call i32 @spi_write(i32 %18, i32* %19, i32 4)
ret i32 %20
}

LLVM IR (-O2):
define i32 @do_sector_erase(i32 %0, i32 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
store i32 216, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%7 = lshr i32 %1, 16
%8 = and i32 %7, 255
store i32 %8, i32* %6
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%10 = lshr i32 %1, 8
%11 = and i32 %10, 255
store i32 %11, i32* %9
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%13 = and i32 %1, 255
store i32 %13, i32* %12
%14 = call i32 @spi_write(i32 %0, i32* %5, i32 4)
ret i32 %14
}
void transfer_char(char **s, char c) {
  if (c != 0) {
    **s = c;
    ++*s;
  }
}


x86 assembly (clang, -O0):
<transfer_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     1135 <transfer_char+0x35>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_char>:
test   %sil,%sil
je     110f <transfer_char+0xf>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @transfer_char(i8** nocapture %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
store i8 %1, i8* %5
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  double arr[1000];
  double a, b;
  int i;
  for (i = 0; i < 1000; i++)
    arr[i] = 4294967296.0 + (double)i;
  a = arr[0];
  b = (unsigned int)((unsigned long long int)a % 4294967296ULL);
  if (b >= 4294967296.0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1f64(%rbp)
cmpl   $0x3e8,-0x1f64(%rbp)
jge    1174 <main+0x64>
cvtsi2sdl -0x1f64(%rbp),%xmm1
ff
movsd  0xeb4(%rip),%xmm0
addsd  %xmm1,%xmm0
movslq -0x1f64(%rbp),%rax
movsd  %xmm0,-0x1f50(%rbp,%rax,8)
ff ff
mov    -0x1f64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f64(%rbp)
jmp    112c <main+0x1c>
movsd  -0x1f50(%rbp),%xmm0
ff
movsd  %xmm0,-0x1f58(%rbp)
ff
movsd  -0x1f58(%rbp),%xmm0
ff
movsd  0xe74(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
mov    %eax,%ecx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %edx,%ecx
or     %ecx,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x1f60(%rbp)
ff
movsd  -0x1f60(%rbp),%xmm0
ff
movsd  0xe31(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11e0 <main+0xd0>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x1f70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x double]
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = fadd double 0x41F0000000000000, %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 %14
store double %12, double* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = getelementptr inbounds [1000 x double], [1000 x double]* %2, i64 0, i64 0
%21 = load double, double* %20
store double %21, double* %3
%22 = load double, double* %3
%23 = fptoui double %22 to i64
%24 = urem i64 %23, 4294967296
%25 = trunc i64 %24 to i32
%26 = uitofp i32 %25 to double
store double %26, double* %4
%27 = load double, double* %4
%28 = fcmp oge double %27, 0x41F0000000000000
br i1 %28, label %29, label %31
29: ; preds = %19
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct mlist {
  int dummy;
};
struct magic_set {
  int dummy;
};

/* Variables and functions */
struct mlist *file_apprentice(struct magic_set *, char const *, int);
int /*<<< orphan*/ free_mlist(struct mlist *);
int magic_list(struct magic_set *ms, const char *magicfile) {
  struct mlist *ml = file_apprentice(ms, magicfile, 3);
  free_mlist(ml);
  return ml ? 0 : -1;
}


x86 assembly (clang, -O0):
<magic_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1040 <file_apprentice@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free_mlist@plt>
mov    -0x18(%rbp),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic_list>:
push   %rbx
mov    $0x3,%edx
call   1040 <file_apprentice@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free_mlist@plt>
cmp    $0x1,%rbx
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.magic_set = type { i32 }
%struct.mlist = type { i32 }
define i32 @magic_list(%struct.magic_set* %0, i8* %1) {
%3 = alloca %struct.magic_set*
%4 = alloca i8*
%5 = alloca %struct.mlist*
store %struct.magic_set* %0, %struct.magic_set** %3
store i8* %1, i8** %4
%6 = load %struct.magic_set*, %struct.magic_set** %3
%7 = load i8*, i8** %4
%8 = call %struct.mlist* @file_apprentice(%struct.magic_set* %6, i8* %7, i32 3)
store %struct.mlist* %8, %struct.mlist** %5
%9 = load %struct.mlist*, %struct.mlist** %5
%10 = call i32 @free_mlist(%struct.mlist* %9)
%11 = load %struct.mlist*, %struct.mlist** %5
%12 = icmp ne %struct.mlist* %11, null
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 -1
ret i32 %14
}

LLVM IR (-O2):
%struct.magic_set = type { i32 }
%struct.mlist = type { i32 }
define i32 @magic_list(%struct.magic_set* %0, i8* %1) {
%3 = tail call %struct.mlist* @file_apprentice(%struct.magic_set* %0, i8* %1, i32 3)
%4 = tail call i32 @free_mlist(%struct.mlist* %3)
%5 = icmp eq %struct.mlist* %3, null
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int SET_ERRNO(int /*<<< orphan*/);
int setrlimit(int resource, const struct rlimit *rlp) {
  (void)resource;
  (void)rlp;
  return SET_ERRNO(ENOSYS);
}


x86 assembly (clang, -O0):
<setrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <SET_ERRNO@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setrlimit>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <SET_ERRNO@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @setrlimit(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* %3
%6 = load %struct.rlimit*, %struct.rlimit** %4
%7 = load i32, i32* @ENOSYS
%8 = call i32 @SET_ERRNO(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @setrlimit(i32 %0, %struct.rlimit* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @SET_ERRNO(i32 %3)
ret i32 %4
}