#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 *, int *);
int main() {
  float rate = 100.00;
  int status, gender, age;
  printf("are you married(1=married,0=unmarried)?\n");
  scanf("%d", &status);
  if (status == 1) {
    rate -= 10;
  } else {
    rate = rate;
  }
  printf("what is your gender(1=female,0=male)\n");
  scanf("%d", &gender);
  if (gender == 1) {
    printf("How old are you?\n");
    scanf("%d", &age);
    if (age < 25) {
      rate = rate * 1.5;
    }
  } else {
    printf("How old are you?\n");
    scanf("%d", &age);
    if (age >= 25) {
      rate = rate * 1.5;
    } else {
      rate = rate * 2;
    }
  }
  printf("the nominal daily rate for this customer is $%.2f.\n", rate);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    117f <main+0x5f>
movss  -0x8(%rbp),%xmm0
movss  0xe93(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1189 <main+0x69>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    11fc <main+0xdc>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x19,-0x14(%rbp)
jge    11f7 <main+0xd7>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe26(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    125e <main+0x13e>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe30(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x19,-0x14(%rbp)
jl     1247 <main+0x127>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xddb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1259 <main+0x139>
movss  0xdb9(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    125e <main+0x13e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe0e(%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    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0xc(%rsp)
sete   %al
lea    0xe9a(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  %xmm0,(%rsp)
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x1,0x8(%rsp)
jne    11bb <main+0x8b>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe69(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x19,0x4(%rsp)
jl     11df <main+0xaf>
movss  (%rsp),%xmm0
jmp    11f7 <main+0xc7>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3e(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x19,0x4(%rsp)
jl     11ee <main+0xbe>
movss  (%rsp),%xmm0
mulss  0xe1c(%rip),%xmm0
jmp    11f7 <main+0xc7>
movss  (%rsp),%xmm0
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe0d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"are you married(1=married,0=unmarried)?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"what is your gender(1=female,0=male)\0A\00"
@.str.3 = [18 x i8] c"How old are you?\0A\00"
@.str.4 = [52 x i8] c"the nominal daily rate for this customer is $%.2f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store float 1.000000e+02, float* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load float, float* %2
%12 = fsub float %11, 1.000000e+01
store float %12, float* %2
br label %15
13: ; preds = %0
%14 = load float, float* %2
store float %14, float* %2
br label %15
15: ; preds = %13, %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %31
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 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), i32* %5)
%23 = load i32, i32* %5
%24 = icmp slt i32 %23, 25
br i1 %24, label %25, label %30
25: ; preds = %20
%26 = load float, float* %2
%27 = fpext float %26 to double
%28 = fmul double %27, 1.500000e+00
%29 = fptrunc double %28 to float
store float %29, float* %2
br label %30
30: ; preds = %25, %20
br label %45
31: ; preds = %15
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%34 = load i32, i32* %5
%35 = icmp sge i32 %34, 25
br i1 %35, label %36, label %41
36: ; preds = %31
%37 = load float, float* %2
%38 = fpext float %37 to double
%39 = fmul double %38, 1.500000e+00
%40 = fptrunc double %39 to float
store float %40, float* %2
br label %44
41: ; preds = %31
%42 = load float, float* %2
%43 = fmul float %42, 2.000000e+00
store float %43, float* %2
br label %44
44: ; preds = %41, %36
br label %45
45: ; preds = %44, %30
%46 = load float, float* %2
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), double %47)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [52 x i8] c"the nominal daily rate for this customer is $%.2f.\0A\00"
@str = [40 x i8] c"are you married(1=married,0=unmarried)?\00"
@str.5 = [37 x i8] c"what is your gender(1=female,0=male)\00"
@str.7 = [17 x i8] c"How old are you?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 1
%11 = select i1 %10, float 9.000000e+01, float 1.000000e+02
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %23
16: ; preds = %0
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 25
%21 = fmul float %11, 1.500000e+00
%22 = select i1 %20, float %21, float %11
br label %32
23: ; preds = %0
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%26 = load i32, i32* %3
%27 = icmp sgt i32 %26, 24
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = fmul float %11, 1.500000e+00
br label %32
30: ; preds = %23
%31 = fmul float %11, 2.000000e+00
br label %32
32: ; preds = %16, %28, %30
%33 = phi float [ %29, %28 ], [ %31, %30 ], [ %22, %16 ]
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), double %34)
ret i32 0
}