xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void QEIFilterEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= 0x00002000;
}


x86 assembly (clang, -O0):
<QEIFilterEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x2000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIFilterEnable>:
movslq %edi,%rax
orl    $0x2000,(%rax)
ret

LLVM IR (-O0):
define void @QEIFilterEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 8192
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @QEIFilterEnable(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 8192
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printBorder(int breite) {
  for (int i = 0; i < breite + 2; i++) {
    printf("A");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    114d <printBorder+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printBorder+0x12>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBorder>:
push   %rbx
cmp    $0xffffffff,%edi
jl     112f <printBorder+0x1f>
mov    %edi,%ebx
add    $0x2,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x41,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printBorder+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printBorder(i32 %0) {
%2 = icmp sgt i32 %0, -2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add i32 %0, 1
br label %7
5: ; preds = %7, %1
%6 = tail call i32 @putchar(i32 10)
ret void
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @putchar(i32 65)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %8, %4
br i1 %11, label %5, label %7
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int);
void cbmarch_iec_setrelease(int f, int set, int release) {
  ioctl(f, _IO(0xcb, 16), (set << 8) | release);
}


x86 assembly (clang, -O0):
<cbmarch_iec_setrelease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0x10,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_iec_setrelease>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0x10,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define void @cbmarch_iec_setrelease(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @_IO(i32 203, i32 16)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @cbmarch_iec_setrelease(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 16)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret void
}
char to_lowercase(char letter) {
  if (letter >= 'a' && letter <= 'z') {
    return letter;
  } else if (letter >= 'A' && letter <= 'Z')
    return letter + ('a' - 'A');
  else
    return 0;
}


x86 assembly (clang, -O0):
<to_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     112f <to_lowercase+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     112f <to_lowercase+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115c <to_lowercase+0x5c>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1158 <to_lowercase+0x58>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1158 <to_lowercase+0x58>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    115c <to_lowercase+0x5c>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lowercase>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
xor    %edx,%edx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edx,%eax
lea    -0x61(%rdi),%ecx
cmp    $0x1a,%cl
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @to_lowercase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %27
13: ; preds = %7, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %27
26: ; preds = %17, %13
store i8 0, i8* %2
br label %27
27: ; preds = %26, %21, %11
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @to_lowercase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = add i8 %0, 32
%7 = select i1 %5, i8 %6, i8 0
%8 = select i1 %3, i8 %0, i8 %7
ret i8 %8
}
unsigned long get_matrix_l(unsigned long **matrix, unsigned int x,
                           unsigned int y) {
  return (matrix[y])[x];
}


x86 assembly (clang, -O0):
<get_matrix_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_matrix_l>:
mov    %edx,%eax
mov    (%rdi,%rax,8),%rax
mov    %esi,%ecx
mov    (%rax,%rcx,8),%rax
ret

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

LLVM IR (-O2):
define i64 @get_matrix_l(i64** nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = getelementptr inbounds i64*, i64** %0, i64 %4
%6 = load i64*, i64** %5
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i64, i64* %6, i64 %7
%9 = load i64, i64* %8
ret i64 %9
}
int memagrep_init(argc, argv, pattern_len, pattern_buffer)
int argc;
char *argv[];
int pattern_len;
char *pattern_buffer;
{ return (agrep_init(argc, argv, -1, pattern_len, pattern_buffer)); }


x86 assembly (clang, -O0):
<memagrep_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <agrep_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memagrep_init>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    $0xffffffff,%edx
xor    %eax,%eax
jmp    1030 <agrep_init@plt>

LLVM IR (-O0):
define i32 @memagrep_init(i32 %0, i8** %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 (i32, i8**, i32, i32, i8*, ...) bitcast (i32 (...)* @agrep_init to i32 (i32, i8**, i32, i32, i8*, ...)*)(i32 %9, i8** %10, i32 -1, i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @memagrep_init(i32 %0, i8** %1, i32 %2, i8* %3) {
%5 = tail call i32 (i32, i8**, i32, i32, i8*, ...) bitcast (i32 (...)* @agrep_init to i32 (i32, i8**, i32, i32, i8*, ...)*)(i32 %0, i8** %1, i32 -1, i32 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_n(unsigned int, unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *,
                         unsigned int *);
int main() {
  unsigned a, b, scale;
  scanf("%u %u %u", &a, &b, &scale);
  print_n(a + b, scale);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <print_n@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%edi
add    0x14(%rsp),%edi
mov    0xc(%rsp),%esi
call   1030 <print_n@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%u %u %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @print_n(i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%u %u %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add i32 %9, %8
%11 = load i32, i32* %3
%12 = call i32 @print_n(i32 %10, i32 %11)
ret i32 0
}
int tcg_target_get_call_iarg_regs_count(int flags) { return 6; }


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

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

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

LLVM IR (-O2):
define i32 @tcg_target_get_call_iarg_regs_count(i32 %0) {
ret i32 6
}
void caller_1_2_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_2_1_2_1_2() {
ret void
}
unsigned Hash(char *name) {
  unsigned hashval;
  for (hashval = 0; *name != '\0'; name++)
    hashval = *name + 31 * hashval;
  return hashval % 250007;
}


x86 assembly (clang, -O0):
<Hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <Hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <Hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x3d097,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     114a <Hash+0x4a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <Hash+0x10>
mov    %eax,%ecx
imul   $0xc6d8d7b,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x11,%edx
imul   $0x3d097,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 250007
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void swap(double *v1, double *v2) {
  double temp = *v1;
  *v1 = *v2;
  *v2 = temp;
}


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

x86 assembly (clang, -O2):
<swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %3
store double %9, double* %10
%11 = load double, double* %5
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
int test_02(unsigned short tab[], int index) { return tab[index + 1]; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
movslq %esi,%rax
movzwl 0x2(%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @test_02(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i16, i16* %5, i64 %8
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_02(i16* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i16, i16* %0, i64 %4
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void breakHandler(int signo) {
  printf("break\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<breakHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<breakHandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"break\0A\00"
@stdout = global i32 0
define void @breakHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [6 x i8] c"break\00"
define void @breakHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int PECIDomainValid(unsigned long);
void PECIDomainMaxReadClear(unsigned long ulBase, unsigned long ulDomain) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  DEBUG_ASSERT(PECIDomainValid(ulDomain));
  (*((volatile unsigned long *)(ulBase + 0x00000040 + (ulDomain * 4)))) &=
      ~0xFFFF0000;
}


x86 assembly (clang, -O0):
<PECIDomainMaxReadClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
and    $0xffff,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainMaxReadClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
andq   $0xffff,0x40(%rbx,%r14,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PECIDomainMaxReadClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074462720
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @PECIDomainValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 64
%14 = load i64, i64* %4
%15 = mul i64 %14, 4
%16 = add i64 %13, %15
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = and i64 %18, 65535
store volatile i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @PECIDomainMaxReadClear(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074462720
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @PECIDomainValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = add i64 %0, 64
%9 = shl i64 %1, 2
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 65535
store volatile i64 %13, i64* %11
ret void
}
/* Variables and functions */
int test_calloc();
int test_heap_torture();
int test_malloc();
int test_realloc();
int test_valloc();
int test_heap(void) {
  return 0 + test_calloc() + test_valloc() + test_malloc() + test_realloc() +
         test_heap_torture();
}


x86 assembly (clang, -O0):
<test_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <test_calloc@plt>
add    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <test_valloc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <test_malloc@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_realloc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_heap_torture@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_heap>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <test_calloc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <test_valloc@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <test_malloc@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1050 <test_realloc@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1070 <test_heap_torture@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_heap() {
%1 = call i32 (...) @test_calloc()
%2 = add nsw i32 0, %1
%3 = call i32 (...) @test_valloc()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @test_malloc()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @test_realloc()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @test_heap_torture()
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_heap() {
%1 = tail call i32 (...) @test_calloc()
%2 = tail call i32 (...) @test_valloc()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @test_malloc()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @test_realloc()
%7 = add nsw i32 %5, %6
%8 = tail call i32 (...) @test_heap_torture()
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strncmp(char *, char *, int);
void Service(int client) {
  char buffer[1024];
  do
    send(client, buffer, recv(client, buffer, sizeof(buffer), 0), 0);
  while (strncmp(buffer, "bye\r", 4) != 0);
}


x86 assembly (clang, -O0):
<Service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x41c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    -0x41c(%rbp),%edi
mov    -0x418(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xe71(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    113e <Service+0xe>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Service>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
lea    0xeb8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1150 <Service+0x20>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"bye\0D\00"
define void @Service(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i32 @recv(i32 %0, i8* %3, i32 1024, i32 0)
%6 = call i32 @send(i32 %0, i8* %3, i32 %5, i32 0)
%7 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
ret void
}
void dns_cache_clear(struct dns_cache *cache) { return; }


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

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

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

LLVM IR (-O2):
%struct.dns_cache = type opaque
define void @dns_cache_clear(%struct.dns_cache* nocapture %0) {
ret void
}
int test_imm_4Dint32_mem(int *val) {
  return ((*val) & (0x4D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 77
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int main() {
  int ret_from_fork = -1, myPid;
  myPid = getpid();
  printf("Before: myPid is %d\n", myPid);
  ret_from_fork = fork();
  sleep(1);
  printf("After: myPid is %d, fork() said %d\n", getpid(), ret_from_fork);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <fork@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Before: myPid is %d\0A\00"
@.str.1 = [36 x i8] c"After: myPid is %d, fork() said %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%4 = call i32 (...) @getpid()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @fork()
store i32 %7, i32* %2
%8 = call i32 @sleep(i32 1)
%9 = call i32 (...) @getpid()
%10 = load i32, i32* %2
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Before: myPid is %d\0A\00"
@.str.1 = [36 x i8] c"After: myPid is %d, fork() said %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int swap16(int);
uint16_t rb_htole16(uint16_t x) {
  uint16_t test = 0x1234;
  unsigned char *p = (unsigned char *)&test;
  if (p[0] == 0x12) {
    return swap16(x);
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<rb_htole16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1234,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x12,%eax
jne    114a <rb_htole16+0x3a>
mov    -0x8(%rbp),%edi
call   1030 <swap16@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <rb_htole16+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_htole16>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rb_htole16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 4660, i32* %4
%6 = bitcast i32* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 18
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 @swap16(i32 %13)
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %3
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @rb_htole16(i32 returned %0) {
ret i32 %0
}
int __attribute__((no)) foo(unsigned int u) { return (int)(u + 4) < (int)u; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x7ffffffc,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 4
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 2147483643
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ FBrenderPutPixel(int, int, unsigned short);
int /*<<< orphan*/ FillCircle(int, int, int, unsigned short);
void PutLinePoint(int x, int y, unsigned short color, int width) {
  if (width > 1)
    FillCircle(x, y, width, color);
  else
    FBrenderPutPixel(x, y, color);
}


x86 assembly (clang, -O0):
<PutLinePoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    1159 <PutLinePoint+0x39>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
movzwl -0xa(%rbp),%ecx
call   1040 <FillCircle@plt>
jmp    1168 <PutLinePoint+0x48>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movzwl -0xa(%rbp),%edx
call   1030 <FBrenderPutPixel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutLinePoint>:
cmp    $0x2,%ecx
jl     1131 <PutLinePoint+0x11>
movzwl %dx,%eax
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1040 <FillCircle@plt>
movzwl %dx,%edx
jmp    1030 <FBrenderPutPixel@plt>

LLVM IR (-O0):
define void @PutLinePoint(i32 %0, i32 %1, i16 zeroext %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i16
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i16 %2, i16* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = load i16, i16* %7
%16 = call i32 @FillCircle(i32 %12, i32 %13, i32 %14, i16 zeroext %15)
br label %22
17: ; preds = %4
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = load i16, i16* %7
%21 = call i32 @FBrenderPutPixel(i32 %18, i32 %19, i16 zeroext %20)
br label %22
22: ; preds = %17, %11
ret void
}

LLVM IR (-O2):
define void @PutLinePoint(i32 %0, i32 %1, i16 zeroext %2, i32 %3) {
%5 = icmp sgt i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @FillCircle(i32 %0, i32 %1, i32 %3, i16 zeroext %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @FBrenderPutPixel(i32 %0, i32 %1, i16 zeroext %2)
br label %10
10: ; preds = %8, %6
ret void
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  long tv_sec;
};

/* Variables and functions */
void add_nanoseconds(struct timespec *t, long nanoseconds) {
  long newnano = t->tv_nsec + nanoseconds;
  t->tv_nsec = newnano % 1000000000L;
  t->tv_sec += newnano / 1000000000L;
}


x86 assembly (clang, -O0):
<add_nanoseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    -0x8(%rbp),%rax
mov    %rdx,(%rax)
mov    -0x18(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
add    0x8(%rax),%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_nanoseconds>:
add    (%rdi),%rsi
movabs $0x112e0be826d694b3,%rcx
0b 2e 11
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rax,%rdx
imul   $0x3b9aca00,%rdx,%rax
sub    %rax,%rsi
mov    %rsi,(%rdi)
add    %rdx,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @add_nanoseconds(%struct.timespec* %0, i64 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i64
%5 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store i64 %1, i64* %4
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = srem i64 %11, 1000000000
%13 = load %struct.timespec*, %struct.timespec** %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 0
store i64 %12, i64* %14
%15 = load i64, i64* %5
%16 = sdiv i64 %15, 1000000000
%17 = load %struct.timespec*, %struct.timespec** %3
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = add nsw i64 %19, %16
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @add_nanoseconds(%struct.timespec* nocapture %0, i64 %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = add nsw i64 %4, %1
%6 = srem i64 %5, 1000000000
store i64 %6, i64* %3
%7 = sdiv i64 %5, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
store i64 %10, i64* %8
ret void
}
void UART_putchar(char c) {
  while (!((*((volatile unsigned char *)0xE000C014)) & (1 << 6)))
    ;
  (*((volatile unsigned char *)0xE000C000)) = c;
}


x86 assembly (clang, -O0):
<UART_putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe000c014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <UART_putchar+0x2c>
jmp    1131 <UART_putchar+0x31>
jmp    110a <UART_putchar+0xa>
mov    -0x1(%rbp),%cl
mov    $0xe000c000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_putchar>:
mov    $0xe000c000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x40,0x14(%rax)
je     1110 <UART_putchar+0x10>
mov    %dil,(%rax)
ret

LLVM IR (-O0):
define void @UART_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 3758145556 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 64
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8, i8* %2
store volatile i8 %11, i8* inttoptr (i64 3758145536 to i8*)
ret void
}

LLVM IR (-O2):
define void @UART_putchar(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 3758145556 to i8*)
%4 = and i8 %3, 64
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 3758145536 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void connect() { printf("Just a placeholder...\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Just a placeholder...\0A\00"
define void @connect() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Just a placeholder...\00"
define void @connect() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((always_)) void end_edge_ioapic_irq(unsigned int irq) {}


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

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

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

LLVM IR (-O2):
define void @end_edge_ioapic_irq(i32 %0) {
ret void
}
int close(int fd) {
  int ret;
  asm("movl $6, %%eax\n\t"
      "int $0x80\n\t"
      "movl %%eax, %0"
      : "=m"(ret)
      : "m"(fd));
  return ret;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x6,%eax
int    $0x80
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    %edi,-0x4(%rsp)
mov    $0x6,%eax
int    $0x80
mov    %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %3
ret i32 %5
}
char *sigid2str(int sigid) {
  switch (sigid) {
  default:
    break;
  }
  return "UNKNOWN_SIGNAL";
}


x86 assembly (clang, -O0):
<sigid2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <sigid2str+0xc>
lea    0xeed(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"UNKNOWN_SIGNAL\00"
define i8* @sigid2str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
br label %5
5: ; preds = %4
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"UNKNOWN_SIGNAL\00"
define i8* @sigid2str(i32 %0) {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int qsort(int, int *, int /*<<< orphan*/, int);
int main(void) {
  int arr[15] = {43, 423, 13,  6,   34,   64,  24, 69,
                 32, 28,  432, 641, 4365, 345, 624};
  printf("%d\n", qsort(6, arr, 0, 15 - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x3c,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rsi
mov    $0x6,%edi
xor    %edx,%edx
mov    $0xe,%ecx
call   1030 <qsort@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
xor    %edx,%edx
mov    $0xe,%ecx
call   1030 <qsort@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [15 x i32] [i32 43, i32 423, i32 13, i32 6, i32 34, i32 64, i32 24, i32 69, i32 32, i32 28, i32 432, i32 641, i32 4365, i32 345, i32 624]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i32]
store i32 0, i32* %1
%3 = bitcast [15 x i32]* %2 to i8*
%4 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%5 = call i32 @qsort(i32 6, i32* %4, i32 0, i32 14)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [15 x i32] [i32 43, i32 423, i32 13, i32 6, i32 34, i32 64, i32 24, i32 69, i32 32, i32 28, i32 432, i32 641, i32 4365, i32 345, i32 624]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%4 = call i32 @qsort(i32 6, i32* %3, i32 0, i32 14)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ej3b1_1(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  ej3b1_1(host);
  exit(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)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ej3b1_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <ej3b1_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @ej3b1_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
void av_aes_ctr_set_iv() {}


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

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

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

LLVM IR (-O2):
define void @av_aes_ctr_set_iv() {
ret void
}
char *strdup(const char *src) {
  return ({
    extern __typeof__(strdup) module_libc_strdup;
    &module_libc_strdup;
  })(src);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
jmp    1030 <module_libc_strdup@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8* (i8*)*
store i8* %0, i8** %2
store i8* (i8*)* @module_libc_strdup, i8* (i8*)** %3
%4 = load i8* (i8*)*, i8* (i8*)** %3
%5 = load i8*, i8** %2
%6 = call i8* %4(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i8* @module_libc_strdup(i8* %0)
ret i8* %2
}