#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 ndr = 100.00;
  int x = -999;
  int y = -999;
  printf("Hello Avis customer:\n");
  printf("Do you happen to be married?\n");
  printf("Press 1 yes or 0 for no:\n");
  scanf("%d", &x);
  if (x == 1) {
    ndr = 90.00;
  } else {
    ndr = 100.00;
  }
  printf("\nAre you male or female?\nPress 1 for female or 0 for male:\n");
  scanf("%d", &y);
  if (y == 1) {
    int z = -999;
    printf("How old are you?\n");
    scanf("%d", &z);
    if (z < 25) {
      ndr = ndr * 1.5;
    } else {
      ndr = ndr;
    }
  } else {
    int z = -999;
    printf("How old are you?");
    scanf("%d", &z);
    if (z < 25) {
      ndr = ndr * 2;
    } else {
      ndr = ndr * 1.5;
    }
  }
  printf("Your  nominal daily rate is $%.2f.\n", ndr);
  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)
movl   $0xfffffc19,-0xc(%rbp)
movl   $0xfffffc19,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    11a0 <main+0x80>
movss  0xe6e(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11ad <main+0x8d>
movss  0xe58(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1236 <main+0x116>
movl   $0xfffffc19,-0x14(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe75(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x19,-0x14(%rbp)
jge    1227 <main+0x107>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1231 <main+0x111>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129f <main+0x17f>
movl   $0xfffffc19,-0x18(%rbp)
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe14(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x19,-0x18(%rbp)
jge    127c <main+0x15c>
movss  0xd9b(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129a <main+0x17a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd83(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129f <main+0x17f>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe19(%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
movl   $0xfffffc19,0xc(%rsp)
ff
movl   $0xfffffc19,0x8(%rsp)
ff
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0xc(%rsp)
sete   %al
lea    0xe72(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x1,0x8(%rsp)
jne    11f1 <main+0xc1>
movl   $0xfffffc19,(%rsp)
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xe41(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0x19,(%rsp)
movss  0x4(%rsp),%xmm0
jge    1230 <main+0x100>
mulss  0xe21(%rip),%xmm0
jmp    1230 <main+0x100>
movl   $0xfffffc19,(%rsp)
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe07(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x19,(%rsp)
setl   %al
lea    0xde3(%rip),%rcx
movss  0x4(%rsp),%xmm0
mulss  (%rcx,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xddc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Hello Avis customer:\0A\00"
@.str.1 = [30 x i8] c"Do you happen to be married?\0A\00"
@.str.2 = [26 x i8] c"Press 1 yes or 0 for no:\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [60 x i8] c"\0AAre you male or female?\0APress 1 for female or 0 for male:\0A\00"
@.str.5 = [18 x i8] c"How old are you?\0A\00"
@.str.6 = [17 x i8] c"How old are you?\00"
@.str.7 = [36 x i8] c"Your nominal daily rate is $%.2f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store float 1.000000e+02, float* %2
store i32 -999, i32* %3
store i32 -999, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store float 9.000000e+01, float* %2
br label %15
14: ; preds = %0
store float 1.000000e+02, float* %2
br label %15
15: ; preds = %14, %13
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %33
20: ; preds = %15
store i32 -999, i32* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, 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 %32
30: ; preds = %20
%31 = load float, float* %2
store float %31, float* %2
br label %32
32: ; preds = %30, %25
br label %47
33: ; preds = %15
store i32 -999, i32* %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%36 = load i32, i32* %6
%37 = icmp slt i32 %36, 25
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load float, float* %2
%40 = fmul float %39, 2.000000e+00
store float %40, float* %2
br label %46
41: ; preds = %33
%42 = load float, float* %2
%43 = fpext float %42 to double
%44 = fmul double %43, 1.500000e+00
%45 = fptrunc double %44 to float
store float %45, float* %2
br label %46
46: ; preds = %41, %38
br label %47
47: ; preds = %46, %32
%48 = load float, float* %2
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), double %49)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@.str.7 = [36 x i8] c"Your nominal daily rate is $%.2f.\0A\00"
@str = [21 x i8] c"Hello Avis customer:\00"
@str.8 = [29 x i8] c"Do you happen to be married?\00"
@str.9 = [25 x i8] c"Press 1 yes or 0 for no:\00"
@str.10 = [59 x i8] c"\0AAre you male or female?\0APress 1 for female or 0 for male:\00"
@str.11 = [17 x i8] c"How old are you?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 -999, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 -999, i32* %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.8, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 1
%13 = select i1 %12, float 9.000000e+01, float 1.000000e+02
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.10, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %26
18: ; preds = %0
%19 = bitcast i32* %3 to i8*
store i32 -999, i32* %3
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 25
%24 = fmul float %13, 1.500000e+00
%25 = select i1 %23, float %24, float %13
br label %34
26: ; preds = %0
%27 = bitcast i32* %4 to i8*
store i32 -999, i32* %4
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 25
%32 = select i1 %31, float 2.000000e+00, float 1.500000e+00
%33 = fmul float %13, %32
br label %34
34: ; preds = %26, %18
%35 = phi float [ %25, %18 ], [ %33, %26 ]
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), double %36)
ret i32 0
}