xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aligned_free(void *ptr) {
  if (ptr != NULL)
    free(((void **)ptr)[-1]);
}


x86 assembly (clang, -O0):
<aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <aligned_free+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_free>:
test   %rdi,%rdi
je     111e <aligned_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ byte_swap_short(short *, int /*<<< orphan*/);
void byte_swap_ushort(ushort *buffer, uint number_of_swaps) {
  byte_swap_short((short *)buffer, number_of_swaps);
}


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

x86 assembly (clang, -O2):
<byte_swap_ushort>:
jmp    1030 <byte_swap_short@plt>

LLVM IR (-O0):
define void @byte_swap_ushort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i16*
%7 = load i32, i32* %4
%8 = call i32 @byte_swap_short(i16* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @byte_swap_ushort(i32* %0, i32 %1) {
%3 = bitcast i32* %0 to i16*
%4 = tail call i32 @byte_swap_short(i16* %3, i32 %1)
ret void
}
int xbee_is_start_byte(unsigned char byte) { return (byte == 0x7E) ? 1 : 0; }


x86 assembly (clang, -O0):
<xbee_is_start_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x7e,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbee_is_start_byte>:
xor    %eax,%eax
cmp    $0x7e,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @xbee_is_start_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 126
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @xbee_is_start_byte(i8 zeroext %0) {
%2 = icmp eq i8 %0, 126
%3 = zext i1 %2 to i32
ret i32 %3
}
int enselftest(int verbose) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @enselftest(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ XExtCodes;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XExtCodes(void) {
  XExtCodes *_p = (XExtCodes *)malloc(sizeof(XExtCodes));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XExtCodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XExtCodes+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XExtCodes>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XExtCodes+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XExtCodes() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XExtCodes() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
double _Complex div_double_rr(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<div_double_rr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_double_rr>:
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ret

LLVM IR (-O0):
define { double, double } @div_double_rr(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fdiv double %6, %7
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %8, double* %9
store double 0.000000e+00, double* %10
%11 = load { double, double }, { double, double }* %3
ret { double, double } %11
}

LLVM IR (-O2):
define { double, double } @div_double_rr(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = insertvalue { double, double } poison, double %3, 0
%5 = insertvalue { double, double } %4, double 0.000000e+00, 1
ret { double, double } %5
}
int my_compute_square_root(int nb) {
  int stock = nb;
  if (nb < 0)
    return (0);
  while (stock > 0) {
    if (stock * stock == nb)
      return (stock);
    else
      stock--;
  }
  return (stock);
}


x86 assembly (clang, -O0):
<my_compute_square_root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1123 <my_compute_square_root+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1161 <my_compute_square_root+0x61>
jmp    1128 <my_compute_square_root+0x28>
cmpl   $0x0,-0xc(%rbp)
jle    115b <my_compute_square_root+0x5b>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114d <my_compute_square_root+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <my_compute_square_root+0x61>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <my_compute_square_root+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_compute_square_root>:
xor    %eax,%eax
test   %edi,%edi
jle    1123 <my_compute_square_root+0x23>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1124 <my_compute_square_root+0x24>
lea    -0x1(%rcx),%edx
cmp    $0x1,%ecx
mov    %edx,%ecx
jg     1110 <my_compute_square_root+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_compute_square_root(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = icmp sgt i32 %4, 1
br i1 %9, label %3, label %10
10: ; preds = %3, %7, %1
%11 = phi i32 [ 0, %1 ], [ %4, %3 ], [ 0, %7 ]
ret i32 %11
}
int iswhite(unsigned char c) {
  return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
}


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <iswhite+0x4d>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <iswhite+0x4d>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <iswhite+0x4d>
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0x20,%dil
ja     111e <iswhite+0x1e>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111e <iswhite+0x1e>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @iswhite(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @iswhite(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void prune_alias_lt_Ok(int x) {
  int a[1];
  if (x < x) {
    a[1] = 0;
  }
}


x86 assembly (clang, -O0):
<prune_alias_lt_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    111a <prune_alias_lt_Ok+0x1a>
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_alias_lt_Ok(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 1
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @prune_alias_lt_Ok(i32 %0) {
ret void
}
int test_imm_B4int32_reg(int val) { return ((val) & (0xB4 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_B4int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xb4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4int32_reg>:
test   $0xb4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B4int32_reg(i32 %0) {
%2 = and i32 %0, 180
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void EC_KEY_set_asn1_flag(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_set_asn1_flag() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void nocrash_putc() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    putc(42, f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1171 <nocrash_putc+0x41>
mov    -0x8(%rbp),%rsi
mov    $0x2a,%edi
call   1040 <putc@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_putc>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1162 <nocrash_putc+0x32>
mov    %rax,%rbx
mov    $0x2a,%edi
mov    %rax,%rsi
call   1040 <putc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_putc() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @putc(i32 42, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
int func1(void) {
  for (; 1;) {
    for (; 1;) {
      for (; 1;) {
        for (; 1;) {
          for (; 1;) {
            return (1);
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
test   $0x1,%al
jne    1113 <func1+0x13>
jmp    1183 <func1+0x83>
jmp    1118 <func1+0x18>
mov    $0x1,%al
test   $0x1,%al
jne    1127 <func1+0x27>
jmp    117e <func1+0x7e>
jmp    112c <func1+0x2c>
mov    $0x1,%al
test   $0x1,%al
jne    113b <func1+0x3b>
jmp    1179 <func1+0x79>
jmp    1140 <func1+0x40>
mov    $0x1,%al
test   $0x1,%al
jne    114f <func1+0x4f>
jmp    1174 <func1+0x74>
jmp    1154 <func1+0x54>
mov    $0x1,%al
test   $0x1,%al
jne    1163 <func1+0x63>
jmp    116f <func1+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1183 <func1+0x83>
jmp    1140 <func1+0x40>
jmp    112c <func1+0x2c>
jmp    1118 <func1+0x18>
jmp    1104 <func1+0x4>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float computeVelocity(float hours, int distance) {
  float velocity = distance / hours;
  printf("Estimated Velocity: %f \n", velocity);
  return velocity;
}


x86 assembly (clang, -O0):
<computeVelocity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeVelocity>:
push   %rax
cvtsi2ss %edi,%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
lea    0xeda(%rip),%rdi
movaps %xmm1,%xmm0
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Estimated Velocity: %f \0A\00"
define float @computeVelocity(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store float %0, float* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = load float, float* %3
%9 = fdiv float %7, %8
store float %9, float* %5
%10 = load float, float* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"Estimated Velocity: %f \0A\00"
define float @computeVelocity(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fdiv float %3, %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %4)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void command_tips(void) {
  printf("i: Insert key. e.g. i 1 4-7 9\n");
  printf("r: Remove key. e.g. r 1-100\n");
  printf("s: Search by key. e.g. s 41-60\n");
  printf("d: Dump the tree structure.\n");
  printf("q: quit.\n");
}


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

x86 assembly (clang, -O2):
<command_tips>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"i: Insert key. e.g. i 1 4-7 9\0A\00"
@.str.1 = [29 x i8] c"r: Remove key. e.g. r 1-100\0A\00"
@.str.2 = [32 x i8] c"s: Search by key. e.g. s 41-60\0A\00"
@.str.3 = [29 x i8] c"d: Dump the tree structure.\0A\00"
@.str.4 = [10 x i8] c"q: quit.\0A\00"
define void @command_tips() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"i: Insert key. e.g. i 1 4-7 9\00"
@str.5 = [28 x i8] c"r: Remove key. e.g. r 1-100\00"
@str.6 = [31 x i8] c"s: Search by key. e.g. s 41-60\00"
@str.7 = [28 x i8] c"d: Dump the tree structure.\00"
@str.8 = [9 x i8] c"q: quit.\00"
define void @command_tips() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.8, i64 0, i64 0))
ret void
}
void queue_destroy_data(void *data) {}


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

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

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

LLVM IR (-O2):
define void @queue_destroy_data(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int t3() {
  int x, y, z;
  int *a;
  a = &z;
  x = y;
  *a = 3;
  assert(x == y);
  assert(a == &z);
  return 0;
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0xc(%rbp),%rax
cmp    %rax,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @t3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32* %3, i32** %4
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32*, i32** %4
store i32 3, i32* %6
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32*, i32** %4
%13 = icmp eq i32* %12, %3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @t3() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
void ff_hevc_put_hevc_bi_w_qpel_hv16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv16_8_sse4() {
ret void
}
/* Variables and functions */
int _isdigit(char);
int /*<<< orphan*/ printf(char *, char, int);
int main(void) {
  char c;
  c = '0';
  printf("%c: %d\n", c, _isdigit(c));
  c = 'a';
  printf("%c: %d\n", c, _isdigit(c));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x30,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <_isdigit@plt>
mov    %eax,%edx
mov    -0x7(%rbp),%al
lea    0xeb2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movb   $0x61,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <_isdigit@plt>
mov    %eax,%edx
mov    -0x6(%rbp),%al
lea    0xe8b(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%c: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @_isdigit(i8 signext 48)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 48, i32 %1)
%3 = tail call i32 @_isdigit(i8 signext 97)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 97, i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test58(__m64 a, __m64 b) { return _mm_avg_pu16(a, b); }


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

x86 assembly (clang, -O2):
<test58>:
jmp    1030 <_mm_avg_pu16@plt>

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

LLVM IR (-O2):
define i32 @test58(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_avg_pu16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x35() {
  Assert_real((islower(53) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              270, ("islower should be 0 for 5"));
}


x86 assembly (clang, -O0):
<t_islower_0x35>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x10e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x35>:
push   %rax
mov    $0x35,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x10e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 5\00"
define void @t_islower_0x35() {
%1 = call i64 @islower(i32 53)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 5\00"
define void @t_islower_0x35() {
%1 = tail call i64 @islower(i32 53)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char reader_consume(char **str) {
  char c = **str;
  char *f = *str;
  f++;
  *str = f;
  return c;
}


x86 assembly (clang, -O0):
<reader_consume>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reader_consume>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define signext i8 @reader_consume(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ MyThreadYield();
int /*<<< orphan*/ printf(char *);
void t1(void *dummy) {
  printf("t1\n");
  MyThreadYield();
  printf("t1 again\n");
  MyThreadExit();
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <MyThreadYield@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <MyThreadExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <MyThreadYield@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MyThreadExit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"t1\0A\00"
@.str.1 = [10 x i8] c"t1 again\0A\00"
define void @t1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @MyThreadYield()
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @MyThreadExit()
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"t1\00"
@str.2 = [9 x i8] c"t1 again\00"
define void @t1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @MyThreadYield()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 (...) @MyThreadExit()
ret void
}
int dup2(int oldfd, int newfd) {
  int result;
  asm("movl $63, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(oldfd), "c"(newfd));
  return result;
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x10(%rbp),%ecx
mov    $0x3f,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%ebx
mov    $0x3f,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 asm "movl $$63, %eax;int $$0x80;", "={ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 asm "movl $$63, %eax;int $$0x80;", "={ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
void _swap(int *a, int *b) {
  int c = *a;
  *a = *b;
  *b = c;
}


x86 assembly (clang, -O0):
<_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int single_number(int *, int);
int main(void) {
  int result;
  int A[] = {11, 2, 3, 99, 11, 99, 2};
  result = single_number(A, 7);
  printf("The single number is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1040 <single_number@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <single_number@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [7 x i32] [i32 11, i32 2, i32 3, i32 99, i32 11, i32 99, i32 2]
@.str = [25 x i8] c"The single number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @single_number(i32* %5, i32 7)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [7 x i32] [i32 11, i32 2, i32 3, i32 99, i32 11, i32 99, i32 2]
@.str = [25 x i8] c"The single number is %d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @single_number(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *);
void cmd_error(void) { cprintf(" ?\n"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c" ?\0A\00"
define void @cmd_error() {
%1 = call i32 @cprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" ?\0A\00"
define void @cmd_error() {
%1 = tail call i32 @cprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
void cell_bytes(struct forth_instance *fi) {
  st_push(fi, (intptr_t)sizeof(intptr_t));
}


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

x86 assembly (clang, -O2):
<cell_bytes>:
mov    $0x8,%esi
jmp    1030 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @cell_bytes(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i32 @st_push(%struct.forth_instance* %3, i64 8)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @cell_bytes(%struct.forth_instance* %0) {
%2 = tail call i32 @st_push(%struct.forth_instance* %0, i64 8)
ret void
}
double quadratic_c(float c, double x) { return c * x * (1 - x); }


x86 assembly (clang, -O0):
<quadratic_c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_c>:
cvtss2sd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xef0(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @quadratic_c(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load double, double* %4
%8 = fmul double %6, %7
%9 = load double, double* %4
%10 = fsub double 1.000000e+00, %9
%11 = fmul double %8, %10
ret double %11
}

LLVM IR (-O2):
define double @quadratic_c(float %0, double %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, %1
%5 = fsub double 1.000000e+00, %1
%6 = fmul double %4, %5
ret double %6
}
/* Variables and functions */
double floor(double);
double limit_degrees180(double degrees) {
  double limited;
  degrees /= 180.0;
  limited = 180.0 * (degrees - floor(degrees));
  if (limited < 0)
    limited += 180.0;
  return limited;
}


x86 assembly (clang, -O0):
<limit_degrees180>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1181 <limit_degrees180+0x71>
movsd  0xe89(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_degrees180>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
call   1030 <floor@plt>
movapd (%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
movapd %xmm3,%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm3,%xmm0
orpd   %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @limit_degrees180(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.800000e+02
store double %5, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @llvm.floor.f64(double %7)
%9 = fsub double %6, %8
%10 = fmul double 1.800000e+02, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load double, double* %3
%15 = fadd double %14, 1.800000e+02
store double %15, double* %3
br label %16
16: ; preds = %13, %1
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @limit_degrees180(double %0) {
%2 = fdiv double %0, 1.800000e+02
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fsub double %2, %3
%5 = fmul double %4, 1.800000e+02
%6 = fcmp olt double %5, 0.000000e+00
%7 = fadd double %5, 1.800000e+02
%8 = select i1 %6, double %7, double %5
ret double %8
}
/* Variables and functions */
scalar_t__ is_attr_val(char const);
int __attr_val_len(const char *s) {
  int l;
  for (l = 0; is_attr_val(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__attr_val_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_attr_val@plt>
cmp    $0x0,%rax
je     1153 <__attr_val_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__attr_val_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__attr_val_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_attr_val@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__attr_val_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_attr_val@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__attr_val_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__attr_val_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_attr_val(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_attr_val(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
unsigned prepare_selector(int code, int time) { return code | (time << 8); }


x86 assembly (clang, -O0):
<prepare_selector>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_selector>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @prepare_selector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 8
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @prepare_selector(i32 %0, i32 %1) {
%3 = shl i32 %1, 8
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void array_print(int *A, int num) {
  int i;
  for (i = 0; i < num; i++)
    printf("%d, ", A[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<array_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <array_print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <array_print+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(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 olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __closedir(DIR *dirp) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__closedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__closedir>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__closedir(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__closedir(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}