#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 *, char, ...);
int main(int argc, char *argv[]) {
  int bugs = 100;
  double bug_rate = 1.2;
  printf("You have %d bugs at the imaginary rate of %f.\n", bugs, bug_rate);
  long universe_of_defects = 1L * 1024L * 1024L * 1024L;
  printf("The entire universe has %ld bugs.\n", universe_of_defects);
  double expected_bugs = bugs * bug_rate;
  printf("You are expected to have %f bugs.\n", expected_bugs);
  double part_of_universe = expected_bugs / universe_of_defects;
  printf("That is only %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);
  printf("Side note:  This is a null byte: %c.\n", nul_byte);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movabs $0x3ff3333333333333,%rax
33 f3 3f
mov    %rax,-0x20(%rbp)
movsbl -0x14(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movq   $0x40000000,-0x28(%rbp)
40
movsbl -0x28(%rbp),%esi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x41(%rbp)
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x30(%rbp),%ecx
movsbl %cl,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sdq -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%eax
lea    0xeb8(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x39(%rbp)
mov    -0x14(%rbp),%eax
movsbl -0x39(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
lea    0xebd(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
movsbl -0x39(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%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
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf54(%rip),%rdi
xor    %esi,%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 = [35 x i8] c"You are expected to have %f bugs.\0A\00"
@.str.3 = [42 x i8] c"That is only %e portion of the universe.\0A\00"
@.str.4 = [35 x i8] c"Which means you should care %d%%.\0A\00"
@.str.5 = [38 x i8] c"Side note: This is a null byte: %c.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca i64
%9 = alloca double
%10 = alloca double
%11 = alloca i8
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
store double 1.200000e+00, double* %7
%13 = load i32, i32* %6
%14 = trunc i32 %13 to i8
%15 = load double, double* %7
%16 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8 signext %14, double %15)
store i64 1073741824, i64* %8
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i8
%19 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8 signext %18)
%20 = load i32, i32* %6
%21 = sitofp i32 %20 to double
%22 = load double, double* %7
%23 = fmul double %21, %22
store double %23, double* %9
%24 = load double, double* %9
%25 = fptosi double %24 to i8
%26 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8 signext %25)
%27 = load double, double* %9
%28 = load i64, i64* %8
%29 = sitofp i64 %28 to double
%30 = fdiv double %27, %29
store double %30, double* %10
%31 = load double, double* %10
%32 = fptosi double %31 to i8
%33 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8 signext %32)
store i8 0, i8* %11
%34 = load i32, i32* %6
%35 = load i8, i8* %11
%36 = sext i8 %35 to i32
%37 = mul nsw i32 %34, %36
store i32 %37, i32* %12
%38 = load i32, i32* %12
%39 = trunc i32 %38 to i8
%40 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8 signext %39)
%41 = load i8, i8* %11
%42 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8 signext %41)
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 = [35 x i8] c"You are expected to have %f bugs.\0A\00"
@.str.3 = [42 x i8] c"That is only %e portion of the universe.\0A\00"
@.str.4 = [35 x i8] c"Which means you should care %d%%.\0A\00"
@.str.5 = [38 x i8] c"Side note: This is a null byte: %c.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8 signext 100, double 1.200000e+00)
%4 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8 signext 0)
%5 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8 signext 120)
%6 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8 signext 0)
%7 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8 signext 0)
%8 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8 signext 0)
ret i32 0
}