#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 EXIT_SUCCESS;
float inches2metres(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(int argc, char **argv) {
  float a, b, c, loopNum;
  int i;
  printf("How many times would you like to loop?:");
  scanf("%f", &loopNum);
  for (i = 0; i < loopNum; i++) {
    printf("Please enter feet:");
    scanf("%f", &a);
    printf("Please enter inches:");
    scanf("%f", &b);
    c = inches2metres(a, b);
    printf(" %f feet %f inches in metres is %f metres\n", a, b, c);
  }
  printf("Goodbye");
  return (EXIT_SUCCESS);
}


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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x24(%rbp)
cvtsi2ssl -0x24(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1205 <main+0xd5>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe77(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
call   1030 <inches2metres@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe63(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116b <main+0x3b>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1225 <main+0xf5>
mov    $0x1,%r14d
lea    0xeac(%rip),%rbx
lea    0x14(%rsp),%r15
lea    0xeb6(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xebf(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   1030 <inches2metres@plt>
movss  0x14(%rsp),%xmm1
xorps  %xmm3,%xmm3
cvtss2sd %xmm1,%xmm3
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
mov    %rbp,%rdi
movaps %xmm3,%xmm0
mov    $0x3,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
movss  0xc(%rsp),%xmm1
add    $0x1,%r14d
ucomiss %xmm0,%xmm1
ja     11a0 <main+0x70>
lea    0xe52(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"How many times would you like to loop?:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Please enter feet:\00"
@.str.3 = [21 x i8] c"Please enter inches:\00"
@.str.4 = [43 x i8] c" %f feet %f inches in metres is %f metres\0A\00"
@.str.5 = [8 x i8] c"Goodbye\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
store i32 0, i32* %10
br label %13
13: ; preds = %33, %2
%14 = load i32, i32* %10
%15 = sitofp i32 %14 to float
%16 = load float, float* %9
%17 = fcmp olt float %15, %16
br i1 %17, label %18, label %36
18: ; preds = %13
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%23 = load float, float* %6
%24 = load float, float* %7
%25 = call float @inches2metres(float %23, float %24)
store float %25, float* %8
%26 = load float, float* %6
%27 = fpext float %26 to double
%28 = load float, float* %7
%29 = fpext float %28 to double
%30 = load float, float* %8
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), double %27, double %29, double %31)
br label %33
33: ; preds = %18
%34 = load i32, i32* %10
%35 = add nsw i32 %34, 1
store i32 %35, i32* %10
br label %13
36: ; preds = %13
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

LLVM IR (-O2):
@.str = [40 x i8] c"How many times would you like to loop?:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Please enter feet:\00"
@.str.3 = [21 x i8] c"Please enter inches:\00"
@.str.4 = [43 x i8] c" %f feet %f inches in metres is %f metres\0A\00"
@.str.5 = [8 x i8] c"Goodbye\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = bitcast float* %5 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%11 = load float, float* %5
%12 = fcmp ogt float %11, 0.000000e+00
br i1 %12, label %13, label %32
13: ; preds = %2, %13
%14 = phi i32 [ %28, %13 ], [ 0, %2 ]
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%19 = load float, float* %3
%20 = load float, float* %4
%21 = call float @inches2metres(float %19, float %20)
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = load float, float* %4
%25 = fpext float %24 to double
%26 = fpext float %21 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), double %23, double %25, double %26)
%28 = add nuw nsw i32 %14, 1
%29 = sitofp i32 %28 to float
%30 = load float, float* %5
%31 = fcmp ogt float %30, %29
br i1 %31, label %13, label %32
32: ; preds = %13, %2
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}