xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(237, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @write_dobldobl_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 237, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void printCash(int cash) {
  printf("\n%i\t\t\t\t\t%i\n", cash, cash);
  printf("\t\t\tICH BIN GELD%i\t\t\n", cash);
  printf("%i\t\t\t\t\t%i\n", cash, cash);
}


x86 assembly (clang, -O0):
<printCash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCash>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0A%i\09\09\09\09\09%i\0A\00"
@.str.1 = [21 x i8] c"\09\09\09ICH BIN GELD%i\09\09\0A\00"
@.str.2 = [11 x i8] c"%i\09\09\09\09\09%i\0A\00"
define void @printCash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0A%i\09\09\09\09\09%i\0A\00"
@.str.1 = [21 x i8] c"\09\09\09ICH BIN GELD%i\09\09\0A\00"
@.str.2 = [11 x i8] c"%i\09\09\09\09\09%i\0A\00"
define void @printCash(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 %0)
ret void
}
unsigned short int make16color(unsigned char r, unsigned char g,
                               unsigned char b) {
  return ((((r >> 3) & 31) << 11) | (((g >> 2) & 63) << 5) | ((b >> 3) & 31));
}


x86 assembly (clang, -O0):
<make16color>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
shl    $0xb,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x2,%ecx
and    $0x3f,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make16color>:
shr    $0x3,%dil
movzbl %dil,%eax
shl    $0xb,%eax
shr    $0x2,%sil
movzbl %sil,%ecx
shl    $0x5,%ecx
or     %eax,%ecx
shr    $0x3,%dl
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @make16color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 3
%10 = and i32 %9, 31
%11 = shl i32 %10, 11
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = ashr i32 %13, 2
%15 = and i32 %14, 63
%16 = shl i32 %15, 5
%17 = or i32 %11, %16
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = ashr i32 %19, 3
%21 = and i32 %20, 31
%22 = or i32 %17, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @make16color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = lshr i8 %0, 3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 11
%7 = lshr i8 %1, 2
%8 = zext i8 %7 to i16
%9 = shl nuw nsw i16 %8, 5
%10 = or i16 %9, %6
%11 = lshr i8 %2, 3
%12 = zext i8 %11 to i16
%13 = or i16 %10, %12
ret i16 %13
}
/* Variables and functions */
scalar_t__ dump_sector();
int main(void) {
  while (242) {
    if (dump_sector() < 0)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <dump_sector@plt>
cmp    $0x0,%rax
jge    1135 <main+0x25>
jmp    113a <main+0x2a>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <dump_sector@plt>
test   %rax,%rax
jns    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %6
%3 = call i64 (...) @dump_sector()
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %7
6: ; preds = %2
br label %2
7: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @dump_sector()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ipc_exchange(int, int /*<<< orphan*/);
void nand_reset(void) { ipc_exchange(0x00010000, 0); }


x86 assembly (clang, -O0):
<nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000,%edi
xor    %esi,%esi
call   1030 <ipc_exchange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_reset>:
mov    $0x10000,%edi
xor    %esi,%esi
jmp    1030 <ipc_exchange@plt>

LLVM IR (-O0):
define void @nand_reset() {
%1 = call i32 @ipc_exchange(i32 65536, i32 0)
ret void
}

LLVM IR (-O2):
define void @nand_reset() {
%1 = tail call i32 @ipc_exchange(i32 65536, i32 0)
ret void
}
void pathcon_nm9_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm9_incref() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int *, int);
void put32bit(uint8_t **ptr, uint32_t val) {
  val = ((((val) << 24) & 0xFF000000) | (((val) << 8) & 0xFF0000) |
         (((val) >> 8) & 0xFF00) | (((val) >> 24) & 0xFF));
  memcpy(*ptr, &val, 4);
  (*ptr) += 4;
}


x86 assembly (clang, -O0):
<put32bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32bit>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
bswap  %esi
mov    %esi,0xc(%rsp)
mov    (%rdi),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
addq   $0x10,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @put32bit(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 = shl i32 %5, 24
%7 = and i32 %6, -16777216
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = and i32 %9, 16711680
%11 = or i32 %7, %10
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 65280
%15 = or i32 %11, %14
%16 = load i32, i32* %4
%17 = ashr i32 %16, 24
%18 = and i32 %17, 255
%19 = or i32 %15, %18
store i32 %19, i32* %4
%20 = load i32**, i32*** %3
%21 = load i32*, i32** %20
%22 = call i32 @memcpy(i32* %21, i32* %4, i32 4)
%23 = load i32**, i32*** %3
%24 = load i32*, i32** %23
%25 = getelementptr inbounds i32, i32* %24, i64 4
store i32* %25, i32** %23
ret void
}

LLVM IR (-O2):
define void @put32bit(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @llvm.bswap.i32(i32 %1)
store i32 %4, i32* %3
%5 = load i32*, i32** %0
%6 = call i32 @memcpy(i32* %5, i32* %3, i32 4)
%7 = load i32*, i32** %0
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32* %8, i32** %0
ret void
}
double prv_process_fpa_rdiv_real64(double a, double b) { return b / a; }


x86 assembly (clang, -O0):
<prv_process_fpa_rdiv_real64>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_process_fpa_rdiv_real64>:
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @prv_process_fpa_rdiv_real64(double %0, double %1) {
%3 = fdiv double %1, %0
ret double %3
}
long int _hash(const char *str) {
  long int ret = 0;
  for (int i = 0; str[i] != '\0'; i++) {
    ret += str[i];
  }
  return ret * 6737;
}


x86 assembly (clang, -O0):
<_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114f <_hash+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <_hash+0x17>
imul   $0x1a51,-0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash>:
mov    (%rdi),%al
test   %al,%al
je     112a <_hash+0x2a>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbq %al,%rax
add    %rax,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <_hash+0x10>
imul   $0x1a51,%rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %8
4: ; preds = %8
%5 = mul i64 %13, 6737
br label %6
6: ; preds = %4, %1
%7 = phi i64 [ 0, %1 ], [ %5, %4 ]
ret i64 %7
8: ; preds = %1, %8
%9 = phi i64 [ %14, %8 ], [ 0, %1 ]
%10 = phi i8 [ %16, %8 ], [ %2, %1 ]
%11 = phi i64 [ %13, %8 ], [ 0, %1 ]
%12 = sext i8 %10 to i64
%13 = add nsw i64 %11, %12
%14 = add nuw nsw i64 %9, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %8
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void main() {
  putchar('O');
  putchar('K');
  putchar(' ');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4f,%edi
call   1030 <putchar@plt>
mov    $0x4b,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4f,%edi
call   1030 <putchar@plt>
mov    $0x4b,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @putchar(i8 signext 79)
%2 = call i32 @putchar(i8 signext 75)
%3 = call i32 @putchar(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @putchar(i8 signext 79)
%2 = tail call i32 @putchar(i8 signext 75)
%3 = tail call i32 @putchar(i8 signext 32)
ret void
}
void xSysTickIntEnable(void) {
  (*((volatile unsigned long *)(0xE000E010))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<xSysTickIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xSysTickIntEnable>:
mov    $0xe000e010,%eax
orq    $0x2,(%rax)
ret

LLVM IR (-O0):
define void @xSysTickIntEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @xSysTickIntEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
/* Variables and functions */
double ceil(int /*<<< orphan*/);
scalar_t__ floor(double const);
int /*<<< orphan*/ log10(scalar_t__);
unsigned serd_digits(const double abs) {
  const double lg = ceil(log10(floor(abs) + 1.0));
  return lg < 1.0 ? 1U : (unsigned)lg;
}


x86 assembly (clang, -O0):
<serd_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe8a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    118e <serd_digits+0x5e>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1197 <serd_digits+0x67>
cvttsd2si -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serd_digits>:
push   %rax
call   1050 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeba(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
movsd  0xea1(%rip),%xmm1
maxsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serd_digits(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i64 @floor(double %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fptosi double %7 to i64
%9 = call i32 @log10(i64 %8)
%10 = call double @ceil(i32 %9)
store double %10, double* %3
%11 = load double, double* %3
%12 = fcmp olt double %11, 1.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %1
br label %17
14: ; preds = %1
%15 = load double, double* %3
%16 = fptoui double %15 to i32
br label %17
17: ; preds = %14, %13
%18 = phi i32 [ 1, %13 ], [ %16, %14 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @serd_digits(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fptosi double %4 to i64
%6 = tail call i32 @log10(i64 %5)
%7 = tail call double @ceil(i32 %6)
%8 = fcmp ole double %7, 1.000000e+00
%9 = select i1 %8, double 1.000000e+00, double %7
%10 = fptoui double %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void scamper_dl_close(int fd) {
  close(fd);
  return;
}


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

x86 assembly (clang, -O2):
<scamper_dl_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @scamper_dl_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
__attribute__((__noreturn__)) void usage(void) {
  extern const char *__progname;
  fprintf(stderr, "usage: %s [-s seed] [-r test] [-l] [directory]\n",
          __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [-s seed] [-r test] [-l] [directory]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [-s seed] [-r test] [-l] [directory]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
char *gettext(char *);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_error(void) {
  const char *program = "yp_dump_binding";
  print_usage(stderr);
  fprintf(stderr,
          gettext("Try `%s --help' or `%s --usage' for more information.\n"),
          program, program);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <print_usage@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1050 <print_usage@plt>
mov    (%rbx),%ebx
lea    0xec8(%rip),%rdi
call   1030 <gettext@plt>
lea    0xeac(%rip),%rcx
mov    %ebx,%edi
mov    %rax,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"yp_dump_binding\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = alloca i8*
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = call i32 @print_usage(i32 %2)
%4 = load i32, i32* @stderr
%5 = call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @fprintf(i32 %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"yp_dump_binding\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @print_usage(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32 %3, i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bit_reverse_4bytes(uint32_t x) {
  x = ((x & 0xF0F0F0F0) >> 4) | ((x & 0x0F0F0F0F) << 4);
  x = ((x & 0xCCCCCCCC) >> 2) | ((x & 0x33333333) << 2);
  return ((x & 0xAAAAAAAA) >> 1) | ((x & 0x55555555) << 1);
}


x86 assembly (clang, -O0):
<bit_reverse_4bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f0,%eax
shr    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcccccccc,%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55555555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_reverse_4bytes>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%edi
and    $0xf0f0f0f0,%edi
or     %eax,%edi
mov    %edi,%eax
shr    $0x2,%eax
and    $0x33333333,%eax
and    $0xf3333333,%edi
lea    (%rax,%rdi,4),%eax
mov    %eax,%ecx
shr    %ecx
and    $0x55555555,%ecx
and    $0xd5555555,%eax
lea    (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @bit_reverse_4bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -252645136
%5 = lshr i32 %4, 4
%6 = load i32, i32* %2
%7 = and i32 %6, 252645135
%8 = shl i32 %7, 4
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -858993460
%12 = lshr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 858993459
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, -1431655766
%19 = lshr i32 %18, 1
%20 = load i32, i32* %2
%21 = and i32 %20, 1431655765
%22 = shl i32 %21, 1
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @bit_reverse_4bytes(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 252645135
%4 = shl i32 %0, 4
%5 = and i32 %4, -252645136
%6 = or i32 %3, %5
%7 = lshr i32 %6, 2
%8 = and i32 %7, 858993459
%9 = shl i32 %6, 2
%10 = and i32 %9, -858993460
%11 = or i32 %8, %10
%12 = lshr i32 %11, 1
%13 = and i32 %12, 1431655765
%14 = shl i32 %11, 1
%15 = and i32 %14, -1431655766
%16 = or i32 %13, %15
ret i32 %16
}
/* Variables and functions */
int crc16(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char *);
int main() {
  char str[] = "hey there";
  printf("%u\n", crc16(str, strlen(str)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <crc16@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x7265687420796568,%rax
68 65 72
mov    %rax,(%rsp)
movw   $0x65,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <crc16@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [10 x i8] c"hey there\00"
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @crc16(i8* %4, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"hey there\00"
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @crc16(i8* %2, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void bar2(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @psxBREAK() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_pair();
void leak2(void) { alloc_pair(); }


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

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

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

LLVM IR (-O2):
define void @leak2() {
%1 = tail call i32 (...) @alloc_pair()
ret void
}
int x_snoop_init(struct hostapd_data *hapd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define i32 @x_snoop_init(%struct.hostapd_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_expression();
int /*<<< orphan*/ printf(char *);
void do_free() {
  do_expression();
  printf("\tpushr R1\n");
  printf("\tsyscall SYSCALL_FREE\n");
}


x86 assembly (clang, -O0):
<do_free>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <do_expression@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_free>:
push   %rax
xor    %eax,%eax
call   1040 <do_expression@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09pushr R1\0A\00"
@.str.1 = [23 x i8] c"\09syscall SYSCALL_FREE\0A\00"
define void @do_free() {
%1 = call i32 (...) @do_expression()
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"\09pushr R1\00"
@str.2 = [22 x i8] c"\09syscall SYSCALL_FREE\00"
define void @do_free() {
%1 = tail call i32 (...) @do_expression()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct TS_reader {
  int dummy;
};

/* Variables and functions */
struct TS_reader *tsreader_new(char *);
struct TS_reader *tsreader_new_nofile() {
  struct TS_reader *tsreader = tsreader_new((char *)NULL);
  return tsreader;
}


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

x86 assembly (clang, -O2):
<tsreader_new_nofile>:
xor    %edi,%edi
jmp    1030 <tsreader_new@plt>

LLVM IR (-O0):
%struct.TS_reader = type { i32 }
define %struct.TS_reader* @tsreader_new_nofile() {
%1 = alloca %struct.TS_reader*
%2 = call %struct.TS_reader* @tsreader_new(i8* null)
store %struct.TS_reader* %2, %struct.TS_reader** %1
%3 = load %struct.TS_reader*, %struct.TS_reader** %1
ret %struct.TS_reader* %3
}

LLVM IR (-O2):
%struct.TS_reader = type { i32 }
define %struct.TS_reader* @tsreader_new_nofile() {
%1 = tail call %struct.TS_reader* @tsreader_new(i8* null)
ret %struct.TS_reader* %1
}
void reb_integrator_leapfrog_reset(struct reb_simulation *r) {}


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

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

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

LLVM IR (-O2):
%struct.reb_simulation = type opaque
define void @reb_integrator_leapfrog_reset(%struct.reb_simulation* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int _rotr(unsigned int, int);
unsigned int _rotl(unsigned int value, int shift) {
  int max_bits = sizeof(unsigned int) << 3;
  if (shift < 0)
    return _rotr(value, -shift);
  if (shift > max_bits)
    shift = shift % max_bits;
  return (value << shift) | (value >> (max_bits - shift));
}


x86 assembly (clang, -O0):
<_rotl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1144 <_rotl+0x34>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <_rotr@plt>
mov    %eax,-0x4(%rbp)
jmp    1174 <_rotl+0x64>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    115a <_rotl+0x4a>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rotl>:
test   %esi,%esi
js     111b <_rotl+0xb>
mov    %esi,%ecx
rol    %cl,%edi
mov    %edi,%eax
ret
neg    %esi
jmp    1030 <_rotr@plt>

LLVM IR (-O0):
define i32 @_rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 32, i32* %6
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 0, %11
%13 = call i32 @_rotr(i32 %10, i32 %12)
store i32 %13, i32* %3
br label %32
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = srem i32 %19, %20
store i32 %21, i32* %5
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = shl i32 %23, %24
%26 = load i32, i32* %4
%27 = load i32, i32* %6
%28 = load i32, i32* %5
%29 = sub nsw i32 %27, %28
%30 = lshr i32 %26, %29
%31 = or i32 %25, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %22, %9
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @_rotl(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = tail call i32 @_rotr(i32 %0, i32 %5)
br label %15
7: ; preds = %2
%8 = icmp ugt i32 %1, 32
%9 = and i32 %1, 31
%10 = select i1 %8, i32 %9, i32 %1
%11 = shl i32 %0, %10
%12 = sub nuw nsw i32 32, %10
%13 = lshr i32 %0, %12
%14 = or i32 %13, %11
br label %15
15: ; preds = %7, %4
%16 = phi i32 [ %6, %4 ], [ %14, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_SchedulingLEDs(unsigned short weekday_led,
                           unsigned short scheduling_led) {
  char data[] = {162, weekday_led, scheduling_led};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_SchedulingLEDs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movb   $0xa2,-0x7(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %al,-0x5(%rbp)
lea    -0x7(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_SchedulingLEDs>:
push   %rax
movb   $0xa2,0x5(%rsp)
mov    %dil,0x6(%rsp)
mov    %sil,0x7(%rsp)
lea    0x5(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_SchedulingLEDs(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca [3 x i8]
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 -94, i8* %6
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i16, i16* %3
%9 = trunc i16 %8 to i8
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i16, i16* %4
%12 = trunc i16 %11 to i8
store i8 %12, i8* %10
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%14 = call i32 @SerialWriteString(i8* %13)
ret void
}

LLVM IR (-O2):
define void @iRobot_SchedulingLEDs(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 -94, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
%6 = trunc i16 %0 to i8
store i8 %6, i8* %5
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%8 = trunc i16 %1 to i8
store i8 %8, i8* %7
%9 = call i32 @SerialWriteString(i8* %4)
ret void
}
unsigned inthash(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @inthash(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int /*<<< orphan*/);
int hea_cq_aer_cq_overflow_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 0);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_cq_overflow_err_check>:
mov    (%rdi),%edi
xor    %esi,%esi
jmp    1030 <hea_test_u64_bit@plt>

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

LLVM IR (-O2):
define i32 @hea_cq_aer_cq_overflow_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
struct notifier_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tco_timer_stop();
int i8xx_tco_notify_sys(struct notifier_block *this, unsigned long code,
                        void *unused) {
  {
    if (code == 1UL) {
      tco_timer_stop();
    } else if (code == 2UL) {
      tco_timer_stop();
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<i8xx_tco_notify_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    113b <i8xx_tco_notify_sys+0x2b>
mov    $0x0,%al
call   1030 <tco_timer_stop@plt>
jmp    1152 <i8xx_tco_notify_sys+0x42>
cmpq   $0x2,-0x10(%rbp)
jne    114d <i8xx_tco_notify_sys+0x3d>
mov    $0x0,%al
call   1030 <tco_timer_stop@plt>
jmp    1152 <i8xx_tco_notify_sys+0x42>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8xx_tco_notify_sys>:
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     1126 <i8xx_tco_notify_sys+0x16>
push   %rax
xor    %eax,%eax
call   1030 <tco_timer_stop@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.notifier_block = type { i32 }
define i32 @i8xx_tco_notify_sys(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = add i64 %1, -1
%5 = icmp ult i64 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @tco_timer_stop()
br label %8
8: ; preds = %3, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ big_delay();
int /*<<< orphan*/ delay();
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
void led_demo(void) {
  int i;
  for (;;) {
    for (i = 0; i < 2; i++) {
      led_on();
      delay();
      led_off();
      delay();
    }
    big_delay();
  }
}


x86 assembly (clang, -O0):
<led_demo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1183 <led_demo+0x43>
mov    $0x0,%al
call   1060 <led_on@plt>
mov    $0x0,%al
call   1050 <delay@plt>
mov    $0x0,%al
call   1030 <led_off@plt>
mov    $0x0,%al
call   1050 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <led_demo+0xf>
mov    $0x0,%al
call   1040 <big_delay@plt>
jmp    1148 <led_demo+0x8>

x86 assembly (clang, -O2):
<led_demo>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <led_on@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1060 <led_on@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1040 <big_delay@plt>
jmp    1150 <led_demo+0x10>

LLVM IR (-O0):
define void @led_demo() {
%1 = alloca i32
br label %2
2: ; preds = %14, %0
store i32 0, i32* %1
br label %3
3: ; preds = %11, %2
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i32 (...) @led_on()
%8 = call i32 (...) @delay()
%9 = call i32 (...) @led_off()
%10 = call i32 (...) @delay()
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = call i32 (...) @big_delay()
br label %2
}

LLVM IR (-O2):
define void @led_demo() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @led_on()
%3 = tail call i32 (...) @delay()
%4 = tail call i32 (...) @led_off()
%5 = tail call i32 (...) @delay()
%6 = tail call i32 (...) @led_on()
%7 = tail call i32 (...) @delay()
%8 = tail call i32 (...) @led_off()
%9 = tail call i32 (...) @delay()
%10 = tail call i32 (...) @big_delay()
br label %1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, char, int);
char *whatisyourname(void) {
  char *result = malloc(257);
  memcpy(result, "neo", 3);
  memset(result + 3, ' ', 256 - 3);
  result[256] = 0;
  return result;
}


x86 assembly (clang, -O0):
<whatisyourname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x101,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x3,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
mov    $0x20,%esi
mov    $0xfd,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,0x100(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whatisyourname>:
push   %rbx
mov    $0x101,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
mov    $0x3,%edx
call   1040 <memcpy@plt>
lea    0x3(%rbx),%rdi
mov    $0x20,%esi
mov    $0xfd,%edx
call   1030 <memset@plt>
movb   $0x0,0x100(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"neo\00"
define i8* @whatisyourname() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 257)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 3
%7 = call i32 @memset(i8* %6, i8 signext 32, i32 253)
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 256
store i8 0, i8* %9
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"neo\00"
define i8* @whatisyourname() {
%1 = tail call dereferenceable_or_null(257) i8* @malloc(i32 257)
%2 = tail call i32 @memcpy(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = getelementptr inbounds i8, i8* %1, i64 3
%4 = tail call i32 @memset(i8* %3, i8 signext 32, i32 253)
%5 = getelementptr inbounds i8, i8* %1, i64 256
store i8 0, i8* %5
ret i8* %1
}
/* Variables and functions */
int write(int, void *, int);
int I2C_write(int i2c_fd, void *tx_buffer, int n_bytes) {
  int ret;
  ret = write(i2c_fd, tx_buffer, n_bytes);
  if (ret < 0)
    return ret;
  return 0;
}


x86 assembly (clang, -O0):
<I2C_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1149 <I2C_write+0x39>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <I2C_write+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_write>:
push   %rax
call   1030 <write@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @I2C_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool I2CMasterBusy(uint32_t ui32Base) {
  ;
  if ((*((volatile unsigned long *)(ui32Base + 0x00000004))) & 0x00000001) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2CMasterBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     112a <I2CMasterBusy+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <I2CMasterBusy+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterBusy>:
mov    0x4(%rdi),%rax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @I2CMasterBusy(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 1
ret i32 %6
}
/* Type definitions */
struct mtp2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mtp2_setstate(struct mtp2 *, int /*<<< orphan*/);
void t3_expiry(void *data) {
  struct mtp2 *link = data;
  mtp2_setstate(link, 0);
  return;
}


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

x86 assembly (clang, -O2):
<t3_expiry>:
xor    %esi,%esi
jmp    1030 <mtp2_setstate@plt>

LLVM IR (-O0):
%struct.mtp2 = type { i32 }
define void @t3_expiry(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.mtp2*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.mtp2*
store %struct.mtp2* %5, %struct.mtp2** %3
%6 = load %struct.mtp2*, %struct.mtp2** %3
%7 = call i32 @mtp2_setstate(%struct.mtp2* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.mtp2 = type { i32 }
define void @t3_expiry(i8* %0) {
%2 = bitcast i8* %0 to %struct.mtp2*
%3 = tail call i32 @mtp2_setstate(%struct.mtp2* %2, i32 0)
ret void
}