xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ activecpu_adjust_icount(int);
int activecpu_get_icount();
void activecpu_eat_cycles(int cycles) {
  int cyclesleft = activecpu_get_icount();
  if (cycles > cyclesleft)
    cycles = cyclesleft;
  activecpu_adjust_icount(-cycles);
}


x86 assembly (clang, -O0):
<activecpu_eat_cycles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <activecpu_get_icount@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1147 <activecpu_eat_cycles+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1030 <activecpu_adjust_icount@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<activecpu_eat_cycles>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <activecpu_get_icount@plt>
cmp    %ebx,%eax
cmovl  %eax,%ebx
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <activecpu_adjust_icount@plt>

LLVM IR (-O0):
define void @activecpu_eat_cycles(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @activecpu_get_icount()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
%12 = sub nsw i32 0, %11
%13 = call i32 @activecpu_adjust_icount(i32 %12)
ret void
}

LLVM IR (-O2):
define void @activecpu_eat_cycles(i32 %0) {
%2 = tail call i32 (...) @activecpu_get_icount()
%3 = icmp slt i32 %2, %0
%4 = select i1 %3, i32 %2, i32 %0
%5 = sub nsw i32 0, %4
%6 = tail call i32 @activecpu_adjust_icount(i32 %5)
ret void
}
int icomp(char *i, char *j) {
  int I, J;
  I = (int)i;
  J = (int)j;
  if (I == J)
    return 0;
  if (I > J)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<icomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1132 <icomp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1151 <icomp+0x51>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114a <icomp+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <icomp+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icomp>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @icomp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t TimerClockSourceGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000FC8))));
}


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

x86 assembly (clang, -O2):
<TimerClockSourceGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0xfc8(%rax),%rax
ret

