#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 total;
  int married;
  int gender;
  int age;
  printf("Are you married? \n");
  printf("If yes, type 1. If no, type 0. \n");
  scanf("%d", &married);
  if (married == 1) {
    total = 90;
  } else {
    total = 100;
  }
  printf("Are you a male or female? \n");
  printf("If you are a male, type 0. \n");
  printf("If you are a female, type 1. \n");
  scanf("%d", &gender);
  printf("How old are you? \n");
  scanf("%d", &age);
  if ((gender == 0) && (age < 25)) {
    total = (total * 2);
  }
  if ((gender == 0) && (age >= 25)) {
    total = (total * 1.5);
  }
  if ((gender == 1) && (age < 25)) {
    total = (total * 1.5);
  }
  printf("Your personalized rental rate is : $ %f \n", total);
}


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    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1177 <main+0x57>
movss  0xe97(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1184 <main+0x64>
movss  0xe81(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe79(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1202 <main+0xe2>
cmpl   $0x19,-0x14(%rbp)
jge    1202 <main+0xe2>
movss  0xe10(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1234 <main+0x114>
cmpl   $0x19,-0x14(%rbp)
jl     1234 <main+0x114>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1266 <main+0x146>
cmpl   $0x19,-0x14(%rbp)
jge    1266 <main+0x146>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe44(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0xc(%rsp)
sete   %al
lea    0xe8e(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  %xmm0,(%rsp)
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%ecx
cmp    $0x19,%ecx
jl     11e1 <main+0xb1>
movss  (%rsp),%xmm0
movaps %xmm0,%xmm1
test   %eax,%eax
jne    11f1 <main+0xc1>
jmp    11f4 <main+0xc4>
movss  (%rsp),%xmm0
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
test   %eax,%eax
je     11f4 <main+0xc4>
movaps %xmm0,%xmm1
movss  0xe0c(%rip),%xmm0
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    1217 <main+0xe7>
test   %eax,%eax
jne    121f <main+0xef>
cmp    $0x19,%ecx
jl     1227 <main+0xf7>
movaps %xmm2,%xmm0
cmp    $0x1,%eax
jne    1230 <main+0x100>
jmp    1233 <main+0x103>
mulss  %xmm0,%xmm2
test   %eax,%eax
je     1208 <main+0xd8>
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    120d <main+0xdd>
mulss  %xmm2,%xmm0
cmp    $0x1,%eax
je     1233 <main+0x103>
movaps %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Are you married? \0A\00"
@.str.1 = [33 x i8] c"If yes, type 1. If no, type 0. \0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"Are you a male or female? \0A\00"
@.str.4 = [29 x i8] c"If you are a male, type 0. \0A\00"
@.str.5 = [31 x i8] c"If you are a female, type 1. \0A\00"
@.str.6 = [19 x i8] c"How old are you? \0A\00"
@.str.7 = [42 x i8] c"Your personalized rental rate is : $ %f \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
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %0
store float 9.000000e+01, float* %2
br label %13
12: ; preds = %0
store float 1.000000e+02, float* %2
br label %13
13: ; preds = %12, %11
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %13
%23 = load i32, i32* %5
%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, %13
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %28
%32 = load i32, i32* %5
%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* %4
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = load i32, i32* %5
%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 ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), double %52)
%54 = load i32, i32* %1
ret i32 %54
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.7 = [42 x i8] c"Your personalized rental rate is : $ %f \0A\00"
@str = [18 x i8] c"Are you married? \00"
@str.8 = [32 x i8] c"If yes, type 1. If no, type 0. \00"
@str.9 = [27 x i8] c"Are you a male or female? \00"
@str.10 = [28 x i8] c"If you are a male, type 0. \00"
@str.11 = [30 x i8] c"If you are a female, type 1. \00"
@str.12 = [18 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 ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 1
%12 = select i1 %11, float 9.000000e+01, float 1.000000e+02
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.9, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.10, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 0
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 25
%23 = select i1 %20, i1 %22, i1 false
%24 = fmul float %12, 2.000000e+00
%25 = select i1 %23, float %24, float %12
%26 = icmp sgt i32 %21, 24
%27 = select i1 %20, i1 %26, i1 false
%28 = fmul float %25, 1.500000e+00
%29 = select i1 %27, float %28, float %25
%30 = icmp eq i32 %19, 1
%31 = select i1 %30, i1 %22, i1 false
%32 = fmul float %29, 1.500000e+00
%33 = select i1 %31, float %32, float %29
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), double %34)
ret i32 0
}