xunge/DecIR huggingface dataset:
void smc_insw(unsigned int addr, void *vbuf, unsigned long len) {
  volatile unsigned short *rp;
  unsigned short *buf, *ebuf;
  buf = (unsigned short *)vbuf;
  rp = (volatile unsigned short *)addr;
  for (ebuf = buf + len; (buf < ebuf);)
    *buf++ = *rp;
}


x86 assembly (clang, -O0):
<smc_insw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    115d <smc_insw+0x5d>
mov    -0x20(%rbp),%rax
mov    (%rax),%cx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cx,(%rax)
jmp    1131 <smc_insw+0x31>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smc_insw>:
lea    (%rsi,%rdx,2),%rax
cmp    %rsi,%rax
jbe    111f <smc_insw+0x1f>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
movzwl (%rcx),%edx
mov    %dx,(%rsi)
add    $0x2,%rsi
cmp    %rax,%rsi
jb     1110 <smc_insw+0x10>
ret

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

LLVM IR (-O2):
define void @smc_insw(i32 %0, i8* writeonly %1, i64 %2) {
%4 = bitcast i8* %1 to i16*
%5 = zext i32 %0 to i64
%6 = inttoptr i64 %5 to i16*
%7 = getelementptr inbounds i16, i16* %4, i64 %2
%8 = icmp ugt i16* %7, %4
br i1 %8, label %9, label %14
9: ; preds = %3, %9
%10 = phi i16* [ %12, %9 ], [ %4, %3 ]
%11 = load volatile i16, i16* %6
%12 = getelementptr inbounds i16, i16* %10, i64 1
store i16 %11, i16* %10
%13 = icmp ult i16* %12, %7
br i1 %13, label %9, label %14
14: ; preds = %9, %3
ret void
}
int tickit_string_seqlen(long codepoint) {
  if (codepoint < 0x0000080)
    return 1;
  if (codepoint < 0x0000800)
    return 2;
  if (codepoint < 0x0010000)
    return 3;
  if (codepoint < 0x0200000)
    return 4;
  if (codepoint < 0x4000000)
    return 5;
  return 6;
}


x86 assembly (clang, -O0):
<tickit_string_seqlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x80,-0x10(%rbp)
jge    1122 <tickit_string_seqlen+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1191 <tickit_string_seqlen+0x91>
cmpq   $0x800,-0x10(%rbp)
jge    113c <tickit_string_seqlen+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    1191 <tickit_string_seqlen+0x91>
cmpq   $0x10000,-0x10(%rbp)
jge    1156 <tickit_string_seqlen+0x56>
movl   $0x3,-0x4(%rbp)
jmp    1191 <tickit_string_seqlen+0x91>
cmpq   $0x200000,-0x10(%rbp)
jge    1170 <tickit_string_seqlen+0x70>
movl   $0x4,-0x4(%rbp)
jmp    1191 <tickit_string_seqlen+0x91>
cmpq   $0x4000000,-0x10(%rbp)
04
jge    118a <tickit_string_seqlen+0x8a>
movl   $0x5,-0x4(%rbp)
jmp    1191 <tickit_string_seqlen+0x91>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tickit_string_seqlen>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jl     1147 <tickit_string_seqlen+0x47>
mov    $0x2,%eax
cmp    $0x800,%rdi
jb     1147 <tickit_string_seqlen+0x47>
mov    $0x3,%eax
cmp    $0x10000,%rdi
jb     1147 <tickit_string_seqlen+0x47>
mov    $0x4,%eax
cmp    $0x200000,%rdi
jb     1147 <tickit_string_seqlen+0x47>
cmp    $0x4000000,%rdi
mov    $0x6,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @tickit_string_seqlen(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %24
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp slt i64 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %24
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp slt i64 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %24
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp slt i64 %16, 2097152
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %24
19: ; preds = %15
%20 = load i64, i64* %3
%21 = icmp slt i64 %20, 67108864
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 5, i32* %2
br label %24
23: ; preds = %19
store i32 6, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @tickit_string_seqlen(i64 %0) {
%2 = icmp slt i64 %0, 128
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 2048
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 65536
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 2097152
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i64 %0, 67108864
%11 = select i1 %10, i32 5, i32 6
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ 4, %7 ], [ %11, %9 ]
ret i32 %13
}
double sgn(double v) { return (v >= 0) ? 1 : -1; }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @sgn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 -1
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @sgn(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = select i1 %2, double 1.000000e+00, double -1.000000e+00
ret double %3
}
void taktik3(int sagSensorDeger, int solSensorDeger, int ortaSensorDeger,
             int sagKenarDeger, int solKenarDeger, int motorHizi) {}


