xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ exit(int);
void *malloc(int);
void *xmalloc(int size) {
  void *mem = malloc(size);
  if (mem == NULL) {
    error("xmalloc %d\n", size);
    exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <xmalloc+0x3b>
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%ebx
call   1030 <malloc@plt>
test   %rax,%rax
je     113f <xmalloc+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1040 <error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"xmalloc %d\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"xmalloc %d\0A\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  signed char x;
  unsigned char y;
  x = -32;
  if (((signed short)y) == x) {
    x = 12;
  }
  assert(x == -32);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xe0,-0x5(%rbp)
movzbl -0x6(%rbp),%eax
cwtl
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <main+0x28>
movb   $0xc,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xffffffe0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int test_imm_40int16_reg(short val) {
  return ((val) & (-0x40 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_40int16_reg>:
cmp    $0x40,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_40int16_reg(i16 signext %0) {
%2 = icmp ult i16 %0, 64
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void ff_hevc_idct_32x32_10_avx() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_idct_32x32_10_avx() {
ret void
}
unsigned char hexCharToNibble(char hex) {
  if (hex >= (char)'0' && hex <= (char)'9')
    return (hex - '0');
  return (hex - 'A' + 10);
}


x86 assembly (clang, -O0):
<hexCharToNibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <hexCharToNibble+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <hexCharToNibble+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <hexCharToNibble+0x40>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexCharToNibble>:
lea    -0x30(%rdi),%eax
add    $0xc9,%dil
cmp    $0xa,%al
movzbl %al,%ecx
movzbl %dil,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @hexCharToNibble(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %22
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = add nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %22
22: ; preds = %16, %11
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @hexCharToNibble(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -55
%5 = select i1 %3, i8 %2, i8 %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ gpio_free(int);
int /*<<< orphan*/ gpio_set_value(int, int /*<<< orphan*/);
void module_motor_exit(void) {
  gpio_set_value(21, 0);
  gpio_free(21);
}


x86 assembly (clang, -O0):
<module_motor_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
xor    %esi,%esi
call   1040 <gpio_set_value@plt>
mov    $0x15,%edi
call   1030 <gpio_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_motor_exit>:
push   %rax
mov    $0x15,%edi
xor    %esi,%esi
call   1040 <gpio_set_value@plt>
mov    $0x15,%edi
pop    %rax
jmp    1030 <gpio_free@plt>

LLVM IR (-O0):
define void @module_motor_exit() {
%1 = call i32 @gpio_set_value(i32 21, i32 0)
%2 = call i32 @gpio_free(i32 21)
ret void
}

LLVM IR (-O2):
define void @module_motor_exit() {
%1 = tail call i32 @gpio_set_value(i32 21, i32 0)
%2 = tail call i32 @gpio_free(i32 21)
ret void
}
/* Variables and functions */
int shutdown(int, int);
int HTTPWrapperShutDown(int s, int how) { return shutdown(s, how); }


x86 assembly (clang, -O0):
<HTTPWrapperShutDown>:
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 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTPWrapperShutDown>:
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
define i32 @HTTPWrapperShutDown(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 @shutdown(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @HTTPWrapperShutDown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
void movback(i) register int i;
{
  register int j;
  for (j = i - 1; j >= 0; j--)
    backone(j);
}


x86 assembly (clang, -O0):
<movback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1146 <movback+0x36>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <backone@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <movback+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movback>:
push   %rbx
test   %edi,%edi
jle    1132 <movback+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edi
xor    %eax,%eax
call   1030 <backone@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <movback+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @movback(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
store i32 %5, i32* %3
br label %6
6: ; preds = %12, %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 (i32, ...) bitcast (i32 (...)* @backone to i32 (i32, ...)*)(i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @movback(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @backone to i32 (i32, ...)*)(i32 %5)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chl_import(char *);
char *chl_next_arg(char *);
void _def_import(char *args) {
  char *file;
  if ((file = chl_next_arg(args)))
    chl_import(file);
}


x86 assembly (clang, -O0):
<_def_import>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chl_next_arg@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     114c <_def_import+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <chl_import@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_def_import>:
push   %rax
call   1030 <chl_next_arg@plt>
test   %rax,%rax
je     1134 <_def_import+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <chl_import@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_def_import(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @chl_next_arg(i8* %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @chl_import(i8* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @_def_import(i8* %0) {
%2 = tail call i8* @chl_next_arg(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @chl_import(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ flag_either_pass(char *, char *);
void brake(char *what, char *why) {
  flag_either_pass(what, why);
  exit(0);
}


x86 assembly (clang, -O0):
<brake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <flag_either_pass@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<brake>:
push   %rax
call   1030 <flag_either_pass@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @brake(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @flag_either_pass(i8* %5, i8* %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @brake(i8* %0, i8* %1) {
%3 = tail call i32 @flag_either_pass(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void up_cpus_done(void) {}


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

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

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

LLVM IR (-O2):
define void @up_cpus_done() {
ret void
}
/* Variables and functions */
double powf(float, double);
float star_calc_size(float mass) { return 0.5 * (powf(mass, 0.5)); }


x86 assembly (clang, -O0):
<star_calc_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<star_calc_size>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <powf@plt>
mulsd  0xeda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @star_calc_size(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @powf(float %3, double 5.000000e-01)
%5 = fmul double 5.000000e-01, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @star_calc_size(float %0) {
%2 = tail call double @powf(float %0, double 5.000000e-01)
%3 = fmul double %2, 5.000000e-01
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/FrameBuffer/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"cd /mnt/user/code/FrameBuffer/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"cd /mnt/user/code/FrameBuffer/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(5);
  printf("Hello World");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @sleep(i32 5)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sumOfDigits(int);
int main() {
  int num;
  printf("Enter number to be summed: ");
  scanf("%d", &num);
  printf("\nThe sum of digits is %d\n", sumOfDigits(num));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <sumOfDigits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter number to be summed: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0AThe sum of digits is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @sumOfDigits(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter number to be summed: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0AThe sum of digits is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sumOfDigits(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
double uint_to_double(unsigned int v) { return v; }


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

x86 assembly (clang, -O2):
<uint_to_double>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @uint_to_double(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @uint_to_double(i32 %0) {
%2 = uitofp i32 %0 to double
ret double %2
}
void AD7490_reset(void *AD7490_address) {
  *((volatile char *)&*((volatile int *)AD7490_address + 2) + 0) = 1;
  *((volatile char *)&*((volatile int *)AD7490_address + 2) + 0) = 0;
}


x86 assembly (clang, -O0):
<AD7490_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AD7490_reset>:
movb   $0x1,0x8(%rdi)
movb   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @AD7490_reset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = bitcast i32* %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 0
store volatile i8 1, i8* %7
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = bitcast i32* %10 to i8*
%12 = getelementptr inbounds i8, i8* %11, i64 0
store volatile i8 0, i8* %12
ret void
}

LLVM IR (-O2):
define void @AD7490_reset(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
store volatile i8 1, i8* %2
store volatile i8 0, i8* %2
ret void
}
/* Variables and functions */
int external(short);
int reference_to_mock(short c) { return external(c); }


x86 assembly (clang, -O0):
<reference_to_mock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <external@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reference_to_mock>:
jmp    1030 <external@plt>

LLVM IR (-O0):
define i32 @reference_to_mock(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @external(i16 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @reference_to_mock(i16 signext %0) {
%2 = tail call i32 @external(i16 signext %0)
ret i32 %2
}
/* Variables and functions */
int RandomInteger(int, int);
int /*<<< orphan*/ printf(char *, ...);
int RollTwoDice(void) {
  int d1, d2, total;
  printf("Rolling the dice . . .\n");
  d1 = RandomInteger(1, 6);
  d2 = RandomInteger(1, 6);
  total = d1 + d2;
  printf("You rolled %d and %d -- that's %d.\n", d1, d2, total);
  return (total);
}


x86 assembly (clang, -O0):
<RollTwoDice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x6,%esi
call   1040 <RandomInteger@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x6,%esi
call   1040 <RandomInteger@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RollTwoDice>:
push   %rbp
push   %rbx
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x6,%esi
call   1050 <RandomInteger@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x6,%esi
call   1050 <RandomInteger@plt>
lea    (%rax,%rbx,1),%ebp
lea    0xe97(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Rolling the dice . . .\0A\00"
@.str.1 = [36 x i8] c"You rolled %d and %d -- that's %d.\0A\00"
define i32 @RollTwoDice() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @RandomInteger(i32 1, i32 6)
store i32 %5, i32* %1
%6 = call i32 @RandomInteger(i32 1, i32 6)
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"You rolled %d and %d -- that's %d.\0A\00"
@str = [23 x i8] c"Rolling the dice . . .\00"
define i32 @RollTwoDice() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @RandomInteger(i32 1, i32 6)
%3 = tail call i32 @RandomInteger(i32 1, i32 6)
%4 = add nsw i32 %3, %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int (*status)();
};
typedef TYPE_1__ RAND_METHOD;

/* Variables and functions */
TYPE_1__ *RAND_get_rand_method();
int stub1();
int RAND_status(void) {
  const RAND_METHOD *meth = RAND_get_rand_method();
  if (meth && meth->status)
    return meth->status();
  return 0;
}


x86 assembly (clang, -O0):
<RAND_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <RAND_get_rand_method@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <RAND_status+0x3c>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <RAND_status+0x3c>
mov    -0x10(%rbp),%rcx
mov    $0x0,%al
call   *(%rcx)
mov    %eax,-0x4(%rbp)
jmp    1153 <RAND_status+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_status>:
push   %rax
xor    %eax,%eax
call   1030 <RAND_get_rand_method@plt>
test   %rax,%rax
je     112a <RAND_status+0x1a>
mov    (%rax),%rcx
test   %rcx,%rcx
je     112a <RAND_status+0x1a>
xor    %eax,%eax
pop    %rdx
jmp    *%rcx
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 (...)* }
define i32 @RAND_status() {
%1 = alloca i32
%2 = alloca %struct.TYPE_3__*
%3 = call %struct.TYPE_3__* (...) @RAND_get_rand_method()
store %struct.TYPE_3__* %3, %struct.TYPE_3__** %2
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%5 = icmp ne %struct.TYPE_3__* %4, null
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i32 (...)*, i32 (...)** %8
%10 = icmp ne i32 (...)* %9, null
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i32 (...)*, i32 (...)** %13
%15 = call i32 (...) %14()
store i32 %15, i32* %1
br label %17
16: ; preds = %6, %0
store i32 0, i32* %1
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 (...)* }
define i32 @RAND_status() {
%1 = tail call %struct.TYPE_3__* (...) @RAND_get_rand_method()
%2 = icmp eq %struct.TYPE_3__* %1, null
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i32 (...)*, i32 (...)** %4
%6 = icmp eq i32 (...)* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) %5()
br label %9
9: ; preds = %0, %3, %7
%10 = phi i32 [ %8, %7 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %10
}
void Hunk_Trash(void) { return; }


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

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

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

LLVM IR (-O2):
define void @Hunk_Trash() {
ret void
}
/* Variables and functions */
scalar_t__ atoln(char const *, size_t);
int atoin(const char *str, size_t n) { return (int)atoln(str, n); }


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

x86 assembly (clang, -O2):
<atoin>:
jmp    1030 <atoln@plt>

LLVM IR (-O0):
define i32 @atoin(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @atoln(i8* %5, i64 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @atoin(i8* %0, i64 %1) {
%3 = tail call i64 @atoln(i8* %0, i64 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int add(int, int);
int subtract(int a, int b) { return add(a, -b); }


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

x86 assembly (clang, -O2):
<subtract>:
neg    %esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @add(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ show_builtin_cmd();
int help_cmd(int argc __attribute__((unused)),
             char **argv __attribute__((unused))) {
  show_builtin_cmd();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @help_cmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @show_builtin_cmd()
ret i32 0
}
void key_hash(const char *a_key, char *a_hash) {
  unsigned char digest[256 / 8];
  int i;
  memcpy(digest, a_key, sizeof(digest));
  for (i = 0; i < 30752; i++) {
    SHA256(digest, 32, digest);
  }
  memcpy(a_hash, digest, sizeof(digest));
}


x86 assembly (clang, -O0):
<key_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,-0x30(%rbp)
mov    0x8(%rax),%rcx
mov    %rcx,-0x28(%rbp)
mov    0x10(%rax),%rcx
mov    %rcx,-0x20(%rbp)
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x7820,-0x34(%rbp)
jge    1179 <key_hash+0x69>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <SHA256@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114a <key_hash+0x3a>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rcx
mov    %rcx,0x18(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_hash>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
movups (%rdi),%xmm0
movups 0x10(%rdi),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    $0x7820,%ebp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <SHA256@plt>
add    $0xffffffff,%ebp
jne    1140 <key_hash+0x30>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
movups %xmm1,0x10(%r14)
movups %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @key_hash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [32 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
store i32 0, i32* %6
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 30752
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%15 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @SHA256 to i32 (i8*, i32, i8*, ...)*)(i8* %13, i32 32, i8* %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %9
19: ; preds = %9
%20 = load i8*, i8** %4
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
ret void
}

LLVM IR (-O2):
define void @key_hash(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %8, %5 ]
%7 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @SHA256 to i32 (i8*, i32, i8*, ...)*)(i8* %4, i32 32, i8* %4)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 30752
br i1 %9, label %10, label %5
10: ; preds = %5
ret void
}
/* Variables and functions */
int reverse(int);
int isPalindrome(int i) { return i == reverse(i); }


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
push   %rbx
mov    %edi,%ebx
call   1030 <reverse@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isPalindrome(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @reverse(i32 %4)
%6 = icmp eq i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = tail call i32 @reverse(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ gif_stuff(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void get_global_colormap(Window win) {
  FILE *junk = NULL;
  gif_stuff(win, junk, 1);
}


x86 assembly (clang, -O0):
<get_global_colormap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <gif_stuff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_global_colormap>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <gif_stuff@plt>

LLVM IR (-O0):
define void @get_global_colormap(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%4 = load i32, i32* %2
%5 = load i32*, i32** %3
%6 = call i32 @gif_stuff(i32 %4, i32* %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @get_global_colormap(i32 %0) {
%2 = tail call i32 @gif_stuff(i32 %0, i32* null, i32 1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void delayMicroseconds(uint32_t seconds) { seconds += 1; }


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

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

LLVM IR (-O0):
define void @delayMicroseconds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @delayMicroseconds(i32 %0) {
ret void
}
char *procprt_RTPR_e(struct tstat *curstat, int avgval, int nsecs) {
  return "   -";
}


x86 assembly (clang, -O0):
<procprt_RTPR_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [5 x i8] c" -\00"
define i8* @procprt_RTPR_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [5 x i8] c" -\00"
define i8* @procprt_RTPR_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int japi_helpmenu(int, char *);
int j_helpmenu(int arg0, char *arg1) { return (japi_helpmenu(arg0, arg1)); }


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

x86 assembly (clang, -O2):
<j_helpmenu>:
jmp    1030 <japi_helpmenu@plt>

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

LLVM IR (-O2):
define i32 @j_helpmenu(i32 %0, i8* %1) {
%3 = tail call i32 @japi_helpmenu(i32 %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
__attribute__((always_)) void auto_fcloseFILE(FILE **x) {
  if ((x) && (*x)) {
    fclose(*(FILE **)x);
  }
}


x86 assembly (clang, -O0):
<auto_fcloseFILE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <auto_fcloseFILE+0x31>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <auto_fcloseFILE+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_fcloseFILE>:
test   %rdi,%rdi
je     1122 <auto_fcloseFILE+0x12>
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1122 <auto_fcloseFILE+0x12>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @auto_fcloseFILE(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = icmp ne i32** %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32**, i32*** %2
%11 = load i32*, i32** %10
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
define void @auto_fcloseFILE(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fclose(i32* %4)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void mallocCastToVoid() {
  void *p = malloc(2);
  const void *cp = p;
  free(p);
}


x86 assembly (clang, -O0):
<mallocCastToVoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocCastToVoid>:
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mallocCastToVoid() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
store i8* %4, i8** %2
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @mallocCastToVoid() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ mvprintw(int, int, char *);
void maprint(int i, char *str, int x, int y) {
  attron(i);
  mvprintw(x, y, str);
}


x86 assembly (clang, -O0):
<maprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <attron@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <mvprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maprint>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <attron@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mvprintw@plt>

LLVM IR (-O0):
define void @maprint(i32 %0, i8* %1, i32 %2, i32 %3) {
%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
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @attron(i32 %9)
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i8*, i8** %6
%14 = call i32 @mvprintw(i32 %11, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @maprint(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @attron(i32 %0)
%6 = tail call i32 @mvprintw(i32 %2, i32 %3, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
void output_label_prefix() { output_byte('$'); }


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

x86 assembly (clang, -O2):
<output_label_prefix>:
mov    $0x24,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @output_label_prefix() {
%1 = call i32 @output_byte(i8 signext 36)
ret void
}

LLVM IR (-O2):
define void @output_label_prefix() {
%1 = tail call i32 @output_byte(i8 signext 36)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *new = malloc(size);
  if ((size == 0) || (new == NULL)) {
    fprintf(stderr, "[ERROR] Insufficient memory.\n");
    exit(EXIT_FAILURE);
  }
  return new;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115f <xmalloc+0x2f>
cmpq   $0x0,-0x10(%rbp)
jne    1182 <xmalloc+0x52>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1145 <xmalloc+0x15>
test   %rax,%rax
je     1145 <xmalloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"[ERROR] Insufficient memory.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %8, %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %8
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"[ERROR] Insufficient memory.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp eq i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret i8* %2
}
/* Variables and functions */
char *sign_key_md5_fingerprint(unsigned char *, unsigned int);
char *sign_key_fingerprint(unsigned char *keyblob, unsigned int keybloblen) {
  return sign_key_md5_fingerprint(keyblob, keybloblen);
}


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

x86 assembly (clang, -O2):
<sign_key_fingerprint>:
jmp    1030 <sign_key_md5_fingerprint@plt>

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

LLVM IR (-O2):
define i8* @sign_key_fingerprint(i8* %0, i32 %1) {
%3 = tail call i8* @sign_key_md5_fingerprint(i8* %0, i32 %1)
ret i8* %3
}
void McASPRxHFClkPolaritySet(unsigned int baseAddr, unsigned int polarity) {
  (*((volatile unsigned int *)(baseAddr + (0x74)))) &= ~(0x00004000u);
  (*((volatile unsigned int *)(baseAddr + (0x74)))) |= polarity;
}


x86 assembly (clang, -O0):
<McASPRxHFClkPolaritySet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x74,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffbfff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x74,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxHFClkPolaritySet>:
add    $0x74,%edi
andl   $0xffffbfff,(%rdi)
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPRxHFClkPolaritySet(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 = add i32 %5, 116
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -16385
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 116
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @McASPRxHFClkPolaritySet(i32 %0, i32 %1) {
%3 = add i32 %0, 116
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -16385
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          float);
void show_list_stats(unsigned int num_files, unsigned int num_compressed_bytes,
                     unsigned int num_bytes) {
  float ratio;
  ratio = ((float)num_compressed_bytes / (float)num_bytes) * 100;
  printf("%5u       %10u %8u %3.0f%%\n", num_files, num_bytes,
         num_compressed_bytes, ratio);
  return;
}


x86 assembly (clang, -O0):
<show_list_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
movss  0xec3(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
movss  -0x10(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_list_stats>:
mov    %esi,%ecx
mov    %edi,%esi
mov    %ecx,%eax
cvtsi2ss %rax,%xmm0
mov    %edx,%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
mulss  0xed2(%rip),%xmm0
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%5u %10u %8u %3.0f%%\0A\00"
define void @show_list_stats(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = uitofp i32 %8 to float
%10 = load i32, i32* %6
%11 = uitofp i32 %10 to float
%12 = fdiv float %9, %11
%13 = fmul float %12, 1.000000e+02
store float %13, float* %7
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = load float, float* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, float %17)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%5u %10u %8u %3.0f%%\0A\00"
define void @show_list_stats(i32 %0, i32 %1, i32 %2) {
%4 = uitofp i32 %1 to float
%5 = uitofp i32 %2 to float
%6 = fdiv float %4, %5
%7 = fmul float %6, 1.000000e+02
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2, i32 %1, float %7)
ret void
}
/* Variables and functions */
int doubles_argextreme(double *, int, int);
int doubles_argmin(double *doubles, int size) {
  return doubles_argextreme(doubles, size, 1);
}


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

x86 assembly (clang, -O2):
<doubles_argmin>:
mov    $0x1,%edx
jmp    1030 <doubles_argextreme@plt>

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

LLVM IR (-O2):
define i32 @doubles_argmin(double* %0, i32 %1) {
%3 = tail call i32 @doubles_argextreme(double* %0, i32 %1, i32 1)
ret i32 %3
}
__attribute__((weak)) void __late_init(void) {}


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

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

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

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