xunge/DecIR huggingface dataset:
int QRinput_estimateBitsModeNum(int size) {
  int w;
  int bits;
  w = size / 3;
  bits = w * 10;
  switch (size - w * 3) {
  case 1:
    bits += 4;
    break;
  case 2:
    bits += 7;
    break;
  default:
    break;
  }
  return bits;
}


x86 assembly (clang, -O0):
<QRinput_estimateBitsModeNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    %ecx,%ecx
mov    %ecx,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     115e <QRinput_estimateBitsModeNum+0x5e>
jmp    114d <QRinput_estimateBitsModeNum+0x4d>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     116c <QRinput_estimateBitsModeNum+0x6c>
jmp    117a <QRinput_estimateBitsModeNum+0x7a>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <QRinput_estimateBitsModeNum+0x7f>
mov    -0xc(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <QRinput_estimateBitsModeNum+0x7f>
jmp    117f <QRinput_estimateBitsModeNum+0x7f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QRinput_estimateBitsModeNum>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x20,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rdx,2),%edx
sub    %edx,%ecx
cmp    $0x2,%ecx
je     1130 <QRinput_estimateBitsModeNum+0x30>
cmp    $0x1,%ecx
jne    1133 <QRinput_estimateBitsModeNum+0x33>
add    $0x4,%eax
ret
add    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @QRinput_estimateBitsModeNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 3
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 10
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 3
%12 = sub nsw i32 %9, %11
switch i32 %12, label %19 [
i32 1, label %13
i32 2, label %16
]
13: ; preds = %1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 4
store i32 %15, i32* %4
br label %20
16: ; preds = %1
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 7
store i32 %18, i32* %4
br label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %16, %13
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @QRinput_estimateBitsModeNum(i32 %0) {
%2 = sdiv i32 %0, 3
%3 = mul nsw i32 %2, 10
%4 = mul nsw i32 %2, -3
%5 = add i32 %4, %0
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %1
%7 = add nsw i32 %3, 4
br label %10
8: ; preds = %1
%9 = add nsw i32 %3, 7
br label %10
10: ; preds = %1, %8, %6
%11 = phi i32 [ %3, %1 ], [ %9, %8 ], [ %7, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int16_t u16s16(uint16_t v) {
  return (v & 0x8000u) ? ((int32_t)v) - 0x10000l : v;
}


x86 assembly (clang, -O0):
<u16s16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     112b <u16s16+0x2b>
movslq -0x4(%rbp),%rax
sub    $0x10000,%rax
mov    %rax,-0x10(%rbp)
jmp    1133 <u16s16+0x33>
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16s16>:
lea    -0x10000(%rdi),%eax
test   $0x8000,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @u16s16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = sub nsw i64 %8, 65536
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
br label %13
13: ; preds = %10, %6
%14 = phi i64 [ %9, %6 ], [ %12, %10 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @u16s16(i32 %0) {
%2 = and i32 %0, 32768
%3 = icmp eq i32 %2, 0
%4 = add i32 %0, -65536
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ add_test();
int /*<<< orphan*/ and_test();
int /*<<< orphan*/ branch_test();
int /*<<< orphan*/ load_store_test();
int /*<<< orphan*/ or_test();
int /*<<< orphan*/ sll_test();
int /*<<< orphan*/ srl_sra_test();
int /*<<< orphan*/ sub_test();
int /*<<< orphan*/ xor_test();
int main() {
  add_test();
  and_test();
  branch_test();
  load_store_test();
  or_test();
  sll_test();
  srl_sra_test();
  xor_test();
  sub_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <add_test@plt>
mov    $0x0,%al
call   10a0 <and_test@plt>
mov    $0x0,%al
call   1040 <branch_test@plt>
mov    $0x0,%al
call   1050 <load_store_test@plt>
mov    $0x0,%al
call   1090 <or_test@plt>
mov    $0x0,%al
call   1060 <sll_test@plt>
mov    $0x0,%al
call   1070 <srl_sra_test@plt>
mov    $0x0,%al
call   10b0 <xor_test@plt>
mov    $0x0,%al
call   1030 <sub_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <add_test@plt>
xor    %eax,%eax
call   10a0 <and_test@plt>
xor    %eax,%eax
call   1040 <branch_test@plt>
xor    %eax,%eax
call   1050 <load_store_test@plt>
xor    %eax,%eax
call   1090 <or_test@plt>
xor    %eax,%eax
call   1060 <sll_test@plt>
xor    %eax,%eax
call   1070 <srl_sra_test@plt>
xor    %eax,%eax
call   10b0 <xor_test@plt>
xor    %eax,%eax
call   1030 <sub_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @add_test()
%3 = call i32 (...) @and_test()
%4 = call i32 (...) @branch_test()
%5 = call i32 (...) @load_store_test()
%6 = call i32 (...) @or_test()
%7 = call i32 (...) @sll_test()
%8 = call i32 (...) @srl_sra_test()
%9 = call i32 (...) @xor_test()
%10 = call i32 (...) @sub_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @add_test()
%2 = tail call i32 (...) @and_test()
%3 = tail call i32 (...) @branch_test()
%4 = tail call i32 (...) @load_store_test()
%5 = tail call i32 (...) @or_test()
%6 = tail call i32 (...) @sll_test()
%7 = tail call i32 (...) @srl_sra_test()
%8 = tail call i32 (...) @xor_test()
%9 = tail call i32 (...) @sub_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ObjWriteData(char const *, unsigned int);
int /*<<< orphan*/ ObjWriteVar(unsigned int);
unsigned int strlen(char const *);
void ObjWriteStr(const char *S) {
  unsigned Len = strlen(S);
  ObjWriteVar(Len);
  ObjWriteData(S, Len);
}


x86 assembly (clang, -O0):
<ObjWriteStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ObjWriteVar@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ObjWriteData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ObjWriteStr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <ObjWriteVar@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ObjWriteData@plt>

LLVM IR (-O0):
define void @ObjWriteStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @ObjWriteVar(i32 %6)
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = call i32 @ObjWriteData(i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @ObjWriteStr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @ObjWriteVar(i32 %2)
%4 = tail call i32 @ObjWriteData(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
double rand_double() {
  return (double)(rand() - RAND_MAX / 2) / ((double)(RAND_MAX / 2)) / 100.0;
}


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
sub    %edx,%eax
cvtsi2sd %eax,%xmm0
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
divsd  0xec0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define double @rand_double() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = sub nsw i32 %1, %3
%5 = sitofp i32 %4 to double
%6 = load i32, i32* @RAND_MAX
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = fdiv double %5, %8
%10 = fdiv double %9, 1.000000e+02
ret double %10
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define double @rand_double() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = sub nsw i32 %1, %3
%5 = sitofp i32 %4 to double
%6 = sitofp i32 %3 to double
%7 = fdiv double %5, %6
%8 = fdiv double %7, 1.000000e+02
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *__bb_addr(void volatile *, int /*<<< orphan*/, int,
                                       int);
volatile uint32_t *bb_perip(volatile void *address, uint32_t bit) {
  return __bb_addr(address, bit, 0x42000000, 0x40000000);
}


x86 assembly (clang, -O0):
<bb_perip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x42000000,%edx
mov    $0x40000000,%ecx
call   1030 <__bb_addr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_perip>:
mov    $0x42000000,%edx
mov    $0x40000000,%ecx
jmp    1030 <__bb_addr@plt>

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

LLVM IR (-O2):
define i32* @bb_perip(i8* %0, i32 %1) {
%3 = tail call i32* @__bb_addr(i8* %0, i32 %1, i32 1107296256, i32 1073741824)
ret i32* %3
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructModuleName(struct constructHeader *);
const char *EnvDeffunctionModule(void *theEnv, void *theDeffunction) {
  return GetConstructModuleName((struct constructHeader *)theDeffunction);
}


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

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

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvDeffunctionModule(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructModuleName(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvDeffunctionModule(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructModuleName(%struct.constructHeader* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ convertToSoundex(char *, char *);
int /*<<< orphan*/ *gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char origin[200 + 1], soundex[200 + 1];
  while (gets(origin) != NULL) {
    convertToSoundex(origin, soundex);
    printf("%s\n", soundex);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     1183 <main+0x53>
lea    -0xd0(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   1040 <convertToSoundex@plt>
lea    -0x1a0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1a0,%rsp
mov    %rsp,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     1183 <main+0x53>
mov    %rsp,%r14
lea    0xd0(%rsp),%rbx
lea    0xea5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <convertToSoundex@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1050 <gets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [201 x i8]
%2 = alloca [201 x i8]
%3 = getelementptr inbounds [201 x i8], [201 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 0
%5 = call i32* @gets(i8* %3)
%6 = icmp eq i32* %5, null
br i1 %6, label %12, label %7
7: ; preds = %0, %7
%8 = call i32 @convertToSoundex(i8* %3, i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32* @gets(i8* %3)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %0
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_hv8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv8_10_sse4() {
ret void
}
/* Variables and functions */
float compare(float, float);
float compareArr(float arr[], int c) {
  float max = 0.00;
  for (int i = 0; i < c; i++) {
    max = compare(arr[i], max);
  }
  return max;
}


x86 assembly (clang, -O0):
<compareArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <compareArr+0x54>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <compare@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <compareArr+0x1e>
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareArr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <compareArr+0x39>
mov    %rdi,%r14
mov    %esi,%r15d
xorps  %xmm1,%xmm1
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  (%r14,%rbx,4),%xmm0
call   1030 <compare@plt>
movaps %xmm0,%xmm1
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <compareArr+0x20>
jmp    114c <compareArr+0x3c>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @compareArr(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store float 0.000000e+00, float* %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load float*, float** %3
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %12, i64 %14
%16 = load float, float* %15
%17 = load float, float* %5
%18 = call float @compare(float %16, float %17)
store float %18, float* %5
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
define float @compareArr(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = phi float [ 0.000000e+00, %2 ], [ %13, %8 ]
ret float %7
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = phi float [ 0.000000e+00, %4 ], [ %13, %8 ]
%11 = getelementptr inbounds float, float* %0, i64 %9
%12 = load float, float* %11
%13 = tail call float @compare(float %12, float %10)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("Hello, Shared 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 = [22 x i8] c"Hello, Shared World!\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello, Shared World!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_5Aint32_mem(int *val) {
  return ((*val) & (0x5A << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @IF_TRUE() {
ret void
}
int test_imm_4Fuint16_reg(unsigned short val) {
  return ((val) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x4f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 79
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ values;

/* Variables and functions */
int /*<<< orphan*/ oddEven(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int values[] = {4, 1, 5,  6, 7, 2,  9, 2, 5,   8, 9, 1,
                  5, 8, 32, 5, 7, 31, 7, 6, 234, 6, 32};
  int len = sizeof(values) / sizeof(int);
  printArray(values, len);
  oddEven(values, len);
  printArray(values, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x60(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x5c,%edx
call   1030 <memcpy@plt>
movl   $0x17,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1050 <printArray@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1040 <oddEven@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
movups 0xf20(%rip),%xmm0
movups %xmm0,0x4c(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x17,%esi
call   1040 <printArray@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
call   1030 <oddEven@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.values = [23 x i32] [i32 4, i32 1, i32 5, i32 6, i32 7, i32 2, i32 9, i32 2, i32 5, i32 8, i32 9, i32 1, i32 5, i32 8, i32 32, i32 5, i32 7, i32 31, i32 7, i32 6, i32 234, i32 6, i32 32]
define i32 @main() {
%1 = alloca [23 x i32]
%2 = alloca i32
%3 = bitcast [23 x i32]* %1 to i8*
store i32 23, i32* %2
%4 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @printArray(i32* %4, i32 %5)
%7 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @oddEven(i32* %7, i32 %8)
%10 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @printArray(i32* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [23 x i32] [i32 4, i32 1, i32 5, i32 6, i32 7, i32 2, i32 9, i32 2, i32 5, i32 8, i32 9, i32 1, i32 5, i32 8, i32 32, i32 5, i32 7, i32 31, i32 7, i32 6, i32 234, i32 6, i32 32]
define i32 @main() {
%1 = alloca [23 x i32]
%2 = bitcast [23 x i32]* %1 to i8*
%3 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 23)
%5 = call i32 @oddEven(i32* %3, i32 23)
%6 = call i32 @printArray(i32* %3, i32 23)
ret i32 0
}
float atan(float x) { return ((native_atan(fabs(x))) * 57.2957795131f); }


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xee3(%rip),%xmm1
pand   %xmm1,%xmm0
mov    $0x1,%al
call   1030 <native_atan@plt>
cvtsi2ss %eax,%xmm0
movss  0xebc(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
push   %rax
andps  0xee8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <native_atan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fabs.f64(double %4)
%6 = call i32 (double, ...) bitcast (i32 (...)* @native_atan to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to float
%8 = fmul float %7, 0x404CA5DC20000000
ret float %8
}

LLVM IR (-O2):
define float @atan(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = fpext float %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @native_atan to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to float
%6 = fmul float %5, 0x404CA5DC20000000
ret float %6
}
/* Variables and functions */
scalar_t__ isReflection(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ makeReflection(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (isReflection(makeReflection(NULL), NULL))
    printf("Success!\n");
  else
    printf("fail whale :(\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeReflection@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <isReflection@plt>
cmp    $0x0,%rax
je     116e <main+0x3e>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x4a>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <makeReflection@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <isReflection@plt>
test   %rax,%rax
lea    0xeb5(%rip),%rax
lea    0xebc(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Success!\0A\00"
@.str.1 = [15 x i8] c"fail whale :(\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @makeReflection(i32* null)
%3 = call i64 @isReflection(i32 %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"fail whale :(\00"
@str.2 = [9 x i8] c"Success!\00"
define i32 @main() {
%1 = tail call i32 @makeReflection(i32* null)
%2 = tail call i64 @isReflection(i32 %1, i32* null)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __aeabi_unwind_cpp_pr2(void) { abort(); }


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

x86 assembly (clang, -O2):
<__aeabi_unwind_cpp_pr2>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__aeabi_unwind_cpp_pr2() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__aeabi_unwind_cpp_pr2() {
%1 = tail call i32 (...) @abort()
unreachable
}
void zcb_onArrayComplete(char *name) { ; }


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

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

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

LLVM IR (-O2):
define void @zcb_onArrayComplete(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putnchar(char c, size_t n) {
  while (n-- > 0)
    write(1, &c, 1);
}


x86 assembly (clang, -O0):
<ft_putnchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    1150 <ft_putnchar+0x40>
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    1122 <ft_putnchar+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnchar>:
push   %r14
push   %rbx
push   %rax
mov    %dil,0x7(%rsp)
test   %rsi,%rsi
je     1148 <ft_putnchar+0x38>
mov    %rsi,%rbx
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <ft_putnchar+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ft_putnchar(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ugt i64 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @write(i32 1, i8* %3, i32 1)
br label %5
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_putnchar(i8 signext %0, i64 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ %1, %2 ]
%7 = add i64 %6, -1
%8 = call i32 @write(i32 1, i8* %3, i32 1)
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
unsigned long drm_core_get_reg_ofs(struct drm_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define i64 @drm_core_get_reg_ofs(%struct.drm_device* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
void initConsole() {
  initscr();
  noecho();
}


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

x86 assembly (clang, -O2):
<initConsole>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <noecho@plt>

LLVM IR (-O0):
define void @initConsole() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
define void @initConsole() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
ret void
}
int main() {
  char x;
  x = x + x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x1(%rbp),%eax
movsbl -0x1(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %3, %5
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fun331() { return 331; }


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

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

LLVM IR (-O0):
define i32 @fun331() {
ret i32 331
}

LLVM IR (-O2):
define i32 @fun331() {
ret i32 331
}
void test1() {
  printf("\t*** %s ***\n", __func__);
  small_string_test("1\n \n1,2,3\n123\n");
  printf("\t*** %s: done ***\n", __func__);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <small_string_test@plt>
lea    0xed4(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <small_string_test@plt>
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test1 = [6 x i8] c"test1\00"
@.str.1 = [15 x i8] c"1\0A \0A1,2,3\0A123\0A\00"
@.str.2 = [19 x i8] c"\09*** %s: done ***\0A\00"
define void @test1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test1, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test1 = [6 x i8] c"test1\00"
@.str.1 = [15 x i8] c"1\0A \0A1,2,3\0A123\0A\00"
@.str.2 = [19 x i8] c"\09*** %s: done ***\0A\00"
define void @test1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opencl_scanner_devices(int /*<<< orphan*/ *);
int main(void) { opencl_scanner_devices(NULL); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <opencl_scanner_devices@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @opencl_scanner_devices(i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @opencl_scanner_devices(i32* null)
ret i32 0
}
unsigned long long nlm_crypto_form_pkt_fmn_entry1(
    unsigned int arc4load_state, unsigned int hash_keylen,
    unsigned int pktdesc_size, unsigned long long pktdesc_addr) {
  return ((unsigned long long)(arc4load_state) << (63)) |
         (((unsigned long long)(((hash_keylen + 7) >> 3)) & ((1ULL << (5)) - 1))
          << (56)) |
         (((unsigned long long)(((pktdesc_size >> 4) - 1)) &
           ((1ULL << (12)) - 1))
          << (43)) |
         ((unsigned long long)(pktdesc_addr >> 6) << (0));
}


x86 assembly (clang, -O0):
<nlm_crypto_form_pkt_fmn_entry1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3f,%rax
mov    -0x8(%rbp),%ecx
add    $0x7,%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
and    $0x1f,%rcx
shl    $0x38,%rcx
or     %rcx,%rax
mov    -0xc(%rbp),%ecx
shr    $0x4,%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
and    $0xfff,%rcx
shl    $0x2b,%rcx
or     %rcx,%rax
mov    -0x18(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlm_crypto_form_pkt_fmn_entry1>:
shl    $0x3f,%rdi
add    $0x7,%esi
shr    $0x3,%esi
and    $0x1f,%esi
shl    $0x38,%rsi
or     %rdi,%rsi
shr    $0x4,%edx
lea    -0x1(%rdx),%eax
and    $0xfff,%eax
shl    $0x2b,%rax
or     %rsi,%rax
shr    $0x6,%rcx
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @nlm_crypto_form_pkt_fmn_entry1(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 63
%12 = load i32, i32* %6
%13 = add i32 %12, 7
%14 = lshr i32 %13, 3
%15 = zext i32 %14 to i64
%16 = and i64 %15, 31
%17 = shl i64 %16, 56
%18 = or i64 %11, %17
%19 = load i32, i32* %7
%20 = lshr i32 %19, 4
%21 = sub i32 %20, 1
%22 = zext i32 %21 to i64
%23 = and i64 %22, 4095
%24 = shl i64 %23, 43
%25 = or i64 %18, %24
%26 = load i64, i64* %8
%27 = lshr i64 %26, 6
%28 = shl i64 %27, 0
%29 = or i64 %25, %28
ret i64 %29
}

LLVM IR (-O2):
define i64 @nlm_crypto_form_pkt_fmn_entry1(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = zext i32 %0 to i64
%6 = shl i64 %5, 63
%7 = add i32 %1, 7
%8 = lshr i32 %7, 3
%9 = and i32 %8, 31
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 56
%12 = or i64 %11, %6
%13 = lshr i32 %2, 4
%14 = add nuw nsw i32 %13, 4095
%15 = and i32 %14, 4095
%16 = zext i32 %15 to i64
%17 = shl nuw nsw i64 %16, 43
%18 = or i64 %12, %17
%19 = lshr i64 %3, 6
%20 = or i64 %18, %19
ret i64 %20
}
/* Variables and functions */
double fmod(double, double);
double pmod(double x, double y) {
  x = fmod(x, y);
  if (x < 0)
    x += y;
  return x;
}


x86 assembly (clang, -O0):
<pmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1153 <pmod+0x43>
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmod>:
sub    $0x18,%rsp
movapd %xmm1,(%rsp)
call   1030 <fmod@plt>
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movapd (%rsp),%xmm3
andpd  %xmm2,%xmm3
movsd  0xec4(%rip),%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @pmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @fmod(double %5, double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %3
%13 = fadd double %12, %11
store double %13, double* %3
br label %14
14: ; preds = %10, %2
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @pmod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
%4 = fcmp olt double %3, 0.000000e+00
%5 = select i1 %4, double %1, double -0.000000e+00
%6 = fadd double %3, %5
ret double %6
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
double strtod(char *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  double d1, d2;
  d1 = strtod("25.0", NULL);
  printf("25.0 = %10.10f\n", d1);
  d2 = atof("25.0");
  printf("25.0 = %10.10f\n", d2);
  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)
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <atof@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"25.0\00"
@.str.1 = [16 x i8] c"25.0 = %10.10f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call double @strtod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
store double %8, double* %6
%9 = load double, double* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %9)
%11 = call double @atof(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store double %11, double* %7
%12 = load double, double* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"25.0\00"
@.str.1 = [16 x i8] c"25.0 = %10.10f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @strtod(i8* nocapture getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @atof(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetAdvancedLUT(unsigned long ulBoardNum, unsigned long ulChannel,
                     void *pLUT, unsigned long ulFlags) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetAdvancedLUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvSetAdvancedLUT>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetAdvancedLUT(i64 %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetAdvancedLUT(i64 %0, i64 %1, i8* nocapture readnone %2, i64 %3) {
%5 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_05int32_reg(int val) { return ((val) & (0x05 << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_05int32_reg(i32 %0) {
%2 = and i32 %0, 5
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raext256() {
  printf("\nChanging Read Ahead Cache size for External sdcard to 256kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 256 > /sys/block/mmcblk1/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raext256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xee9(%rip),%rsi
lea    0xef7(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raext256>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0AChanging Read Ahead Cache size for External sdcard to 256kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 256 > /sys/block/mmcblk1/queue/read_ahead_kb'\00"
define void @raext256() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 256 > /sys/block/mmcblk1/queue/read_ahead_kb'\00"
@str = [61 x i8] c"\0AChanging Read Ahead Cache size for External sdcard to 256kb\00"
define void @raext256() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ one();
int main() {
  one();
  foo();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <one@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @one()
%2 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @one()
%2 = tail call i32 (...) @foo()
ret i32 0
}
/* Type definitions */
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t vmulf(int16_t x, int16_t y) {
  return (((int32_t)(x)) * ((int32_t)(y)) + 0x4000) >> 15;
}


x86 assembly (clang, -O0):
<vmulf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   %ecx,%eax
add    $0x4000,%eax
sar    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmulf>:
imul   %edi,%esi
lea    0x4000(%rsi),%eax
sar    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @vmulf(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = add nsw i32 %9, 16384
%11 = ashr i32 %10, 15
ret i32 %11
}

LLVM IR (-O2):
define i32 @vmulf(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = add nsw i32 %5, 16384
%7 = ashr i32 %6, 15
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ preempt_enable();
void preempt_enable_notrace(void) { preempt_enable(); }


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

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

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

LLVM IR (-O2):
define void @preempt_enable_notrace() {
%1 = tail call i32 (...) @preempt_enable()
ret void
}