#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 /*<<< orphan*/ scanf(char *, float *);
int main() {
  float married, gender, age, ratesum, rate = 100;
  printf("Is the customer married (1=married,0=unmarried)?");
  scanf("%f", &married);
  printf("Is the customer male or female (1=female, 0=male)?");
  scanf("%f", &gender);
  printf("What is the customer's age?");
  scanf("%f", &age);
  if (married == 1) {
    ratesum = rate - 10;
  } else if (married == 0) {
    ratesum = rate;
  }
  if (gender == 0) {
    if (age < 25) {
      ratesum = ratesum * 2;
    } else if (age > 25) {
      ratesum = ratesum * 1.5;
    }
  }
  if (gender == 1) {
    if (age < 25) {
      ratesum = ratesum * 1.5;
    }
  }
  printf("The daily rate for the customer is :%.2f", ratesum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe5d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    11cd <main+0xad>
jp     11cd <main+0xad>
movss  -0x18(%rbp),%xmm0
movss  0xe49(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11f3 <main+0xd3>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11ee <main+0xce>
jp     11ee <main+0xce>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11f3 <main+0xd3>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1271 <main+0x151>
jp     1271 <main+0x151>
movss  0xdfa(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1233 <main+0x113>
movss  0xdec(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    126c <main+0x14c>
movss  -0x10(%rbp),%xmm0
movss  0xdcc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1267 <main+0x147>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbe(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    126c <main+0x14c>
jmp    1271 <main+0x151>
movss  -0xc(%rbp),%xmm0
movss  0xd82(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    12c2 <main+0x1a2>
jp     12c2 <main+0x1a2>
movss  0xd77(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    12bd <main+0x19d>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd68(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    12c2 <main+0x1a2>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0b(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xefa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf12(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe7b(%rip),%xmm0
cmpeqss 0xc(%rsp),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
lea    0xe72(%rip),%rcx
movss  (%rcx,%rax,4),%xmm1
movss  0x8(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
movss  0x4(%rsp),%xmm2
jne    11d9 <main+0xb9>
jp     11d9 <main+0xb9>
movss  0xe47(%rip),%xmm3
ucomiss %xmm2,%xmm3
jbe    11c8 <main+0xa8>
addss  %xmm1,%xmm1
jmp    11d9 <main+0xb9>
ucomiss 0xe35(%rip),%xmm2
jbe    11d9 <main+0xb9>
mulss  0xe2f(%rip),%xmm1
movss  0xe27(%rip),%xmm3
mulss  %xmm1,%xmm3
cmpltss 0xe16(%rip),%xmm2
andps  %xmm2,%xmm3
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
cmpeqss 0xe00(%rip),%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Is the customer married (1=married,0=unmarried)?\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [51 x i8] c"Is the customer male or female (1=female, 0=male)?\00"
@.str.3 = [28 x i8] c"What is the customer's age?\00"
@.str.4 = [41 x i8] c"The daily rate for the customer is :%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store float 1.000000e+02, float* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%13 = load float, float* %2
%14 = fcmp oeq float %13, 1.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load float, float* %6
%17 = fsub float %16, 1.000000e+01
store float %17, float* %5
br label %24
18: ; preds = %0
%19 = load float, float* %2
%20 = fcmp oeq float %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load float, float* %6
store float %22, float* %5
br label %23
23: ; preds = %21, %18
br label %24
24: ; preds = %23, %15
%25 = load float, float* %3
%26 = fcmp oeq float %25, 0.000000e+00
br i1 %26, label %27, label %43
27: ; preds = %24
%28 = load float, float* %4
%29 = fcmp olt float %28, 2.500000e+01
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load float, float* %5
%32 = fmul float %31, 2.000000e+00
store float %32, float* %5
br label %42
33: ; preds = %27
%34 = load float, float* %4
%35 = fcmp ogt float %34, 2.500000e+01
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = fmul double %38, 1.500000e+00
%40 = fptrunc double %39 to float
store float %40, float* %5
br label %41
41: ; preds = %36, %33
br label %42
42: ; preds = %41, %30
br label %43
43: ; preds = %42, %24
%44 = load float, float* %3
%45 = fcmp oeq float %44, 1.000000e+00
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load float, float* %4
%48 = fcmp olt float %47, 2.500000e+01
br i1 %48, label %49, label %54
49: ; preds = %46
%50 = load float, float* %5
%51 = fpext float %50 to double
%52 = fmul double %51, 1.500000e+00
%53 = fptrunc double %52 to float
store float %53, float* %5
br label %54
54: ; preds = %49, %46
br label %55
55: ; preds = %54, %43
%56 = load float, float* %5
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"Is the customer married (1=married,0=unmarried)?\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [51 x i8] c"Is the customer male or female (1=female, 0=male)?\00"
@.str.3 = [28 x i8] c"What is the customer's age?\00"
@.str.4 = [41 x i8] c"The daily rate for the customer is :%.2f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = load float, float* %1
%14 = fcmp oeq float %13, 1.000000e+00
%15 = select i1 %14, float 9.000000e+01, float 1.000000e+02
%16 = load float, float* %2
%17 = fcmp oeq float %16, 0.000000e+00
%18 = load float, float* %3
br i1 %17, label %19, label %27
19: ; preds = %0
%20 = fcmp olt float %18, 2.500000e+01
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = fmul float %15, 2.000000e+00
br label %27
23: ; preds = %19
%24 = fcmp ogt float %18, 2.500000e+01
br i1 %24, label %25, label %27
25: ; preds = %23
%26 = fmul float %15, 1.500000e+00
br label %27
27: ; preds = %0, %21, %25, %23
%28 = phi float [ %22, %21 ], [ %26, %25 ], [ %15, %23 ], [ %15, %0 ]
%29 = fcmp oeq float %16, 1.000000e+00
%30 = fcmp olt float %18, 2.500000e+01
%31 = select i1 %29, i1 %30, i1 false
%32 = fmul float %28, 1.500000e+00
%33 = select i1 %31, float %32, float %28
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %34)
ret i32 0
}