x86 assembly (clang, -O0):
<taktik3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @taktik3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(247, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @write_quaddobl_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 247, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int);
int main() {
  printf("Sum is %d\n", sum(1, 2, 3));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <sum@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sum(i32 1, i32 2, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void FMSTR_InitScope(void) {}


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

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

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

LLVM IR (-O2):
define void @FMSTR_InitScope() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { fprintf(stderr, "Print Help Messages\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Print Help Messages\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Print Help Messages\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_signal_segfault() {
  struct {
    int x;
  } *ptr = 0x0;
  ptr->x = 42;
  return 0;
}


x86 assembly (clang, -O0):
<test_signal_segfault>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @test_signal_segfault() {
%1 = alloca %struct.anon*
store %struct.anon* null, %struct.anon** %1
%2 = load %struct.anon*, %struct.anon** %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i32 42, i32* %3
ret i32 0
}

LLVM IR (-O2):
int do_554() { return 554; }


x86 assembly (clang, -O0):
<do_554>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_554() {
ret i32 554
}

LLVM IR (-O2):
define i32 @do_554() {
ret i32 554
}
/* Variables and functions */
int /*<<< orphan*/ findstringinstring(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char string[100], substring[100];
  printf("Enter two strings\n");
  scanf("%s", string);
  scanf("%s", substring);
  findstringinstring(string, substring);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <findstringinstring@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%r15
lea    0x70(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <findstringinstring@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter two strings\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @findstringinstring(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [18 x i8] c"Enter two strings\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = call i32 @findstringinstring(i8* %3, i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int st103_get_epreg(int /*<<< orphan*/);
int /*<<< orphan*/ st103_set_epreg(int /*<<< orphan*/, int);
void st103_ep_clear_dtog_tx(uint8_t ep_num) {
  uint16_t value = st103_get_epreg(ep_num);
  if ((value & (0x0040))) {
    value &= ((0x8000) | (0x0800) | (0x0600) | (0x0100) | (0x0080) | (0x000F));
    value |= (0x8000) | (0x0080) | (0x0040);
    st103_set_epreg(ep_num, value);
  }
}


x86 assembly (clang, -O0):
<st103_ep_clear_dtog_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <st103_get_epreg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1166 <st103_ep_clear_dtog_tx+0x46>
mov    -0x8(%rbp),%eax
and    $0x8f8f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x80c0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <st103_set_epreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_ep_clear_dtog_tx>:
push   %rbx
mov    %edi,%ebx
call   1040 <st103_get_epreg@plt>
test   $0x40,%al
jne    112e <st103_ep_clear_dtog_tx+0xe>
pop    %rbx
ret
and    $0xf0f,%eax
or     $0x80c0,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <st103_set_epreg@plt>

LLVM IR (-O0):
define void @st103_ep_clear_dtog_tx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @st103_get_epreg(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 64
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, 36751
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = or i32 %12, 32960
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @st103_set_epreg(i32 %14, i32 %15)
br label %17
17: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @st103_ep_clear_dtog_tx(i32 %0) {
%2 = tail call i32 @st103_get_epreg(i32 %0)
%3 = and i32 %2, 64
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = and i32 %2, 3855
%7 = or i32 %6, 32960
%8 = tail call i32 @st103_set_epreg(i32 %0, i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}
/* Variables and functions */
double M_PI;
float sqrt(float);
float rhoEnclosed(float mass, float r2) {
  float r3;
  r3 = r2 * sqrt(r2);
  return mass / (1.33333333 * M_PI * r3);
}


x86 assembly (clang, -O0):
<rhoEnclosed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea8(%rip),%xmm1
mov    0x2e89(%rip),%rax
mulsd  (%rax),%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rhoEnclosed>:
push   %rax
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jb     1125 <rhoEnclosed+0x15>
xorps  %xmm0,%xmm0
sqrtss %xmm1,%xmm0
jmp    1143 <rhoEnclosed+0x33>
movaps %xmm1,%xmm0
movss  %xmm2,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1030 <sqrt@plt>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mov    0x2e93(%rip),%rax
movsd  (%rax),%xmm2
mulsd  0xe9f(%rip),%xmm2
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define float @rhoEnclosed(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* %4
%7 = load float, float* %4
%8 = call float @sqrt(float %7)
%9 = fmul float %6, %8
store float %9, float* %5
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load double, double* @M_PI
%13 = fmul double 0x3FF55555547044B7, %12
%14 = load float, float* %5
%15 = fpext float %14 to double
%16 = fmul double %13, %15
%17 = fdiv double %11, %16
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define float @rhoEnclosed(float %0, float %1) {
%3 = tail call float @sqrt(float %1)
%4 = fmul float %3, %1
%5 = fpext float %0 to double
%6 = load double, double* @M_PI
%7 = fmul double %6, 0x3FF55555547044B7
%8 = fpext float %4 to double
%9 = fmul double %7, %8
%10 = fdiv double %5, %9
%11 = fptrunc double %10 to float
ret float %11
}
/* Variables and functions */
int atoi(char const *);
int db_sql_atoi(const char *what) { return what ? atoi(what) : 0; }


x86 assembly (clang, -O0):
<db_sql_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <db_sql_atoi+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0xc(%rbp)
jmp    1142 <db_sql_atoi+0x32>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <db_sql_atoi+0x32>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_sql_atoi>:
test   %rdi,%rdi
je     111a <db_sql_atoi+0xa>
jmp    1030 <atoi@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @db_sql_atoi(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @atoi(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @db_sql_atoi(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @atoi(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("hello world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello world.\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_A1uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xA1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A1uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 161
%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_A1uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 161
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ inb(scalar_t__);
uint8_t read_stat(uint16_t base) {
  inb(base + 7);
  inb(base + 7);
  inb(base + 7);
  inb(base + 7);
  return inb(base + 7);
}


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

x86 assembly (clang, -O2):
<read_stat>:
push   %rbx
mov    %rdi,%rbx
add    $0x7,%rbx
mov    %rbx,%rdi
call   1030 <inb@plt>
mov    %rbx,%rdi
call   1030 <inb@plt>
mov    %rbx,%rdi
call   1030 <inb@plt>
mov    %rbx,%rdi
call   1030 <inb@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <inb@plt>

LLVM IR (-O0):
define i32 @read_stat(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 7
%5 = call i32 @inb(i64 %4)
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 7
%8 = call i32 @inb(i64 %7)
%9 = load i64, i64* %2
%10 = add nsw i64 %9, 7
%11 = call i32 @inb(i64 %10)
%12 = load i64, i64* %2
%13 = add nsw i64 %12, 7
%14 = call i32 @inb(i64 %13)
%15 = load i64, i64* %2
%16 = add nsw i64 %15, 7
%17 = call i32 @inb(i64 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @read_stat(i64 %0) {
%2 = add nsw i64 %0, 7
%3 = tail call i32 @inb(i64 %2)
%4 = tail call i32 @inb(i64 %2)
%5 = tail call i32 @inb(i64 %2)
%6 = tail call i32 @inb(i64 %2)
%7 = tail call i32 @inb(i64 %2)
ret i32 %7
}
/* Variables and functions */
#define DT_BLK 133
#define DT_CHR 132
#define DT_DIR 131
#define DT_FIFO 130
#define DT_LNK 129
#define DT_SOCK 128
char t2c(unsigned char t) {
  switch (t) {
  case DT_BLK:
    return 'b';
  case DT_CHR:
    return 'c';
  case DT_DIR:
    return 'd';
  case DT_FIFO:
    return 'f';
  case DT_LNK:
    return 'l';
  case DT_SOCK:
    return 's';
  }
  return '-';
}


x86 assembly (clang, -O0):
<t2c>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     116a <t2c+0x6a>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x62,-0x1(%rbp)
jmp    116e <t2c+0x6e>
movb   $0x63,-0x1(%rbp)
jmp    116e <t2c+0x6e>
movb   $0x64,-0x1(%rbp)
jmp    116e <t2c+0x6e>
movb   $0x66,-0x1(%rbp)
jmp    116e <t2c+0x6e>
movb   $0x6c,-0x1(%rbp)
jmp    116e <t2c+0x6e>
movb   $0x73,-0x1(%rbp)
jmp    116e <t2c+0x6e>
movb   $0x2d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2c>:
lea    0x0(,%rdi,8),%ecx
mov    %edi,%eax
xor    $0x80,%al
movabs $0x626364666c73,%rdx
shr    %cl,%rdx
cmp    $0x6,%al
mov    $0x2d,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @t2c(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %12 [
i32 133, label %6
i32 132, label %7
i32 131, label %8
i32 130, label %9
i32 129, label %10
i32 128, label %11
]
6: ; preds = %1
store i8 98, i8* %2
br label %13
7: ; preds = %1
store i8 99, i8* %2
br label %13
8: ; preds = %1
store i8 100, i8* %2
br label %13
9: ; preds = %1
store i8 102, i8* %2
br label %13
10: ; preds = %1
store i8 108, i8* %2
br label %13
11: ; preds = %1
store i8 115, i8* %2
br label %13
12: ; preds = %1
store i8 45, i8* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @t2c(i8 zeroext %0) {
%2 = xor i8 %0, -128
%3 = icmp ult i8 %2, 6
%4 = zext i8 %2 to i48
%5 = shl nuw nsw i48 %4, 3
%6 = lshr i48 108179025718387, %5
%7 = trunc i48 %6 to i8
%8 = select i1 %3, i8 %7, i8 45
ret i8 %8
}
/* Variables and functions */
double sin(double);
double func3(double i) { return sin(i); }


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

x86 assembly (clang, -O2):
<func3>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @func3(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
void ff_hevc_put_hevc_bi_w_epel_v32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v32_8_sse4() {
ret void
}
int test_imm_07int8_mem(signed char *val) {
  return ((*val) & (-0x07 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_07int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -7
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void GaussRow_C() {}


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

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

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

LLVM IR (-O2):
define void @GaussRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
int sqlite3OsDelete(const char *zFilename) {
  unlink(zFilename);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sqlite3OsDelete(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__12__GeneralIO__makeOutput();
void Stm25pSpiP__CSN__makeOutput(void) {
  Msp430GpioC__12__GeneralIO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Stm25pSpiP__CSN__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__12__GeneralIO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void display_help(void) {
  printf(
      "Usage: %s [OPTIONS] MTD-device\n"
      "Formats NOR flash for resident flash disk\n"
      "\n"
      "-h         --help               display this help and exit\n"
      "-V         --version            output version information and exit\n",
      "rfdformat");
  exit(0);
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf98(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_help>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf9b(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [202 x i8] c"Usage: %s [OPTIONS] MTD-device\0AFormats NOR flash for resident flash disk\0A\0A-h --help display this help and exit\0A-V --version output version information and exit\0A\00"
@.str.1 = [10 x i8] c"rfdformat\00"
define void @display_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [202 x i8] c"Usage: %s [OPTIONS] MTD-device\0AFormats NOR flash for resident flash disk\0A\0A-h --help display this help and exit\0A-V --version output version information and exit\0A\00"
@.str.1 = [10 x i8] c"rfdformat\00"
define void @display_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void syracuse_27(unsigned int *array) {
  unsigned int n = 27;
  unsigned int c = 0;
  array[0] = 27;
  do {
    if (n & 1)
      n = 3 * n + 1;
    else
      n = n / 2;
    ++c;
    array[c] = n;
  } while (n != 1);
}


x86 assembly (clang, -O0):
<syracuse_27>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1b,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1b,(%rax)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <syracuse_27+0x3e>
imul   $0x3,-0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <syracuse_27+0x47>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x1,-0xc(%rbp)
jne    1120 <syracuse_27+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syracuse_27>:
movl   $0x1b,(%rdi)
mov    $0x1b,%eax
mov    $0x1,%ecx
mov    %eax,%edx
shr    %edx
test   $0x1,%al
lea    0x1(%rax,%rax,2),%eax
cmove  %edx,%eax
mov    %ecx,%edx
mov    %eax,(%rdi,%rdx,4)
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1110 <syracuse_27+0x10>
ret

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

LLVM IR (-O2):
define void @syracuse_27(i32* nocapture writeonly %0) {
store i32 27, i32* %0
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 27, %1 ], [ %10, %2 ]
%4 = phi i32 [ 0, %1 ], [ %11, %2 ]
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
%7 = mul i32 %3, 3
%8 = add i32 %7, 1
%9 = lshr i32 %3, 1
%10 = select i1 %6, i32 %9, i32 %8
%11 = add i32 %4, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %10, i32* %13
%14 = icmp eq i32 %10, 1
br i1 %14, label %15, label %2
15: ; preds = %2
ret void
}
__attribute__((visibility("default"))) void bbcount(void) {
  static int count;
  count++;
}


x86 assembly (clang, -O0):
<bbcount>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbcount>:
addl   $0x1,0x2f1d(%rip)
ret

LLVM IR (-O0):
@bbcount.count = internal global i32 0
define void @bbcount() {
%1 = load i32, i32* @bbcount.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @bbcount.count
ret void
}

LLVM IR (-O2):
@bbcount.count = internal unnamed_addr global i32 0
define void @bbcount() {
%1 = load i32, i32* @bbcount.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @bbcount.count
ret void
}
int test_imm_5Fint64_lowword_reg(long long val) {
  return ((val) & (0x5F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Fint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 95
%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_5Fint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 95
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ miuiInstall_set_progress(float);
void ui_set_progress(float fraction) { miuiInstall_set_progress(fraction); }


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

x86 assembly (clang, -O2):
<ui_set_progress>:
jmp    1030 <miuiInstall_set_progress@plt>

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

LLVM IR (-O2):
define void @ui_set_progress(float %0) {
%2 = tail call i32 @miuiInstall_set_progress(float %0)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ texit(int);
int do_texit() {
  int pid = getpid();
  printf("thread %d texit()\n", pid);
  texit(pid);
}


x86 assembly (clang, -O0):
<do_texit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <texit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_texit>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <texit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"thread %d texit()\0A\00"
define i32 @do_texit() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @texit(i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [19 x i8] c"thread %d texit()\0A\00"
define i32 @do_texit() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @texit(i32 %1)
ret i32 undef
}
int main(int argc, char const *argv[]) {
  int j = -1;
  int digits = 0;
  int hour12;
  int number_value;
  if (hour12 > 12) {
    hour12 -= 12;
  }
  digits = 0;
  while (j < 9) {
    number_value /= 10;
    j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xc,-0x1c(%rbp)
jle    1133 <main+0x33>
mov    -0x1c(%rbp),%eax
sub    $0xc,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    1160 <main+0x60>
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x3a>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
extern unsigned char get_bit_3(const unsigned char c) { return (c & 0x8) > 0; }


x86 assembly (clang, -O0):
<get_bit_3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_3>:
mov    %edi,%eax
shr    $0x3,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_bit_3(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 8
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_bit_3(i8 zeroext %0) {
%2 = lshr i8 %0, 3
%3 = and i8 %2, 1
ret i8 %3
}
void acpi_noirq_set(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_noirq_set() {
ret void
}
void foo438(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo438(i32 %0) {
ret void
}
/* Variables and functions */
int sort_gp_asc(void const *, void const *);
int sort_gp_desc(const void *a, const void *b) { return -sort_gp_asc(a, b); }


x86 assembly (clang, -O0):
<sort_gp_desc>:
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 <sort_gp_asc@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_gp_desc>:
push   %rax
call   1030 <sort_gp_asc@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sort_gp_desc(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 @sort_gp_asc(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @sort_gp_desc(i8* %0, i8* %1) {
%3 = tail call i32 @sort_gp_asc(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadl_pi(int /*<<< orphan*/, void *);
__m128 test_loadl_pi(__m128 x, void *y) { return _mm_loadl_pi(x, y); }


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

x86 assembly (clang, -O2):
<test_loadl_pi>:
jmp    1030 <_mm_loadl_pi@plt>

LLVM IR (-O0):
define i32 @test_loadl_pi(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 @_mm_loadl_pi(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_loadl_pi(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_loadl_pi(i32 %0, i8* %1)
ret i32 %3
}
unsigned int cast_ushort_uint(unsigned short int x) { return (unsigned int)x; }


x86 assembly (clang, -O0):
<cast_ushort_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cast_ushort_uint(i16 zeroext %0) {
%2 = zext i16 %0 to i32
ret i32 %2
}
/* Type definitions */
struct nc_buff_head {
  int dummy;
};
struct nc_buff {
  int dummy;
};

/* Variables and functions */
struct nc_buff *ncb_dequeue(struct nc_buff_head *);
int /*<<< orphan*/ ncb_put(struct nc_buff *);
void netchannel_flush_list_head(struct nc_buff_head *list) {
  struct nc_buff *ncb;
  while ((ncb = ncb_dequeue(list)))
    ncb_put(ncb);
}


x86 assembly (clang, -O0):
<netchannel_flush_list_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ncb_dequeue@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <netchannel_flush_list_head+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <ncb_put@plt>
jmp    112c <netchannel_flush_list_head+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netchannel_flush_list_head>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <ncb_dequeue@plt>
test   %rax,%rax
je     1147 <netchannel_flush_list_head+0x27>
mov    %rax,%rdi
call   1030 <ncb_put@plt>
mov    %rbx,%rdi
jmp    1130 <netchannel_flush_list_head+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.nc_buff_head = type { i32 }
%struct.nc_buff = type { i32 }
define void @netchannel_flush_list_head(%struct.nc_buff_head* %0) {
%2 = alloca %struct.nc_buff_head*
%3 = alloca %struct.nc_buff*
store %struct.nc_buff_head* %0, %struct.nc_buff_head** %2
br label %4
4: ; preds = %8, %1
%5 = load %struct.nc_buff_head*, %struct.nc_buff_head** %2
%6 = call %struct.nc_buff* @ncb_dequeue(%struct.nc_buff_head* %5)
store %struct.nc_buff* %6, %struct.nc_buff** %3
%7 = icmp ne %struct.nc_buff* %6, null
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load %struct.nc_buff*, %struct.nc_buff** %3
%10 = call i32 @ncb_put(%struct.nc_buff* %9)
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.nc_buff_head = type { i32 }
%struct.nc_buff = type { i32 }
define void @netchannel_flush_list_head(%struct.nc_buff_head* %0) {
%2 = tail call %struct.nc_buff* @ncb_dequeue(%struct.nc_buff_head* %0)
%3 = icmp eq %struct.nc_buff* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi %struct.nc_buff* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @ncb_put(%struct.nc_buff* %5)
%7 = tail call %struct.nc_buff* @ncb_dequeue(%struct.nc_buff_head* %0)
%8 = icmp eq %struct.nc_buff* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, float, char, long long, int, double);
void testfunc(short s, float X, char C, long long LL, int I, double D) {
  printf("%d, %f, %d, %lld, %d, %f\n", s, X, C, LL, I, D);
}


x86 assembly (clang, -O0):
<testfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %di,%si
mov    %si,-0x2(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x2(%rbp),%dx
movss  -0x8(%rbp),%xmm0
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
movsd  -0x28(%rbp),%xmm1
lea    0xeaa(%rip),%rdi
movswl %dx,%esi
movsbl %al,%edx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%d, %f, %d, %lld, %d, %f\0A\00"
define void @testfunc(i16 signext %0, float %1, i8 signext %2, i64 %3, i32 %4, double %5) {
%7 = alloca i16
%8 = alloca float
%9 = alloca i8
%10 = alloca i64
%11 = alloca i32
%12 = alloca double
store i16 %0, i16* %7
store float %1, float* %8
store i8 %2, i8* %9
store i64 %3, i64* %10
store i32 %4, i32* %11
store double %5, double* %12
%13 = load i16, i16* %7
%14 = load float, float* %8
%15 = load i8, i8* %9
%16 = load i64, i64* %10
%17 = load i32, i32* %11
%18 = load double, double* %12
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i16 signext %13, float %14, i8 signext %15, i64 %16, i32 %17, double %18)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%d, %f, %d, %lld, %d, %f\0A\00"
define void @testfunc(i16 signext %0, float %1, i8 signext %2, i64 %3, i32 %4, double %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i16 signext %0, float %1, i8 signext %2, i64 %3, i32 %4, double %5)
ret void
}