#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 atoi(char *);
double ceil(double);
double log(double);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double term;
  term = log(10) * (atoi(argv[1]) - 1) + log(5) / 2;
  term /= log(1.61803398874989484820);
  printf(": %.0f\n", ceil(term));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeba(%rip),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe87(%rip),%xmm0
call   1050 <log@plt>
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe65(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe44(%rip),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <ceil@plt>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xeb7(%rip),%xmm0
addsd  0xeb7(%rip),%xmm0
divsd  0xeb7(%rip),%xmm0
call   1030 <ceil@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c": %.0f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call double @log(double 1.000000e+01)
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = sub nsw i32 %11, 1
%13 = sitofp i32 %12 to double
%14 = call double @log(double 5.000000e+00)
%15 = fdiv double %14, 2.000000e+00
%16 = call double @llvm.fmuladd.f64(double %7, double %13, double %15)
store double %16, double* %6
%17 = call double @log(double 0x3FF9E3779B97F4A8)
%18 = load double, double* %6
%19 = fdiv double %18, %17
store double %19, double* %6
%20 = load double, double* %6
%21 = call double @llvm.ceil.f64(double %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c": %.0f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x40026BB1BBB55516, double 0x3FE9C041F7ED8D33)
%9 = fdiv double %8, 0x3FDECC2CAEC5160A
%10 = tail call double @llvm.ceil.f64(double %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}