LLVM IR (-O0):
define i64 @TimerClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 4040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @TimerClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 4040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_max_sd(__m128d A, __m128d B) { return _mm_max_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_max_sd>:
jmp    1030 <_mm_max_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_max_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_sd(i32 %0, i32 %1)
ret i32 %3
}
void fc99(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    }
    goto a;
    ;
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc99(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
br label %20
9: ; No predecessors!
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %9, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc99(i32 %0) {
ret void
}
/* Variables and functions */
bool nrf52_errata_63(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_63() {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int mismatch(const char *a, const char *b) {
  if (a == b)
    return 0;
  if ((a == NULL) || (b == NULL))
    return 1;
  return 0 != strcmp(a, b);
}


x86 assembly (clang, -O0):
<mismatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <mismatch+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    117c <mismatch+0x6c>
cmpq   $0x0,-0x10(%rbp)
je     1150 <mismatch+0x40>
cmpq   $0x0,-0x18(%rbp)
jne    115c <mismatch+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    117c <mismatch+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mismatch>:
cmp    %rsi,%rdi
je     113a <mismatch+0x2a>
mov    $0x1,%eax
test   %rdi,%rdi
je     1139 <mismatch+0x29>
test   %rsi,%rsi
je     1139 <mismatch+0x29>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mismatch(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
%6 = icmp eq i8* %1, null
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ], [ 1, %4 ]
ret i32 %13
}
/* Type definitions */
struct Address {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Address *);
void delAddress(struct Address *address) {
  if (address != NULL)
    free(address);
}


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

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

LLVM IR (-O0):
%struct.Address = type { i32 }
define void @delAddress(%struct.Address* %0) {
%2 = alloca %struct.Address*
store %struct.Address* %0, %struct.Address** %2
%3 = load %struct.Address*, %struct.Address** %2
%4 = icmp ne %struct.Address* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.Address*, %struct.Address** %2
%7 = call i32 @free(%struct.Address* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.Address = type { i32 }
define void @delAddress(%struct.Address* %0) {
%2 = icmp eq %struct.Address* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.Address* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fourth(int);
int /*<<< orphan*/ printf(char *, unsigned long);
extern void third(unsigned long arg) {
  printf("third: 0x%x\n", arg);
  fourth(0xbeeffeed);
}


x86 assembly (clang, -O0):
<third>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbeeffeed,%edi
call   1040 <fourth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<third>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbeeffeed,%edi
pop    %rax
jmp    1040 <fourth@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"third: 0x%x\0A\00"
define void @third(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i32 @fourth(i32 -1091567891)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"third: 0x%x\0A\00"
define void @third(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = tail call i32 @fourth(i32 -1091567891)
ret void
}
/* Variables and functions */
scalar_t__ ehnlc_isdigit(int);
int ehnlc_isxdigit(int c) {
  return (ehnlc_isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
             ? 4096
             : 0;
}


x86 assembly (clang, -O0):
<ehnlc_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ehnlc_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <ehnlc_isxdigit+0x5d>
cmpl   $0x41,-0x4(%rbp)
jl     114e <ehnlc_isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116d <ehnlc_isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <ehnlc_isxdigit+0x57>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1000,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <ehnlc_isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
shl    $0xc,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ehnlc_isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ehnlc_isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 70
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 4096, i32 0
ret i32 %23
}

LLVM IR (-O2):
define i32 @ehnlc_isxdigit(i32 %0) {
%2 = tail call i64 @ehnlc_isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = select i1 %7, i32 4096, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  printf("a andn b is %d\n", 0x458a0182);
  printf("b orn  a is %d\n", 0xba75fe7d);
  printf("a xorn c is %d\n", 0x3223fe67);
  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)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x458a0182,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0xba75fe7d,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x3223fe67,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x458a0182,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0xba75fe7d,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x3223fe67,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a andn b is %d\0A\00"
@.str.1 = [16 x i8] c"b orn a is %d\0A\00"
@.str.2 = [16 x i8] c"a xorn c is %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1166672258)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 -1166672259)
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 841219687)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a andn b is %d\0A\00"
@.str.1 = [16 x i8] c"b orn a is %d\0A\00"
@.str.2 = [16 x i8] c"a xorn c is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1166672258)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 -1166672259)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 841219687)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int, double, double);
int /*<<< orphan*/ printfail();
void fexpectd(char *file, int line, double a, double b) {
  if (a == b)
    return;
  printfail();
  printf("%s:%d: %lf expected, but got %lf\n", file, line, a, b);
  exit(1);
}


x86 assembly (clang, -O0):
<fexpectd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1165 <fexpectd+0x35>
jp     1165 <fexpectd+0x35>
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1040 <printfail@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fexpectd>:
ucomisd %xmm1,%xmm0
jne    1139 <fexpectd+0x9>
jp     1139 <fexpectd+0x9>
ret
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <printfail@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"%s:%d: %lf expected, but got %lf\0A\00"
define void @fexpectd(i8* %0, i32 %1, double %2, double %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = fcmp oeq double %9, %10
br i1 %11, label %12, label %13
12: ; preds = %4
ret void
13: ; preds = %4
%14 = call i32 (...) @printfail()
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load double, double* %7
%18 = load double, double* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, double %17, double %18)
%20 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"%s:%d: %lf expected, but got %lf\0A\00"
define void @fexpectd(i8* %0, i32 %1, double %2, double %3) {
%5 = fcmp oeq double %2, %3
br i1 %5, label %6, label %7
6: ; preds = %4
ret void
7: ; preds = %4
%8 = tail call i32 (...) @printfail()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, double %2, double %3)
%10 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int f19(unsigned int x, int y __attribute__((unused))) {
  return (x >> (8 * 4 - 1)) ^ (x << 1);
}


x86 assembly (clang, -O0):
<f19>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f19(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 = lshr i32 %5, 31
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f19(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
short int shortint_ignoring_signedlongint(short int x, signed long int y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_signedlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @shortint_ignoring_signedlongint(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_signedlongint(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ pifacecad_lcd_set_backlight(int);
void pifacecad_lcd_backlight_on(void) { pifacecad_lcd_set_backlight(1); }


x86 assembly (clang, -O0):
<pifacecad_lcd_backlight_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <pifacecad_lcd_set_backlight@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pifacecad_lcd_backlight_on>:
mov    $0x1,%edi
jmp    1030 <pifacecad_lcd_set_backlight@plt>

LLVM IR (-O0):
define void @pifacecad_lcd_backlight_on() {
%1 = call i32 @pifacecad_lcd_set_backlight(i32 1)
ret void
}

LLVM IR (-O2):
define void @pifacecad_lcd_backlight_on() {
%1 = tail call i32 @pifacecad_lcd_set_backlight(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drain();
void put_char(unsigned char c) {
  drain();
  (*(volatile unsigned long *)(0x80000000 + (0x0480))) = c;
}


x86 assembly (clang, -O0):
<put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <drain@plt>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0x80000480,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_char>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <drain@plt>
mov    %ebx,%eax
mov    $0x80000480,%ecx
mov    %rax,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @put_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @drain()
%4 = load i8, i8* %2
%5 = zext i8 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 2147484800 to i64*)
ret void
}

LLVM IR (-O2):
define void @put_char(i8 zeroext %0) {
%2 = tail call i32 (...) @drain()
%3 = zext i8 %0 to i64
store volatile i64 %3, i64* inttoptr (i64 2147484800 to i64*)
ret void
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ deg2rad(double);
double limit_minutes(double);
double eot(double m, double alpha, double del_psi, double epsilon) {
  return limit_minutes(
      4.0 * (m - 0.0057183 - alpha + del_psi * cos(deg2rad(epsilon))));
}


x86 assembly (clang, -O0):
<eot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
subsd  %xmm1,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe61(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <limit_minutes@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eot>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
addsd  0xebe(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm0
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xe98(%rip),%xmm0
add    $0x18,%rsp
jmp    1030 <limit_minutes@plt>

LLVM IR (-O0):
define double @eot(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = fsub double %9, 5.718300e-03
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call i32 @deg2rad(double %14)
%16 = call double @cos(i32 %15)
%17 = call double @llvm.fmuladd.f64(double %13, double %16, double %12)
%18 = fmul double 4.000000e+00, %17
%19 = call double @limit_minutes(double %18)
ret double %19
}

LLVM IR (-O2):
define double @eot(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, -5.718300e-03
%6 = fsub double %5, %1
%7 = tail call i32 @deg2rad(double %3)
%8 = tail call double @cos(i32 %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double %8, double %6)
%10 = fmul double %9, 4.000000e+00
%11 = tail call double @limit_minutes(double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
char *intToRoman(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", intToRoman(atoi(argv[1])));
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <intToRoman@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i8* @intToRoman(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
int tabpos(int pos, char *tab) {
  if (pos > 100)
    return 1;
  else
    return tab[pos];
}


x86 assembly (clang, -O0):
<tabpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    1121 <tabpos+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1130 <tabpos+0x30>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabpos>:
mov    $0x1,%eax
cmp    $0x64,%edi
jg     1111 <tabpos+0x11>
movslq %edi,%rax
movsbl (%rsi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @tabpos(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 100
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %16
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @tabpos(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 100
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
double randf();
void rand_vector(int n, double *x) {
  int i;
  for (i = 0; i < n; i++) {
    x[i] = randf();
  }
}


x86 assembly (clang, -O0):
<rand_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <rand_vector+0x44>
mov    $0x0,%al
call   1030 <randf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <rand_vector+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rand_vector(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call double (...) @randf()
%12 = load double*, double** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @rand_vector(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call double (...) @randf()
%9 = getelementptr inbounds double, double* %1, i64 %7
store double %8, double* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int rotl32(int, int);
uint32_t serpent_gen_w(uint32_t *b, uint8_t i) {
  uint32_t ret;
  ret = b[0] ^ b[3] ^ b[5] ^ b[7] ^ 0x9e3779b9l ^ (uint32_t)i;
  ret = rotl32(ret, 11);
  return ret;
}


x86 assembly (clang, -O0):
<serpent_gen_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
xor    0xc(%rcx),%eax
mov    -0x8(%rbp),%rcx
xor    0x14(%rcx),%eax
mov    -0x8(%rbp),%rcx
xor    0x1c(%rcx),%eax
cltq
movabs $0x9e3779b9,%rcx
xor    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq %ecx,%rcx
xor    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0xb,%esi
call   1030 <rotl32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serpent_gen_w>:
xor    (%rdi),%esi
xor    0xc(%rdi),%esi
xor    0x14(%rdi),%esi
xor    0x1c(%rdi),%esi
xor    $0x9e3779b9,%esi
mov    %esi,%edi
mov    $0xb,%esi
jmp    1030 <rotl32@plt>

LLVM IR (-O0):
define i32 @serpent_gen_w(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 3
%11 = load i32, i32* %10
%12 = xor i32 %8, %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 5
%15 = load i32, i32* %14
%16 = xor i32 %12, %15
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 7
%19 = load i32, i32* %18
%20 = xor i32 %16, %19
%21 = sext i32 %20 to i64
%22 = xor i64 %21, 2654435769
%23 = load i64, i64* %4
%24 = trunc i64 %23 to i32
%25 = sext i32 %24 to i64
%26 = xor i64 %22, %25
%27 = trunc i64 %26 to i32
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = call i32 @rotl32(i32 %28, i32 11)
store i32 %29, i32* %5
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @serpent_gen_w(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 7
%9 = load i32, i32* %8
%10 = trunc i64 %1 to i32
%11 = xor i32 %3, %10
%12 = xor i32 %11, %5
%13 = xor i32 %12, %7
%14 = xor i32 %13, %9
%15 = xor i32 %14, -1640531527
%16 = tail call i32 @rotl32(i32 %15, i32 11)
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ mkdoer(char *);
void create() { mkdoer("noop"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"noop\00"
define void @create() {
%1 = call i32 @mkdoer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"noop\00"
define void @create() {
%1 = tail call i32 @mkdoer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint64_t;
typedef int /*<<< orphan*/ num;

/* Variables and functions */
uint64_t ConvertGrayToBinary64(uint64_t num) {
  unsigned int numBits = 8 * sizeof(num);
  unsigned int shift;
  for (shift = 1; shift < numBits; shift = 2 * shift)
    num = num ^ (num >> shift);
  return num;
}


x86 assembly (clang, -O0):
<ConvertGrayToBinary64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1141 <ConvertGrayToBinary64+0x41>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ConvertGrayToBinary64+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertGrayToBinary64>:
mov    %edi,%eax
shr    %eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ConvertGrayToBinary64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = lshr i32 %11, %12
%14 = xor i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = mul i32 2, %16
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ConvertGrayToBinary64(i32 %0) {
%2 = lshr i32 %0, 1
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 8
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 16
%11 = xor i32 %10, %9
ret i32 %11
}
const char *_acu_BZ2_bzlibVersion(void) { return "1.0.6, 6-Sept-2010"; }


x86 assembly (clang, -O0):
<_acu_BZ2_bzlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_acu_BZ2_bzlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"1.0.6, 6-Sept-2010\00"
define i8* @_acu_BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"1.0.6, 6-Sept-2010\00"
define i8* @_acu_BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void gtk_tree_view_column_set_sort_column_id() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_text_window_type_get_type() {
ret void
}
int foo() {
  char a[8];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [8 x i8]
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ void_to_num(void *);
int64_t offset_addr(void *a, void *base) {
  return void_to_num(a) - void_to_num(base);
}


x86 assembly (clang, -O0):
<offset_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <void_to_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <void_to_num@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset_addr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <void_to_num@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <void_to_num@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @offset_addr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @void_to_num(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @void_to_num(i8* %7)
%9 = sub nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @offset_addr(i8* %0, i8* %1) {
%3 = tail call i64 @void_to_num(i8* %0)
%4 = tail call i64 @void_to_num(i8* %1)
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int do_signal(int *, int *);
int main() {
  int r = 6, o = 5;
  return do_signal(&o, &r) - 11;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <do_signal@plt>
sub    $0xb,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6,0x4(%rsp)
movl   $0x5,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <do_signal@plt>
add    $0xfffffff5,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 5, i32* %3
%4 = call i32 @do_signal(i32* %3, i32* %2)
%5 = sub nsw i32 %4, 11
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 6, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = call i32 @do_signal(i32* %2, i32* %1)
%6 = add nsw i32 %5, -11
ret i32 %6
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double wtime() {
  static struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + 1.0e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<wtime>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  0x2f04(%rip),%xmm1
movsd  0x2f04(%rip),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtime>:
push   %rax
lea    0x2f18(%rip),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x2f11(%rip),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x2ef9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
@wtime.tv = internal global %struct.timeval zeroinitializer
define double @wtime() {
%1 = call i32 @gettimeofday(%struct.timeval* @wtime.tv, i32* null)
%2 = load double, double* getelementptr inbounds (%struct.timeval, %struct.timeval* @wtime.tv, i32 0, i32 0)
%3 = load double, double* getelementptr inbounds (%struct.timeval, %struct.timeval* @wtime.tv, i32 0, i32 1)
%4 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %3, double %2)
ret double %4
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
@wtime.tv = internal global %struct.timeval zeroinitializer
define double @wtime() {
%1 = tail call i32 @gettimeofday(%struct.timeval* @wtime.tv, i32* null)
%2 = load double, double* getelementptr inbounds (%struct.timeval, %struct.timeval* @wtime.tv, i64 0, i32 0)
%3 = load double, double* getelementptr inbounds (%struct.timeval, %struct.timeval* @wtime.tv, i64 0, i32 1)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x3EB0C6F7A0B5ED8D, double %2)
ret double %4
}
int IDStartsWithA(const char *id, const char *name, int purchase) {
  if (*id == 'A')
    return purchase;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IDStartsWithA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jne    112a <IDStartsWithA+0x2a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <IDStartsWithA+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDStartsWithA>:
xor    %eax,%eax
cmpb   $0x41,(%rdi)
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @IDStartsWithA(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 65
%6 = select i1 %5, i32 %2, i32 0
ret i32 %6
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int bFlip(unsigned percent) {
  return (unsigned long)rand() <
         percent * (((unsigned long)RAND_MAX + 1) / 100);
}


x86 assembly (clang, -O0):
<bFlip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    0x2eb6(%rip),%rax
mov    (%rax),%rax
add    $0x1,%rax
mov    $0x64,%esi
xor    %edx,%edx
div    %rsi
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
imul   %rdx,%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bFlip>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
mov    %ebx,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%rax
add    $0x1,%rax
shr    $0x2,%rax
movabs $0x28f5c28f5c28f5c3,%rdx
c2 f5 28
mul    %rdx
shr    $0x2,%rdx
imul   %rsi,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @bFlip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rand()
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i64, i64* @RAND_MAX
%7 = add i64 %6, 1
%8 = udiv i64 %7, 100
%9 = mul i64 %5, %8
%10 = icmp ult i64 %3, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @bFlip(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = zext i32 %0 to i64
%4 = load i64, i64* @RAND_MAX
%5 = add i64 %4, 1
%6 = udiv i64 %5, 100
%7 = mul i64 %6, %3
%8 = icmp ult i64 %2, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ set_window(int /*<<< orphan*/);
int /*<<< orphan*/ winarg0();
void z_set_window(void) { set_window(winarg0()); }


x86 assembly (clang, -O0):
<z_set_window>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <winarg0@plt>
mov    %eax,%edi
call   1040 <set_window@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_set_window>:
push   %rax
xor    %eax,%eax
call   1030 <winarg0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <set_window@plt>

LLVM IR (-O0):
define void @z_set_window() {
%1 = call i32 (...) @winarg0()
%2 = call i32 @set_window(i32 %1)
ret void
}

LLVM IR (-O2):
define void @z_set_window() {
%1 = tail call i32 (...) @winarg0()
%2 = tail call i32 @set_window(i32 %1)
ret void
}
OP(ed, af) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
int *external(int *x) { return x + 1; }


x86 assembly (clang, -O0):
<external>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<external>:
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @external(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *, int);
void GenNumLabel(int Label) { printf2(".L%d\n", Label); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c".L%d\0A\00"
define void @GenNumLabel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c".L%d\0A\00"
define void @GenNumLabel(i32 %0) {
%2 = tail call i32 @printf2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef unsigned long uint16_t;

/* Variables and functions */
void unset_bit_u16(int nr, uint16_t *addr) {
  addr[nr >> 4] &= ~(1UL << (nr & 15));
}


x86 assembly (clang, -O0):
<unset_bit_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_bit_u16>:
mov    %edi,%ecx
and    $0xf,%cl
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
sar    $0x4,%edi
movslq %edi,%rcx
and    %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @unset_bit_u16(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 15
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = xor i64 %8, -1
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = ashr i32 %11, 4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
%15 = load i64, i64* %14
%16 = and i64 %15, %9
store i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @unset_bit_u16(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 15
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = xor i64 %5, -1
%7 = ashr i32 %0, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %1, i64 %8
%10 = load i64, i64* %9
%11 = and i64 %10, %6
store i64 %11, i64* %9
ret void
}