#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 sex, age, married;
  printf(" Is the user married (1=married, 0=unmarried) \n");
  scanf("%d", &married);
  printf(" Is the user male or female (1=female, 0=male) \n");
  scanf("%d", &sex);
  printf(" What is the user's age? \n");
  scanf("%d", &age);
  if (married == 1) {
    rate = rate - 10.00;
  }
  if ((sex == 0) && (age < 25)) {
    rate = rate * 2;
  }
  if ((sex == 0) && (age >= 25)) {
    rate = rate * 1.5;
  }
  if ((sex == 1) && (age < 25)) {
    rate = rate * 1.5;
  }
  printf(" The daily rate 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    0xef7(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    11be <main+0x9e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe57(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11e4 <main+0xc4>
cmpl   $0x19,-0x10(%rbp)
jge    11e4 <main+0xc4>
movss  0xe2a(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1216 <main+0xf6>
cmpl   $0x19,-0x10(%rbp)
jl     1216 <main+0xf6>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe07(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1248 <main+0x128>
cmpl   $0x19,-0x10(%rbp)
jge    1248 <main+0x128>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3f(%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    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf15(%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    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
movaps %xmm0,%xmm1
cmp    $0x19,%ecx
jge    11b1 <main+0x81>
addss  %xmm0,%xmm1
test   %eax,%eax
je     11b8 <main+0x88>
movaps %xmm0,%xmm1
movss  0xe48(%rip),%xmm0
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    11db <main+0xab>
test   %eax,%eax
jne    11e3 <main+0xb3>
cmp    $0x19,%ecx
jl     11eb <main+0xbb>
movaps %xmm2,%xmm0
cmp    $0x1,%eax
jne    11f4 <main+0xc4>
jmp    11f7 <main+0xc7>
mulss  %xmm0,%xmm2
test   %eax,%eax
je     11cc <main+0x9c>
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    11d1 <main+0xa1>
mulss  %xmm2,%xmm0
cmp    $0x1,%eax
je     11f7 <main+0xc7>
movaps %xmm2,%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 = [48 x i8] c" Is the user married (1=married, 0=unmarried) \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [49 x i8] c" Is the user male or female (1=female, 0=male) \0A\00"
@.str.3 = [27 x i8] c" What is the user's age? \0A\00"
@.str.4 = [28 x i8] c" The daily rate 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 ([48 x i8], [48 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* %5)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 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 ([27 x i8], [27 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)
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %19
14: ; preds = %0
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fsub double %16, 1.000000e+01
%18 = fptrunc double %17 to float
store float %18, float* %2
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* %2
%27 = fmul float %26, 2.000000e+00
store float %27, float* %2
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* %2
%36 = fpext float %35 to double
%37 = fmul double %36, 1.500000e+00
%38 = fptrunc double %37 to float
store float %38, float* %2
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 slt i32 %43, 25
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load float, float* %2
%47 = fpext float %46 to double
%48 = fmul double %47, 1.500000e+00
%49 = fptrunc double %48 to float
store float %49, float* %2
br label %50
50: ; preds = %45, %42, %39
%51 = load float, float* %2
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), double %52)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [28 x i8] c" The daily rate is: $%.2f \0A\00"
@str = [47 x i8] c" Is the user married (1=married, 0=unmarried) \00"
@str.5 = [48 x i8] c" Is the user male or female (1=female, 0=male) \00"
@str.6 = [26 x i8] c" What is the user's age? \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 ([47 x i8], [47 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 ([48 x i8], [48 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 ([26 x i8], [26 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* %1
%17 = icmp eq i32 %16, 0
%18 = load i32, i32* %2
%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 = select i1 %27, i1 %19, i1 false
%29 = fmul float %26, 1.500000e+00
%30 = select i1 %28, float %29, float %26
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), double %31)
ret i32 0
}