#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() {
  int age;
  int gender;
  int married;
  float daily_rate = 100.00;
  printf("Are you married ? (1=married, 0=unmarried)\n");
  scanf("%d", &married);
  printf("how old are you?\n");
  scanf("%d", &age);
  printf("What is your gender ? (1=female, 0=male)\n");
  scanf("%d", &gender);
  if (married == 1) {
    daily_rate = daily_rate - 10.0;
  }
  if (gender == 0 && age >= 25) {
    daily_rate = daily_rate * 1.5;
  } else if (gender == 0 && age < 25) {
    daily_rate = daily_rate * 2;
  } else if (gender == 1 && age < 25) {
    daily_rate = daily_rate * 1.5;
  }
  printf("The daily rate is %f, ", daily_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,-0x14(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    11be <main+0x9e>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe57(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11f5 <main+0xd5>
cmpl   $0x19,-0x8(%rbp)
jl     11f5 <main+0xd5>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    125c <main+0x13c>
cmpl   $0x0,-0xc(%rbp)
jne    1220 <main+0x100>
cmpl   $0x19,-0x8(%rbp)
jge    1220 <main+0x100>
movss  0xdf3(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1257 <main+0x137>
cmpl   $0x1,-0xc(%rbp)
jne    1252 <main+0x132>
cmpl   $0x19,-0x8(%rbp)
jge    1252 <main+0x132>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1257 <main+0x137>
jmp    125c <main+0x13c>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe17(%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    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0x4(%rsp)
sete   %al
lea    0xe68(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
test   %eax,%eax
jne    11b8 <main+0x88>
cmp    $0x19,%ecx
jl     11b8 <main+0x88>
mulss  0xe52(%rip),%xmm0
jmp    11e7 <main+0xb7>
test   %eax,%eax
jne    11c7 <main+0x97>
cmp    $0x18,%ecx
jg     11c7 <main+0x97>
addss  %xmm0,%xmm0
jmp    11e7 <main+0xb7>
cmp    $0x19,%ecx
jl     11d6 <main+0xa6>
movaps %xmm0,%xmm1
cmp    $0x1,%eax
jne    11e7 <main+0xb7>
jmp    11ea <main+0xba>
movss  0xe2a(%rip),%xmm1
mulss  %xmm0,%xmm1
cmp    $0x1,%eax
je     11ea <main+0xba>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe17(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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