#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int bugs = 100;
  double bug_rate = 1.2;
  printf("You have %d bugs at the imaginary rate of %f.\n", bugs, bug_rate);
  unsigned long universe_of_defects = 100000000L * 1000L * 10002500L * 100200L;
  printf("The entire universe has %ld bugs.\n", universe_of_defects);
  double expected_bugs = bugs * bug_rate;
  printf("You are expected to have %.1f bugs.\n", expected_bugs);
  double part_of_universe = expected_bugs / universe_of_defects;
  printf("That is only a %e portion of the universe.\n", part_of_universe);
  char nul_byte = '\0';
  int care_percentage = bugs * nul_byte;
  printf("Which means you should care %d%%.\n", care_percentage);
  char zero = 0;
  int nul_is_zero = (nul_byte == zero);
  printf("Is nul_byte equal to zero? %d\n", nul_is_zero);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movabs $0x3ff3333333333333,%rax
33 f3 3f
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xedd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movabs $0x35fa17ed44290000,%rax
17 fa 35
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeed(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x39(%rbp)
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movaps 0xe61(%rip),%xmm2
movq   -0x18(%rbp),%xmm1
punpckldq %xmm2,%xmm1
movapd 0xe60(%rip),%xmm2
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvttsd2si -0x28(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x29(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x29(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x31(%rbp)
movsbl -0x29(%rbp),%eax
movsbl -0x31(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x64,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x44290000,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf55(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"You have %d bugs at the imaginary rate of %f.\0A\00"
@.str.1 = [35 x i8] c"The entire universe has %ld bugs.\0A\00"
@.str.2 = [37 x i8] c"You are expected to have %.1f bugs.\0A\00"
@.str.3 = [44 x i8] c"That is only a %e portion of the universe.\0A\00"
@.str.4 = [35 x i8] c"Which means you should care %d%%.\0A\00"
@.str.5 = [31 x i8] c"Is nul_byte equal to zero? %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca i64
%5 = alloca double
%6 = alloca double
%7 = alloca i8
%8 = alloca i32
%9 = alloca i8
%10 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store double 1.200000e+00, double* %3
%11 = load i32, i32* %2
%12 = load double, double* %3
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %11, double %12)
store i64 3889447536006070272, i64* %4
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %2
%18 = sitofp i32 %17 to double
%19 = load double, double* %3
%20 = fmul double %18, %19
store double %20, double* %5
%21 = load double, double* %5
%22 = fptosi double %21 to i32
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load double, double* %5
%25 = load i64, i64* %4
%26 = uitofp i64 %25 to double
%27 = fdiv double %24, %26
store double %27, double* %6
%28 = load double, double* %6
%29 = fptosi double %28 to i32
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %29)
store i8 0, i8* %7
%31 = load i32, i32* %2
%32 = load i8, i8* %7
%33 = sext i8 %32 to i32
%34 = mul nsw i32 %31, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %35)
store i8 0, i8* %9
%37 = load i8, i8* %7
%38 = sext i8 %37 to i32
%39 = load i8, i8* %9
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %38, %40
%42 = zext i1 %41 to i32
store i32 %42, i32* %10
%43 = load i32, i32* %10
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"You have %d bugs at the imaginary rate of %f.\0A\00"
@.str.1 = [35 x i8] c"The entire universe has %ld bugs.\0A\00"
@.str.2 = [37 x i8] c"You are expected to have %.1f bugs.\0A\00"
@.str.3 = [44 x i8] c"That is only a %e portion of the universe.\0A\00"
@.str.4 = [35 x i8] c"Which means you should care %d%%.\0A\00"
@.str.5 = [31 x i8] c"Is nul_byte equal to zero? %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 100, double 1.200000e+00)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 1143537664)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 120)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 0)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 0)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 1)
ret i32 0
}