#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 married;
  printf("Are you married? (married=1 unmarried=0) ");
  scanf("%d", &married);
  int gender;
  printf("Are you male or female? (female=1 male=0) ");
  scanf("%d", &gender);
  int age;
  printf("How old are you? ");
  scanf("%d", &age);
  float nominaldr = 100;
  if (married == 1) {
    nominaldr -= 10.0;
  }
  if ((gender == 0) && (age < 25)) {
    nominaldr *= 2;
  }
  if ((gender == 0) && (age >= 25)) {
    nominaldr *= 1.5;
  }
  if ((gender == 1) && (age <= 25)) {
    nominaldr *= 1.5;
  }
  printf("the daily rate for the customer is: %0.2f", nominaldr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xe6f(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x1,-0x8(%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    11e4 <main+0xc4>
cmpl   $0x19,-0x10(%rbp)
jge    11e4 <main+0xc4>
movss  0xe2a(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1216 <main+0xf6>
cmpl   $0x19,-0x10(%rbp)
jl     1216 <main+0xf6>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe07(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1248 <main+0x128>
cmpl   $0x19,-0x10(%rbp)
jg     1248 <main+0x128>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2a(%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    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeeb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xefb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0xc(%rsp)
sete   %al
lea    0xe72(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%ecx
movaps %xmm0,%xmm1
cmp    $0x19,%ecx
jge    11a7 <main+0x87>
addss  %xmm0,%xmm1
test   %eax,%eax
je     11ae <main+0x8e>
movaps %xmm0,%xmm1
movss  0xe52(%rip),%xmm0
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    11d1 <main+0xb1>
test   %eax,%eax
jne    11d9 <main+0xb9>
cmp    $0x1a,%ecx
jl     11e1 <main+0xc1>
movaps %xmm2,%xmm0
cmp    $0x1,%eax
jne    11ea <main+0xca>
jmp    11ed <main+0xcd>
mulss  %xmm0,%xmm2
test   %eax,%eax
je     11c2 <main+0xa2>
movaps %xmm1,%xmm2
cmp    $0x1a,%ecx
jge    11c7 <main+0xa7>
mulss  %xmm2,%xmm0
cmp    $0x1,%eax
je     11ed <main+0xcd>
movaps %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Are you married? (married=1 unmarried=0) \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Are you male or female? (female=1 male=0) \00"
@.str.3 = [18 x i8] c"How old are you? \00"
@.str.4 = [42 x i8] c"the daily rate for the customer is: %0.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 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* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 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* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 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* %4)
store float 1.000000e+02, float* %5
%12 = load i32, i32* %2
%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 %28
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 25
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load float, float* %5
%27 = fmul float %26, 2.000000e+00
store float %27, float* %5
br label %28
28: ; preds = %25, %22, %19
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %28
%32 = load i32, i32* %4
%33 = icmp sge i32 %32, 25
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = fmul double %36, 1.500000e+00
%38 = fptrunc double %37 to float
store float %38, float* %5
br label %39
39: ; preds = %34, %31, %28
%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* %4
%44 = icmp sle 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
%51 = load float, float* %5
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), double %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Are you married? (married=1 unmarried=0) \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Are you male or female? (female=1 male=0) \00"
@.str.3 = [18 x i8] c"How old are you? \00"
@.str.4 = [42 x i8] c"the daily rate for the customer is: %0.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = bitcast i32* %2 to i8*
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 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 = bitcast i32* %3 to i8*
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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), i32* %3)
%13 = load i32, i32* %1
%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* %3
%19 = icmp slt i32 %18, 25
%20 = select i1 %17, i1 %19, i1 false
%21 = fmul float %15, 2.000000e+00
%22 = select i1 %20, float %21, float %15
%23 = icmp sgt i32 %18, 24
%24 = select i1 %17, i1 %23, i1 false
%25 = fmul float %22, 1.500000e+00
%26 = select i1 %24, float %25, float %22
%27 = icmp eq i32 %16, 1
%28 = icmp slt i32 %18, 26
%29 = select i1 %27, i1 %28, i1 false
%30 = fmul float %26, 1.500000e+00
%31 = select i1 %29, float %30, float %26
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), double %32)
ret i32 0
}