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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%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    11f0 <main+0xd0>
cmpl   $0x19,-0x10(%rbp)
jge    11f0 <main+0xd0>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1222 <main+0x102>
cmpl   $0x19,-0x10(%rbp)
jl     1222 <main+0x102>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe03(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1254 <main+0x134>
cmpl   $0x19,-0x10(%rbp)
jg     1254 <main+0x134>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe27(%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    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0xc(%rsp)
sete   %al
lea    0xe68(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
mov    0x8(%rsp),%eax
mov    0x4(%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    $0x1a,%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    $0x1a,%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 = [43 x i8] c"are you married? (1=married 0=unmarried)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"are you male or female? (1=female 0=male)\0A\00"
@.str.3 = [18 x i8] c"how old are you?\0A\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 ([43 x i8], [43 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 %30
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp slt 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, 2.000000e+00
%29 = fptrunc double %28 to float
store float %29, float* %5
br label %30
30: ; preds = %25, %22, %19
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = load i32, i32* %4
%35 = icmp sge i32 %34, 25
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = fmul double %38, 1.500000e+00
%40 = fptrunc double %39 to float
store float %40, float* %5
br label %41
41: ; preds = %36, %33, %30
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %52
44: ; preds = %41
%45 = load i32, i32* %4
%46 = icmp sle i32 %45, 25
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load float, float* %5
%49 = fpext float %48 to double
%50 = fmul double %49, 1.500000e+00
%51 = fptrunc double %50 to float
store float %51, float* %5
br label %52
52: ; preds = %47, %44, %41
%53 = load float, float* %5
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 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 = [42 x i8] c"the daily rate for the customer is: %0.2f\00"
@str = [42 x i8] c"are you married? (1=married 0=unmarried)\00"
@str.5 = [42 x i8] c"are you male or female? (1=female 0=male)\00"
@str.6 = [17 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 = tail call i32 @puts(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 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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* %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
}