xunge/DecIR huggingface dataset:
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _list_splice(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_empty(struct list_head *);
int /*<<< orphan*/ list_init(struct list_head *);
void list_splice_init(struct list_head *list, struct list_head *head) {
  if (!list_empty(list)) {
    _list_splice(list, head);
    list_init(list);
  }
}


x86 assembly (clang, -O0):
<list_splice_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
jne    1168 <list_splice_init+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_list_splice@plt>
mov    -0x8(%rbp),%rdi
call   1040 <list_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <list_empty@plt>
test   %eax,%eax
je     114b <list_splice_init+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_list_splice@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_init@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @list_empty(%struct.list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @_list_splice(%struct.list_head* %9, %struct.list_head* %10)
%12 = load %struct.list_head*, %struct.list_head** %3
%13 = call i32 @list_init(%struct.list_head* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_empty(%struct.list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @_list_splice(%struct.list_head* %0, %struct.list_head* %1)
%7 = tail call i32 @list_init(%struct.list_head* %0)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int sin(float);
int sin_cycle(float time, float wavelength) {
  float rad = ((2 * 3.14) * time) / wavelength;
  return 128 * (1 + sin(rad));
}


x86 assembly (clang, -O0):
<sin_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x1,%eax
shl    $0x7,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_cycle>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
shl    $0x7,%eax
sub    $0xffffff80,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sin_cycle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fmul double 6.280000e+00, %7
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = fdiv double %8, %10
%12 = fptrunc double %11 to float
store float %12, float* %5
%13 = load float, float* %5
%14 = call i32 @sin(float %13)
%15 = add nsw i32 1, %14
%16 = mul nsw i32 128, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @sin_cycle(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 6.280000e+00
%5 = fpext float %1 to double
%6 = fdiv double %4, %5
%7 = fptrunc double %6 to float
%8 = tail call i32 @sin(float %7)
%9 = shl i32 %8, 7
%10 = add i32 %9, 128
ret i32 %10
}
/* Variables and functions */
char getch();
int ttyio_getch(void *ctx) {
  char input;
  input = getch();
  if (input == 0xd) {
    input = 0xa;
  } else if (input == 0) {
    input = -1;
  }
  return input;
}


x86 assembly (clang, -O0):
<ttyio_getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xd,%eax
jne    113c <ttyio_getch+0x2c>
movb   $0xa,-0x9(%rbp)
jmp    1152 <ttyio_getch+0x42>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    114d <ttyio_getch+0x3d>
movb   $0xff,-0x9(%rbp)
jmp    1152 <ttyio_getch+0x42>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyio_getch>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
cmp    $0x1,%al
sbb    %ecx,%ecx
or     %al,%cl
cmp    $0xd,%al
movzbl %cl,%eax
mov    $0xa,%ecx
cmovne %eax,%ecx
movsbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ttyio_getch(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = call signext i8 (...) @getch()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 13
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 10, i8* %3
br label %15
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 -1, i8* %3
br label %14
14: ; preds = %13, %9
br label %15
15: ; preds = %14, %8
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ttyio_getch(i8* nocapture readnone %0) {
%2 = tail call signext i8 (...) @getch()
%3 = icmp eq i8 %2, 13
%4 = icmp eq i8 %2, 0
%5 = select i1 %4, i8 -1, i8 %2
%6 = select i1 %3, i8 10, i8 %5
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Variables and functions */
size_t strcnt(char *s, char c) {
  size_t cnt = 0;
  for (char *p = s; *p; ++p) {
    if (*p == c) {
      ++cnt;
    }
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <strcnt+0x60>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <strcnt+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <strcnt+0x4f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <strcnt+0x1e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcnt>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strcnt+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strcnt+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strcnt(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i64 [ 0, %2 ], [ %13, %7 ]
ret i64 %6
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %3, %2 ]
%9 = phi i8* [ %14, %7 ], [ %0, %2 ]
%10 = phi i64 [ %13, %7 ], [ 0, %2 ]
%11 = icmp eq i8 %8, %1
%12 = zext i1 %11 to i64
%13 = add i64 %10, %12
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %5, label %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void other(void) { puts("You entered something other than 1 or 2"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"You entered something other than 1 or 2\00"
define void @other() {
%1 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"You entered something other than 1 or 2\00"
define void @other() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CINF;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CINF_it;
int i2d_X509_CINF(X509_CINF *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CINF_it);
}


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

x86 assembly (clang, -O2):
<i2d_X509_CINF>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@X509_CINF_it = global i32 0
define i32 @i2d_X509_CINF(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_CINF_it)
ret i32 %3
}
/* Variables and functions */
float exp10(float);
float EXP10(float x) { return exp10(x); }


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

x86 assembly (clang, -O2):
<EXP10>:
jmp    1030 <exp10@plt>

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

LLVM IR (-O2):
define float @EXP10(float %0) {
%2 = tail call float @exp10(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ deviceStart();
void *ThreadKernel(void *arg) {
  deviceStart();
  return 0;
}


x86 assembly (clang, -O0):
<ThreadKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <deviceStart@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadKernel>:
push   %rax
xor    %eax,%eax
call   1030 <deviceStart@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ThreadKernel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @deviceStart()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ThreadKernel(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @deviceStart()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ata_device_initialize();
void disk_initialize(void) { ata_device_initialize(); }


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

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

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

LLVM IR (-O2):
define void @disk_initialize() {
%1 = tail call i32 (...) @ata_device_initialize()
ret void
}
/* Variables and functions */
int check(char *);
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  int ret;
  if (ac != 2)
    return -1;
  ret = check(av[1]);
  if (ret == 0)
    printf("Win\n");
  else
    printf("loose\n");
  return ret;
}


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)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <main+0x69>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <check@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1177 <main+0x57>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x63>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cmp    $0x2,%edi
jne    114f <main+0x2f>
mov    0x8(%rsi),%rdi
call   1040 <check@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xec7(%rip),%rax
lea    0xeba(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"loose\00"
@str.2 = [4 x i8] c"Win\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @check(i8* %6)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ -1, %2 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ PowerManagerP__1__ResourceDefaultOwner__granted();
void ArbiterP__2__ResourceDefaultOwner__granted(void) {
  PowerManagerP__1__ResourceDefaultOwner__granted();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__2__ResourceDefaultOwner__granted() {
%1 = tail call i32 (...) @PowerManagerP__1__ResourceDefaultOwner__granted()
ret void
}
int ast_hashtab_resize_none(struct ast_hashtab *tab) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ast_hashtab = type opaque
define i32 @ast_hashtab_resize_none(%struct.ast_hashtab* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ ldexp(float const, int const);
float ldexpf(const float x, const int expn) { return (float)ldexp(x, expn); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
push   %rax
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call i64 @ldexp(float %5, i32 %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call i64 @ldexp(float %0, i32 %1)
%4 = sitofp i64 %3 to float
ret float %4
}
short member(group, grouplist, cnt)
short group;
short grouplist[4];
short cnt;
{
  unsigned short i;
  for (i = 0; i < cnt; i++)
    if (grouplist[i] == group)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<member>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%cx
mov    %dx,%ax
mov    %cx,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    1165 <member+0x65>
mov    -0x10(%rbp),%rax
movzwl -0x14(%rbp),%ecx
movswl (%rax,%rcx,2),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jne    114f <member+0x4f>
movw   $0x1,-0x2(%rbp)
jmp    116b <member+0x6b>
jmp    1154 <member+0x54>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    111c <member+0x1c>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<member>:
mov    %edx,%eax
shl    $0x10,%eax
test   %eax,%eax
jle    1135 <member+0x35>
movswl %dx,%eax
movswl %di,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzwl %dx,%edi
movswl (%rsi,%rdi,2),%edi
cmp    %edi,%ecx
je     1138 <member+0x38>
add    $0x1,%edx
movzwl %dx,%edi
cmp    %edi,%eax
jg     1120 <member+0x20>
xor    %eax,%eax
ret
mov    $0x1,%ax
ret

LLVM IR (-O0):
define signext i16 @member(i32 %0, i16* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16*
%7 = alloca i16
%8 = alloca i16
%9 = trunc i32 %0 to i16
%10 = trunc i32 %2 to i16
store i16 %9, i16* %5
store i16* %1, i16** %6
store i16 %10, i16* %7
store i16 0, i16* %8
br label %11
11: ; preds = %29, %3
%12 = load i16, i16* %8
%13 = zext i16 %12 to i32
%14 = load i16, i16* %7
%15 = sext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %32
17: ; preds = %11
%18 = load i16*, i16** %6
%19 = load i16, i16* %8
%20 = zext i16 %19 to i64
%21 = getelementptr inbounds i16, i16* %18, i64 %20
%22 = load i16, i16* %21
%23 = sext i16 %22 to i32
%24 = load i16, i16* %5
%25 = sext i16 %24 to i32
%26 = icmp eq i32 %23, %25
br i1 %26, label %27, label %28
27: ; preds = %17
store i16 1, i16* %4
br label %33
28: ; preds = %17
br label %29
29: ; preds = %28
%30 = load i16, i16* %8
%31 = add i16 %30, 1
store i16 %31, i16* %8
br label %11
32: ; preds = %11
store i16 0, i16* %4
br label %33
33: ; preds = %32, %27
%34 = load i16, i16* %4
ret i16 %34
}

LLVM IR (-O2):
define signext i16 @member(i32 %0, i16* nocapture %1, i32 %2) {
%4 = shl i32 %2, 16
%5 = ashr exact i32 %4, 16
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %21
7: ; preds = %3
%8 = shl i32 %0, 16
%9 = ashr exact i32 %8, 16
br label %13
10: ; preds = %13
%11 = zext i16 %20 to i32
%12 = icmp sgt i32 %5, %11
br i1 %12, label %13, label %21
13: ; preds = %7, %10
%14 = phi i16 [ 0, %7 ], [ %20, %10 ]
%15 = zext i16 %14 to i64
%16 = getelementptr inbounds i16, i16* %1, i64 %15
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = icmp eq i32 %9, %18
%20 = add i16 %14, 1
br i1 %19, label %21, label %10
21: ; preds = %13, %10, %3
%22 = phi i16 [ 0, %3 ], [ 0, %10 ], [ 1, %13 ]
ret i16 %22
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ message(int, char const *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void errno_msg(int severity, char const *fname) {
  message(severity, fname, "%s", strerror(errno));
}


x86 assembly (clang, -O0):
<errno_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%ecx
lea    0xea5(%rip),%rdx
call   1030 <message@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errno_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec3(%rip),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <message@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@errno = global i32 0
define void @errno_msg(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @message(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_popip(uint8_t r0) {
  return _bytecode_write(8, 0, 0, r0, 0, 0);
}


x86 assembly (clang, -O0):
<bytecode_popip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x8,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_popip>:
mov    %edi,%ecx
mov    $0x8,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_bytecode_write@plt>

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

LLVM IR (-O2):
define i32 @bytecode_popip(i32 %0) {
%2 = tail call i32 @_bytecode_write(i32 8, i32 0, i32 0, i32 %0, i32 0, i32 0)
ret i32 %2
}
void state_input_a(unsigned char value) {}


x86 assembly (clang, -O0):
<state_input_a>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @state_input_a(i8 zeroext %0) {
ret void
}
void arm_mrc2() {}


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

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

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

LLVM IR (-O2):
define void @arm_mrc2() {
ret void
}
int main(argc, argv)
int argc;
char *argv[];
{
  int i;
  for (i = 0; i < argc; i++) {
    printf("%s\n", argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1161 <main+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @puts(i8* dereferenceable(1) %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
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int /*<<< orphan*/ __bsd_iconv_open(char const *, char const *);
iconv_t iconv_open_compat(const char *a, const char *b) {
  return __bsd_iconv_open(a, b);
}


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

x86 assembly (clang, -O2):
<iconv_open_compat>:
jmp    1030 <__bsd_iconv_open@plt>

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

LLVM IR (-O2):
define i32 @iconv_open_compat(i8* %0, i8* %1) {
%3 = tail call i32 @__bsd_iconv_open(i8* %0, i8* %1)
ret i32 %3
}
void print_userIO_fn(char *strng) {
  printf("In Fn: %s(), User Input: %s\n", __FUNCTION__, strng);
}


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

x86 assembly (clang, -O2):
<print_userIO_fn>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xefc(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"In Fn: %s(), User Input: %s\0A\00"
@__FUNCTION__.print_userIO_fn = [16 x i8] c"print_userIO_fn\00"
define void @print_userIO_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.print_userIO_fn, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"In Fn: %s(), User Input: %s\0A\00"
@__FUNCTION__.print_userIO_fn = [16 x i8] c"print_userIO_fn\00"
define void @print_userIO_fn(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.print_userIO_fn, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <file_exists+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <file_exists+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double exp(int);
double pow(int, int);
double rho(double r) {
  return pow(r, 6.) * (exp(-4.043 * r) + pow(2., 9.) * exp(-2. * 4.043 * r));
}


x86 assembly (clang, -O0):
<rho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
mov    $0x6,%esi
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xebf(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x2,%edi
mov    $0x9,%esi
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe88(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rho>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
mov    $0x6,%esi
call   1040 <pow@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xeba(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  %xmm0,0x18(%rsp)
mov    $0x2,%edi
mov    $0x9,%esi
call   1040 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe8a(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @rho(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @pow(i32 %4, i32 6)
%6 = load double, double* %2
%7 = fmul double -4.043000e+00, %6
%8 = fptosi double %7 to i32
%9 = call double @exp(i32 %8)
%10 = call double @pow(i32 2, i32 9)
%11 = load double, double* %2
%12 = fmul double -8.086000e+00, %11
%13 = fptosi double %12 to i32
%14 = call double @exp(i32 %13)
%15 = call double @llvm.fmuladd.f64(double %10, double %14, double %9)
%16 = fmul double %5, %15
ret double %16
}

LLVM IR (-O2):
define double @rho(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @pow(i32 %2, i32 6)
%4 = fmul double %0, -4.043000e+00
%5 = fptosi double %4 to i32
%6 = tail call double @exp(i32 %5)
%7 = tail call double @pow(i32 2, i32 9)
%8 = fmul double %0, -8.086000e+00
%9 = fptosi double %8 to i32
%10 = tail call double @exp(i32 %9)
%11 = tail call double @llvm.fmuladd.f64(double %7, double %10, double %6)
%12 = fmul double %3, %11
ret double %12
}
int test_imm_A8uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xA8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A8uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 168
%5 = icmp ne i64 %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_A8uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 168
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char *xsalsa12poly1305_decrypt(unsigned char *, size_t *,
                                        unsigned char const *, size_t,
                                        unsigned char const *,
                                        unsigned char const *);
unsigned char *crypt_decrypt_xsalsa12poly1305(
    unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len,
    const unsigned char *nonce, const unsigned char *key) {
  return xsalsa12poly1305_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_xsalsa12poly1305>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <xsalsa12poly1305_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_xsalsa12poly1305>:
jmp    1030 <xsalsa12poly1305_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_xsalsa12poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @xsalsa12poly1305_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_xsalsa12poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @xsalsa12poly1305_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
int set_elec1_nvar(int nvar) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_elec1_nvar(i32 %0) {
ret i32 0
}
void Comp2_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Comp2_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Comp2_Handler+0x9>
jmp    1109 <Comp2_Handler+0x9>

x86 assembly (clang, -O2):
<Comp2_Handler>:
jmp    1100 <Comp2_Handler>

LLVM IR (-O0):
define void @Comp2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Comp2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
null_f2u(i, vf, cb, sht, flt, dub, intype, inmult, ubuf) int i, inmult, *vf;
char *cb, intype, *ubuf;
short *sht;
float *flt;
double *dub;
{}


x86 assembly (clang, -O0):
<null_f2u>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    %al,-0x31(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null_f2u(i32 %0, i32* %1, i8* %2, i16* %3, float* %4, double* %5, i32 %6, i32 %7, i8* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i16*
%15 = alloca float*
%16 = alloca double*
%17 = alloca i8
%18 = alloca i32
%19 = alloca i8*
%20 = trunc i32 %6 to i8
store i32 %0, i32* %11
store i32* %1, i32** %12
store i8* %2, i8** %13
store i16* %3, i16** %14
store float* %4, float** %15
store double* %5, double** %16
store i8 %20, i8* %17
store i32 %7, i32* %18
store i8* %8, i8** %19
%21 = load i32, i32* %10
ret i32 %21
}

LLVM IR (-O2):
define i32 @null_f2u(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i16* nocapture readnone %3, float* nocapture readnone %4, double* nocapture readnone %5, i32 %6, i32 %7, i8* nocapture readnone %8) {
ret i32 undef
}
int config_MODULE_CAMD35(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @config_MODULE_CAMD35() {
ret i32 0
}

LLVM IR (-O2):
define i32 @config_MODULE_CAMD35() {
ret i32 0
}
int ft_isgraph(int c) {
  if (c >= 33 && c <= 126)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x21,-0x8(%rbp)
jl     1127 <ft_isgraph+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <ft_isgraph+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isgraph+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isgraph(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 33
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(void **);
void *unused_peek(void **stack) {
  assert(stack);
  return *stack;
}


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

x86 assembly (clang, -O2):
<unused_peek>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @unused_peek(i8** %0) {
%2 = tail call i32 @assert(i8** %0)
%3 = load i8*, i8** %0
ret i8* %3
}
/* Variables and functions */
int test_simple_sampler(char *, int);
int test_always_sampler() { return test_simple_sampler("always", 1); }


x86 assembly (clang, -O0):
<test_always_sampler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <test_simple_sampler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_always_sampler>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <test_simple_sampler@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"always\00"
define i32 @test_always_sampler() {
%1 = call i32 @test_simple_sampler(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"always\00"
define i32 @test_always_sampler() {
%1 = tail call i32 @test_simple_sampler(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %1
}
void wideMultiply(unsigned a, unsigned b, unsigned *hi, unsigned *lo) {
  const unsigned long product = (unsigned long)a * b;
  *hi = product >> 32;
  *lo = product;
}


x86 assembly (clang, -O0):
<wideMultiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x20,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wideMultiply>:
mov    %edi,%eax
mov    %esi,%esi
imul   %rax,%rsi
mov    %rsi,%rax
shr    $0x20,%rax
mov    %eax,(%rdx)
mov    %esi,(%rcx)
ret

LLVM IR (-O0):
define void @wideMultiply(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = mul i64 %11, %13
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = lshr i64 %15, 32
%17 = trunc i64 %16 to i32
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i64, i64* %9
%20 = trunc i64 %19 to i32
%21 = load i32*, i32** %8
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @wideMultiply(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = zext i32 %0 to i64
%6 = zext i32 %1 to i64
%7 = mul nuw i64 %6, %5
%8 = lshr i64 %7, 32
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = trunc i64 %7 to i32
store i32 %10, i32* %3
ret void
}
void zorro_name_device(struct zorro_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.zorro_dev = type opaque
define void @zorro_name_device(%struct.zorro_dev* nocapture %0) {
ret void
}
int sb_has_quota_usage_enabled(struct super_block *sb, int type) { return 0; }


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define i32 @sb_has_quota_usage_enabled(%struct.super_block* %0, i32 %1) {
%3 = alloca %struct.super_block*
%4 = alloca i32
store %struct.super_block* %0, %struct.super_block** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @sb_has_quota_usage_enabled(%struct.super_block* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rt_thread_yield();
int sched_yield(void) {
  rt_thread_yield();
  return 0;
}


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

x86 assembly (clang, -O2):
<sched_yield>:
push   %rax
xor    %eax,%eax
call   1030 <rt_thread_yield@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sched_yield() {
%1 = call i32 (...) @rt_thread_yield()
ret i32 0
}

LLVM IR (-O2):
define i32 @sched_yield() {
%1 = tail call i32 (...) @rt_thread_yield()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shal() {
  printf("c = srcb&0x80;\n");
  printf("dst = srcb << 1;\n");
}


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

x86 assembly (clang, -O2):
<shal>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"c = srcb&0x80;\0A\00"
@.str.1 = [18 x i8] c"dst = srcb << 1;\0A\00"
define void @shal() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"c = srcb&0x80;\00"
@str.2 = [17 x i8] c"dst = srcb << 1;\00"
define void @shal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret void
}
void test_cargf(_Complex float f) {
  if (cargf(f) != cargf(f))
    link_failure_cargf();
}


x86 assembly (clang, -O0):
<test_cargf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cargf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cargf@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jne    118a <test_cargf+0x6a>
jp     118a <test_cargf+0x6a>
jmp    1191 <test_cargf+0x71>
mov    $0x0,%al
call   1040 <link_failure_cargf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cargf>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <cargf@plt>
movss  %xmm0,0xc(%rsp)
movaps 0x10(%rsp),%xmm0
call   1030 <cargf@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jne    114b <test_cargf+0x2b>
jnp    1156 <test_cargf+0x36>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <link_failure_cargf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @test_cargf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
%6 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%7 = load float, float* %6
%8 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %7, float* %10
store float %9, float* %11
%12 = bitcast { float, float }* %3 to <2 x float>*
%13 = load <2 x float>, <2 x float>* %12
%14 = call float @cargf(<2 x float> %13)
%15 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%16 = load float, float* %15
%17 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%20 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %16, float* %19
store float %18, float* %20
%21 = bitcast { float, float }* %4 to <2 x float>*
%22 = load <2 x float>, <2 x float>* %21
%23 = call float @cargf(<2 x float> %22)
%24 = fcmp une float %14, %23
br i1 %24, label %25, label %27
25: ; preds = %1
%26 = call i32 (...) @link_failure_cargf()
br label %27
27: ; preds = %25, %1
ret void
}

LLVM IR (-O2):
define void @test_cargf(<2 x float> %0) {
%2 = tail call float @cargf(<2 x float> %0)
%3 = tail call float @cargf(<2 x float> %0)
%4 = fcmp une float %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cargf()
br label %7
7: ; preds = %5, %1
ret void
}