xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ isatty(int /*<<< orphan*/);
int no_terminal(FILE *f) { return !isatty(fileno(f)); }


x86 assembly (clang, -O0):
<no_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_terminal>:
push   %rax
call   1040 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @no_terminal(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = call i32 @isatty(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @no_terminal(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call i32 @isatty(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int getPreamp(int fd) {
  char cmd[8], response[8];
  sprintf(cmd, "PA;");
  write(fd, cmd, strlen(cmd));
  read(fd, response, 4);
  return response[0] == '1';
}


x86 assembly (clang, -O0):
<getPreamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read@plt>
movsbl -0x14(%rbp),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPreamp>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movl   $0x3b4150,0x8(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1050 <read@plt>
xor    %eax,%eax
cmpb   $0x31,0x10(%rsp)
sete   %al
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"PA;\00"
define i32 @getPreamp(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
%12 = load i32, i32* %2
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%14 = call i32 @read(i32 %12, i8* %13, i32 4)
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 49
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @getPreamp(i32 %0) {
%2 = alloca [8 x i8]
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = bitcast [8 x i8]* %2 to i32*
store i32 3883344, i32* %6
%7 = call i32 @strlen(i8* %4)
%8 = call i32 @write(i32 %0, i8* %4, i32 %7)
%9 = call i32 @read(i32 %0, i8* %5, i32 4)
%10 = load i8, i8* %5
%11 = icmp eq i8 %10, 49
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
uint8_t pcg_output_rxs_m_xs_8_8(uint8_t state) {
  uint8_t word = ((state >> ((state >> 6u) + 2u)) ^ state) * 217u;
  return (word >> 6u) ^ word;
}


x86 assembly (clang, -O0):
<pcg_output_rxs_m_xs_8_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x6,%ecx
add    $0x2,%ecx
shr    %cl,%eax
xor    -0x4(%rbp),%eax
imul   $0xd9,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_rxs_m_xs_8_8>:
mov    %edi,%ecx
shr    $0x6,%ecx
add    $0x2,%cl
mov    %edi,%eax
shr    %cl,%eax
xor    %edi,%eax
imul   $0xd9,%eax,%ecx
mov    %ecx,%eax
shr    $0x6,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pcg_output_rxs_m_xs_8_8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 6
%7 = add i32 %6, 2
%8 = lshr i32 %4, %7
%9 = load i32, i32* %2
%10 = xor i32 %8, %9
%11 = mul i32 %10, 217
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = lshr i32 %12, 6
%14 = load i32, i32* %3
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @pcg_output_rxs_m_xs_8_8(i32 %0) {
%2 = lshr i32 %0, 6
%3 = add nuw nsw i32 %2, 2
%4 = lshr i32 %0, %3
%5 = xor i32 %4, %0
%6 = mul i32 %5, 217
%7 = lshr i32 %6, 6
%8 = xor i32 %7, %6
ret i32 %8
}
/* Variables and functions */
scalar_t__ __uniform__();
int log(scalar_t__);
double THRandom_exponential(double lambda) {
  return (-1. / lambda * log(1 - __uniform__()));
}


x86 assembly (clang, -O0):
<THRandom_exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__uniform__@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <log@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THRandom_exponential>:
push   %rax
movsd  0xed7(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <__uniform__@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @THRandom_exponential(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double -1.000000e+00, %3
%5 = call i64 (...) @__uniform__()
%6 = sub nsw i64 1, %5
%7 = call i32 @log(i64 %6)
%8 = sitofp i32 %7 to double
%9 = fmul double %4, %8
ret double %9
}

LLVM IR (-O2):
define double @THRandom_exponential(double %0) {
%2 = fdiv double -1.000000e+00, %0
%3 = tail call i64 (...) @__uniform__()
%4 = sub nsw i64 1, %3
%5 = tail call i32 @log(i64 %4)
%6 = sitofp i32 %5 to double
%7 = fmul double %2, %6
ret double %7
}
void RTTestPassedV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestPassedV() {
ret void
}
void swap(int *x, int *y) {
  asm("xor %%ebx, %%eax;" : : "a"(*x), "b"(*y));
  asm("xor %eax, %ebx;");
  asm("xor %%ebx, %%eax;" : "=a"(*x), "=b"(*y));
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ebx
xor    %ebx,%eax
xor    %eax,%ebx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %ebx,%eax
mov    %eax,%edx
mov    -0x20(%rbp),%rax
mov    %edx,(%rcx)
mov    %ebx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbx
mov    (%rdi),%eax
mov    (%rsi),%ebx
xor    %ebx,%eax
xor    %eax,%ebx
xor    %ebx,%eax
mov    %eax,(%rdi)
mov    %ebx,(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = call { i32, i32 } asm "xor %ebx, %eax;", "={ax},={bx},~{dirflag},~{fpsr},~{flags}"()
%12 = extractvalue { i32, i32 } %11, 0
%13 = extractvalue { i32, i32 } %11, 1
store i32 %12, i32* %9
store i32 %13, i32* %10
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
tail call void asm sideeffect "xor %ebx, %eax;", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %3, i32 %4)
tail call void asm sideeffect "xor %eax, %ebx;", "~{dirflag},~{fpsr},~{flags}"()
%5 = tail call { i32, i32 } asm "xor %ebx, %eax;", "={ax},={bx},~{dirflag},~{fpsr},~{flags}"()
%6 = extractvalue { i32, i32 } %5, 0
%7 = extractvalue { i32, i32 } %5, 1
store i32 %6, i32* %0
store i32 %7, i32* %1
ret void
}
/* Variables and functions */
int find_rotation_spot_aux(int *, int /*<<< orphan*/, size_t);
int find_rotation_spot(int arr[], size_t n) {
  if (n == 0) {
    return -1;
  }
  return find_rotation_spot_aux(arr, 0, n - 1);
}


x86 assembly (clang, -O0):
<find_rotation_spot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <find_rotation_spot+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <find_rotation_spot+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <find_rotation_spot_aux@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_rotation_spot>:
test   %rsi,%rsi
je     1123 <find_rotation_spot+0x13>
mov    %rsi,%rdx
add    $0xffffffffffffffff,%rdx
xor    %esi,%esi
jmp    1030 <find_rotation_spot_aux@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @find_rotation_spot(i32* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %14
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i64, i64* %5
%12 = sub i64 %11, 1
%13 = call i32 @find_rotation_spot_aux(i32* %10, i32 0, i64 %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @find_rotation_spot(i32* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = tail call i32 @find_rotation_spot_aux(i32* %0, i32 0, i64 %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ subprint(char *);
int main() {
  char *c;
  subprint(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <subprint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @subprint(i8* undef)
ret i32 0
}
int test_03(int x, int y) {
  if (!y)
    --x;
  return x;
}


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <test_03+0x1d>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
mov    %edi,%eax
cmp    $0x1,%esi
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @test_03(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_03(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = sext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void xalloc_die(void) { abort(); }


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

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

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

LLVM IR (-O2):
define void @xalloc_die() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
double bounceEaseOutd(int);
double bounceEaseInd(double p) { return 1 - bounceEaseOutd(1 - p); }


x86 assembly (clang, -O0):
<bounceEaseInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <bounceEaseOutd@plt>
movaps %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounceEaseInd>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <bounceEaseOutd@plt>
movsd  0xed2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bounceEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @bounceEaseOutd(i32 %5)
%7 = fsub double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @bounceEaseInd(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @bounceEaseOutd(i32 %3)
%5 = fsub double 1.000000e+00, %4
ret double %5
}
/* Type definitions */
struct hda_codec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alc88x_simple_mic_automute(struct hda_codec *);
int /*<<< orphan*/ alc_hp_automute(struct hda_codec *);
void alc880_uniwill_init_hook(struct hda_codec *codec) {
  alc_hp_automute(codec);
  alc88x_simple_mic_automute(codec);
}


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

x86 assembly (clang, -O2):
<alc880_uniwill_init_hook>:
push   %rbx
mov    %rdi,%rbx
call   1030 <alc_hp_automute@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <alc88x_simple_mic_automute@plt>

LLVM IR (-O0):
%struct.hda_codec = type { i32 }
define void @alc880_uniwill_init_hook(%struct.hda_codec* %0) {
%2 = alloca %struct.hda_codec*
store %struct.hda_codec* %0, %struct.hda_codec** %2
%3 = load %struct.hda_codec*, %struct.hda_codec** %2
%4 = call i32 @alc_hp_automute(%struct.hda_codec* %3)
%5 = load %struct.hda_codec*, %struct.hda_codec** %2
%6 = call i32 @alc88x_simple_mic_automute(%struct.hda_codec* %5)
ret void
}

LLVM IR (-O2):
%struct.hda_codec = type { i32 }
define void @alc880_uniwill_init_hook(%struct.hda_codec* %0) {
%2 = tail call i32 @alc_hp_automute(%struct.hda_codec* %0)
%3 = tail call i32 @alc88x_simple_mic_automute(%struct.hda_codec* %0)
ret void
}
/* Variables and functions */
int rom_present(char *);
int dtc5150x_available(void) {
  return (rom_present(L"roms/hdd/st506/dtc_cxd21a.bin"));
}


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

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

LLVM IR (-O0):
@.str = [30 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 100, i32 116, i32 99, i32 95, i32 99, i32 120, i32 100, i32 50, i32 49, i32 97, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @dtc5150x_available() {
%1 = call i32 @rom_present(i8* bitcast ([30 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [30 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 100, i32 116, i32 99, i32 95, i32 99, i32 120, i32 100, i32 50, i32 49, i32 97, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @dtc5150x_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([30 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(int x) {
  if (x != 1)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     112c <foo+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
jne    1116 <foo+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
const char *ls_costN_nm2_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm2_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_costN_nm2_name_out+0x2b>
jmp    111a <ls_costN_nm2_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_costN_nm2_name_out+0x3b>
jmp    114b <ls_costN_nm2_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm2_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm2_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm2_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm2_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ arrayPoint();
int main(int argc, const char *argv[]) {
  arrayPoint();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <arrayPoint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @arrayPoint()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @arrayPoint()
ret i32 0
}
int main(void) {
  volatile int i;
  for (i = 0; i < 50000; i++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0xc350,%eax
jge    1133 <main+0x33>
jmp    1125 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xc34f,%eax
jg     1130 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xc350,%eax
jl     1120 <main+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, 50000
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 50000
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp slt i32 %8, 50000
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
unsigned int calc_stopbits2(unsigned int const *);
unsigned int calc_totalbits(unsigned int const *, unsigned int);
const int calc_stopbits(const unsigned int *bit) {
  unsigned int min, s0, method, t, s;
  s0 = calc_stopbits2(bit);
  min = calc_totalbits(bit, s0);
  method = 2;
  return s0;
}


x86 assembly (clang, -O0):
<calc_stopbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_stopbits2@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <calc_totalbits@plt>
mov    %eax,-0xc(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_stopbits>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <calc_stopbits2@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <calc_totalbits@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @calc_stopbits(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
%8 = load i32*, i32** %2
%9 = call i32 @calc_stopbits2(i32* %8)
store i32 %9, i32* %4
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = call i32 @calc_totalbits(i32* %10, i32 %11)
store i32 %12, i32* %3
store i32 2, i32* %5
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @calc_stopbits(i32* %0) {
%2 = tail call i32 @calc_stopbits2(i32* %0)
%3 = tail call i32 @calc_totalbits(i32* %0, i32 %2)
ret i32 %2
}
void tag(void *a, int b, const char *c, int d) {}


x86 assembly (clang, -O0):
<tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tag(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @tag(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
time_t J2000totime(double t0) {
  return (time_t)((t0 + 0.3) * 3155760000.0 + 0.5);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @J2000totime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 3.000000e-01
%5 = call double @llvm.fmuladd.f64(double %4, double 3.155760e+09, double 5.000000e-01)
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @J2000totime(double %0) {
%2 = fadd double %0, 3.000000e-01
%3 = tail call double @llvm.fmuladd.f64(double %2, double 3.155760e+09, double 5.000000e-01)
%4 = fptosi double %3 to i32
ret i32 %4
}
int __ashrhi3(int a, int b) { return a >> b; }


x86 assembly (clang, -O0):
<__ashrhi3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ashrhi3>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__ashrhi3(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int length;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
int ASN1_STRING_length(const ASN1_STRING *x) { return x->length; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_length(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_length(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
unsigned int test_04(unsigned int a) { return a > 255 ? 255 : a; }


x86 assembly (clang, -O0):
<test_04>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jbe    1121 <test_04+0x21>
mov    $0xff,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <test_04+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_04>:
cmp    $0xff,%edi
mov    $0xff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_04(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 255
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 255, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_04(i32 %0) {
%2 = icmp ult i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
ret i32 %3
}
void ptp_nikon_getptpipguid(unsigned char *guid) { return; }


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

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

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

LLVM IR (-O2):
define void @ptp_nikon_getptpipguid(i8* nocapture %0) {
ret void
}
int fun750() { return 750; }


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

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

LLVM IR (-O0):
define i32 @fun750() {
ret i32 750
}

LLVM IR (-O2):
define i32 @fun750() {
ret i32 750
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void timer_callback(int sig) {
  printf("Caught timer signal: %d ... !!\n", sig);
}


x86 assembly (clang, -O0):
<timer_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_callback>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Caught timer signal: %d ... !!\0A\00"
define void @timer_callback(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Caught timer signal: %d ... !!\0A\00"
define void @timer_callback(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f16(long j) {
  if ((j & ((1UL << (16)) - 1)) >= ((1UL << ((16) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
cmp    $0x8002,%rax
jb     1139 <f16+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
and    $0xfffe,%edi
cmp    $0x8002,%edi
jae    111f <f16+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = icmp uge i64 %4, 32770
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f16(i64 %0) {
%2 = and i64 %0, 65534
%3 = icmp ugt i64 %2, 32769
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
int test_imm_D3uint16_mem(unsigned short *val) {
  return ((*val) & (-0xD3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D3uint16_mem>:
movzwl (%rdi),%eax
test   $0xff2d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D3uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -211
%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_D3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -211
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef void uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void *_ParseLineARGB8888(uint32_t *out, void *line, int width) {
  memcpy(out, line, width * 4);
  return ((uint32_t *)line) + width;
}


x86 assembly (clang, -O0):
<_ParseLineARGB8888>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ParseLineARGB8888>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
lea    0x0(,%rbx,4),%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_ParseLineARGB8888(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 4
%11 = call i32 @memcpy(i8* %7, i8* %8, i32 %10)
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr i8, i8* %12, i64 %14
ret i8* %15
}

LLVM IR (-O2):
define i8* @_ParseLineARGB8888(i8* %0, i8* %1, i32 %2) {
%4 = shl nsw i32 %2, 2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %2 to i64
%7 = getelementptr i8, i8* %1, i64 %6
ret i8* %7
}
int test_imm_12int16_reg(short val) {
  return ((val) & (0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 18
%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_12int16_reg(i16 signext %0) {
%2 = and i16 %0, 18
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ r20_tst_space(int, int);
int main(int argc, char *argv[]) {
  printf("R20 v. 0.0.1 A (c) 2016 - 2017 Marc Volker Dickmann\n");
  r20_tst_space(2048, 2048);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x800,%edi
mov    $0x800,%esi
call   1040 <r20_tst_space@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"R20 v. 0.0.1 A (c) 2016 - 2017 Marc Volker Dickmann\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @r20_tst_space(i32 2048, i32 2048)
ret i32 0
}

LLVM IR (-O2):
@str = [52 x i8] c"R20 v. 0.0.1 A (c) 2016 - 2017 Marc Volker Dickmann\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @r20_tst_space(i32 2048, i32 2048)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_role_change_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_role_change_get_status>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_role_change_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
void usage(void) {
  printf("Usage: nodogsplash [options]\n"
         "\n"
         "  -c <path>   Use configuration file\n"
         "  -f          Run in foreground\n"
         "  -d <level>  Debug level (%d-%d)\n"
         "  -s          Log to syslog\n"
         "  -w <path>   Ndsctl socket path\n"
         "  -h          Print this help\n"
         "  -v          Print version\n"
         "\n",
         0, 3);
}


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [254 x i8] c"Usage: nodogsplash [options]\0A\0A -c <path> Use configuration file\0A -f Run in foreground\0A -d <level> Debug level (%d-%d)\0A -s Log to syslog\0A -w <path> Ndsctl socket path\0A -h Print this help\0A -v Print version\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [254 x i8] c"Usage: nodogsplash [options]\0A\0A -c <path> Use configuration file\0A -f Run in foreground\0A -d <level> Debug level (%d-%d)\0A -s Log to syslog\0A -w <path> Ndsctl socket path\0A -h Print this help\0A -v Print version\0A\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i32 0, i32 3)
ret void
}
/* Type definitions */
struct display {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display_sync(struct display *);
int /*<<< orphan*/ emit(char *, int);
void display_beep(struct display *display) {
  emit("\a", 1);
  display_sync(display);
}


x86 assembly (clang, -O0):
<display_beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
call   1040 <emit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <display_sync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_beep>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1040 <emit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <display_sync@plt>

LLVM IR (-O0):
%struct.display = type { i32 }
@.str = [2 x i8] c"\07\00"
define void @display_beep(%struct.display* %0) {
%2 = alloca %struct.display*
store %struct.display* %0, %struct.display** %2
%3 = call i32 @emit(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load %struct.display*, %struct.display** %2
%5 = call i32 @display_sync(%struct.display* %4)
ret void
}

LLVM IR (-O2):
%struct.display = type { i32 }
@.str = [2 x i8] c"\07\00"
define void @display_beep(%struct.display* %0) {
%2 = tail call i32 @emit(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @display_sync(%struct.display* %0)
ret void
}
/* Variables and functions */
float sqrtf(float);
float nsvg__vmag(float x, float y) { return sqrtf(x * x + y * y); }


x86 assembly (clang, -O0):
<nsvg__vmag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__vmag>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <nsvg__vmag+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @nsvg__vmag(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = call float @sqrtf(float %10)
ret float %11
}

LLVM IR (-O2):
define float @nsvg__vmag(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrtf(float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_aligned_malloc();
int main() {
  int counter = 0;
  if (!test_aligned_malloc()) {
    printf("Align malloc test failed!\n");
    counter++;
  }
  printf("%d tests failed.\n", counter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_aligned_malloc@plt>
cmp    $0x0,%eax
jne    115d <main+0x3d>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <test_aligned_malloc@plt>
test   %eax,%eax
jne    114f <main+0x1f>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Align malloc test failed!\0A\00"
@.str.1 = [18 x i8] c"%d tests failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_aligned_malloc()
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %5, %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%d tests failed.\0A\00"
@str = [26 x i8] c"Align malloc test failed!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_aligned_malloc()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ 0, %0 ], [ 1, %3 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int colon_builtin(ignore)
char *ignore;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @colon_builtin(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_to_log(char *);
void addr_alignment_incorrect() {
  write_to_log("Error: address is not a multiple of 4.\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Error: address is not a multiple of 4.\0A\00"
define void @addr_alignment_incorrect() {
%1 = call i32 @write_to_log(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Error: address is not a multiple of 4.\0A\00"
define void @addr_alignment_incorrect() {
%1 = tail call i32 @write_to_log(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
void fdleak_debug_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @fdleak_debug_fini() {
ret void
}
unsigned int read_uint32(unsigned char *a) {
  unsigned int value = (a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3];
  return value;
}


x86 assembly (clang, -O0):
<read_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read_uint32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_uint32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int funk(int a, int b) {
  int c = a + b;
  return c;
}


x86 assembly (clang, -O0):
<funk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funk>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @funk(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void test() {
#pragma omp sections
  {
#pragma omp section
    ;
  }
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}