#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;
  int gendar;
  int age;
  int married;
  printf(" Is the customer married (1=married, 0=unmarried) \n");
  scanf("%d", &married);
  printf(" Is the customer male or female (1=female, 0=male) \n");
  scanf("%d", &gendar);
  printf(" What is your age? \n");
  scanf("%d", &age);
  if (married == 1) {
    rate = rate - 10.00;
  }
  if ((gendar == 0) && (age >= 25)) {
    rate = rate * 1.5;
  }
  if ((gendar == 1) && (age < 25)) {
    rate = rate * 1.5;
  }
  if ((gendar == 0) && (age < 25)) {
    rate = rate * 2;
  }
  printf(" The daily rate for the customer 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    0xefb(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%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    11f0 <main+0xd0>
cmpl   $0x19,-0x10(%rbp)
jl     11f0 <main+0xd0>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1222 <main+0x102>
cmpl   $0x19,-0x10(%rbp)
jge    1222 <main+0x102>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1248 <main+0x128>
cmpl   $0x19,-0x10(%rbp)
jge    1248 <main+0x128>
movss  0xdc6(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe41(%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    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf2e(%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),%xmm2
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
movss  0xe5b(%rip),%xmm0
movaps %xmm2,%xmm1
cmp    $0x19,%ecx
jge    11c8 <main+0x98>
test   %eax,%eax
jne    11d0 <main+0xa0>
cmp    $0x19,%ecx
jl     11d8 <main+0xa8>
movaps %xmm1,%xmm0
cmp    $0x1,%eax
jne    11e1 <main+0xb1>
jmp    11e4 <main+0xb4>
mulss  %xmm0,%xmm1
test   %eax,%eax
je     11b9 <main+0x89>
movaps %xmm2,%xmm1
cmp    $0x19,%ecx
jge    11be <main+0x8e>
mulss  %xmm1,%xmm0
cmp    $0x1,%eax
je     11e4 <main+0xb4>
movaps %xmm1,%xmm0
movaps %xmm0,%xmm1
cmp    $0x19,%ecx
jge    11f0 <main+0xc0>
addss  %xmm0,%xmm1
test   %eax,%eax
je     11f7 <main+0xc7>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe0a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c" Is the customer married (1=married, 0=unmarried) \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [53 x i8] c" Is the customer male or female (1=female, 0=male) \0A\00"
@.str.3 = [21 x i8] c" What is your age? \0A\00"
@.str.4 = [45 x i8] c" The daily rate for the customer 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 ([52 x i8], [52 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 ([53 x i8], [53 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 ([21 x i8], [21 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 %30
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp sge i32 %23, 25
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load float, float* %2
%27 = fpext float %26 to double
%28 = fmul double %27, 1.500000e+00
%29 = fptrunc double %28 to float
store float %29, float* %2
br label %30
30: ; preds = %25, %22, %19
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = load i32, i32* %4
%35 = icmp slt i32 %34, 25
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load float, float* %2
%38 = fpext float %37 to double
%39 = fmul double %38, 1.500000e+00
%40 = fptrunc double %39 to float
store float %40, float* %2
br label %41
41: ; preds = %36, %33, %30
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %50
44: ; preds = %41
%45 = load i32, i32* %4
%46 = icmp slt i32 %45, 25
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load float, float* %2
%49 = fmul float %48, 2.000000e+00
store float %49, float* %2
br label %50
50: ; preds = %47, %44, %41
%51 = load float, float* %2
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 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 = [45 x i8] c" The daily rate for the customer is: $%.2f \0A\00"
@str = [51 x i8] c" Is the customer married (1=married, 0=unmarried) \00"
@str.5 = [52 x i8] c" Is the customer male or female (1=female, 0=male) \00"
@str.6 = [20 x i8] c" What is your 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 ([51 x i8], [51 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 ([52 x i8], [52 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 ([20 x i8], [20 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 sgt i32 %18, 24
%20 = select i1 %17, i1 %19, i1 false
%21 = fmul float %15, 1.500000e+00
%22 = select i1 %20, float %21, float %15
%23 = icmp eq i32 %16, 1
%24 = icmp slt i32 %18, 25
%25 = select i1 %23, i1 %24, i1 false
%26 = fmul float %22, 1.500000e+00
%27 = select i1 %25, float %26, float %22
%28 = select i1 %17, i1 %24, i1 false
%29 = fmul float %27, 2.000000e+00
%30 = select i1 %28, float %29, float %27
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), double %31)
ret i32 0
}