#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 scanf(char *, float *);
int main() {
  float cm, feet, inches;
  while (scanf("%f", &cm) == 1) {
    printf("Enter a height in centimeters: ");
    feet = (int)cm / 36.4;
    inches = cm / 2.54;
    printf("%.1f cm = %d feet, %.1f inches\n", cm, (int)feet, inches);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11bc <main+0x9c>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttss2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvttss2si -0xc(%rbp),%esi
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe83(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11bc <main+0x9c>
lea    0xece(%rip),%r14
lea    0xee7(%rip),%r15
lea    0xebd(%rip),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
divsd  0xe80(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm2
divsd  0xe75(%rip),%xmm2
cvtsd2ss %xmm2,%xmm2
cvttss2si %xmm1,%esi
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mov    %r15,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [32 x i8] c"Enter a height in centimeters: \00"
@.str.2 = [32 x i8] c"%.1f cm = %d feet, %.1f inches\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
br label %5
5: ; preds = %8, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%10 = load float, float* %2
%11 = fptosi float %10 to i32
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 3.640000e+01
%14 = fptrunc double %13 to float
store float %14, float* %3
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fdiv double %16, 2.540000e+00
%18 = fptrunc double %17 to float
store float %18, float* %4
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = load float, float* %3
%22 = fptosi float %21 to i32
%23 = load float, float* %4
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %20, i32 %22, double %24)
br label %5
26: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [32 x i8] c"Enter a height in centimeters: \00"
@.str.2 = [32 x i8] c"%.1f cm = %d feet, %.1f inches\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %20
5: ; preds = %0, %5
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = load float, float* %1
%8 = fptosi float %7 to i32
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 3.640000e+01
%11 = fptrunc double %10 to float
%12 = fpext float %7 to double
%13 = fdiv double %12, 2.540000e+00
%14 = fptrunc double %13 to float
%15 = fptosi float %11 to i32
%16 = fpext float %14 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %12, i32 %15, double %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%19 = icmp eq i32 %18, 1
br i1 %19, label %5, label %20
20: ; preds = %5, %0
ret i32 0
}