#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 age;
  int married;
  int gender;
  float rate = 100;
  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", &gender);
  printf("What is the customer's age?\n");
  scanf(" %d", &age);
  if (married == 1) {
    rate = rate - 10;
  } else if (married = 0) {
    rate = rate;
  }
  if ((gender == 1) && (age < 23)) {
    rate = rate * 1.5;
  } else if ((gender == 1) && (age >= 23)) {
    rate = rate;
  }
  if ((gender == 0) && (age < 25)) {
    rate = rate * 2;
  } else if ((gender == 0) && (age >= 25)) {
    rate = rate * 1.5;
  }
  printf("The daily rate for this person is: $%.2f", 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,-0x14(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    11bb <main+0x9b>
movss  -0x14(%rbp),%xmm0
movss  0xe57(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11e0 <main+0xc0>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    11d1 <main+0xb1>
jmp    11db <main+0xbb>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11e0 <main+0xc0>
cmpl   $0x1,-0x10(%rbp)
jne    1217 <main+0xf7>
cmpl   $0x17,-0x8(%rbp)
jge    1217 <main+0xf7>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    123a <main+0x11a>
cmpl   $0x1,-0x10(%rbp)
jne    1235 <main+0x115>
cmpl   $0x17,-0x8(%rbp)
jl     1235 <main+0x115>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    123a <main+0x11a>
cmpl   $0x0,-0x10(%rbp)
jne    1265 <main+0x145>
cmpl   $0x19,-0x8(%rbp)
jge    1265 <main+0x145>
movss  0xdb2(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    129c <main+0x17c>
cmpl   $0x0,-0x10(%rbp)
jne    1297 <main+0x177>
cmpl   $0x19,-0x8(%rbp)
jl     1297 <main+0x177>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd86(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    129c <main+0x17c>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfd(%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    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x1,0x4(%rsp)
jne    1198 <main+0x68>
movss  0xe6a(%rip),%xmm1
jmp    11a8 <main+0x78>
movl   $0x0,0x4(%rsp)
movss  0xe5c(%rip),%xmm1
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    $0x17,%ecx
jl     11bf <main+0x8f>
movaps %xmm1,%xmm0
cmp    $0x1,%eax
jne    11d0 <main+0xa0>
jmp    11d3 <main+0xa3>
movss  0xe41(%rip),%xmm0
mulss  %xmm1,%xmm0
cmp    $0x1,%eax
je     11d3 <main+0xa3>
movaps %xmm1,%xmm0
test   %eax,%eax
jne    11e2 <main+0xb2>
cmp    $0x18,%ecx
jg     11e2 <main+0xb2>
addss  %xmm0,%xmm0
jmp    1200 <main+0xd0>
cmp    $0x19,%ecx
jge    11f0 <main+0xc0>
movaps %xmm0,%xmm1
test   %eax,%eax
jne    1200 <main+0xd0>
jmp    1203 <main+0xd3>
movss  0xe10(%rip),%xmm1
mulss  %xmm0,%xmm1
test   %eax,%eax
je     1203 <main+0xd3>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xdff(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Is the customer married? (1 = married, 0 = unmarried)?\0A\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [56 x i8] c"Is the customer male or female (1 = female, 0 = male)?\0A\00"
@.str.3 = [29 x i8] c"What is the customer's age?\0A\00"
@.str.4 = [41 x i8] c"The daily rate for this person is: $%.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
store float 1.000000e+02, float* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load float, float* %5
%16 = fsub float %15, 1.000000e+01
store float %16, float* %5
br label %21
17: ; preds = %0
store i32 0, i32* %3
br i1 false, label %18, label %20
18: ; preds = %17
%19 = load float, float* %5
store float %19, float* %5
br label %20
20: ; preds = %18, %17
br label %21
21: ; preds = %20, %14
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 23
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = fmul double %29, 1.500000e+00
%31 = fptrunc double %30 to float
store float %31, float* %5
br label %41
32: ; preds = %24, %21
%33 = load i32, i32* %4
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* %2
%37 = icmp sge i32 %36, 23
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = load float, float* %5
store float %39, float* %5
br label %40
40: ; preds = %38, %35, %32
br label %41
41: ; preds = %40, %27
%42 = load i32, i32* %4
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %50
44: ; preds = %41
%45 = load i32, i32* %2
%46 = icmp slt i32 %45, 25
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load float, float* %5
%49 = fmul float %48, 2.000000e+00
store float %49, float* %5
br label %62
50: ; preds = %44, %41
%51 = load i32, i32* %4
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %61
53: ; preds = %50
%54 = load i32, i32* %2
%55 = icmp sge i32 %54, 25
br i1 %55, label %56, label %61
56: ; preds = %53
%57 = load float, float* %5
%58 = fpext float %57 to double
%59 = fmul double %58, 1.500000e+00
%60 = fptrunc double %59 to float
store float %60, float* %5
br label %61
61: ; preds = %56, %53, %50
br label %62
62: ; preds = %61, %47
%63 = load float, float* %5
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %64)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %d\00"
@.str.4 = [41 x i8] c"The daily rate for this person is: $%.2f\00"
@str = [55 x i8] c"Is the customer married? (1 = married, 0 = unmarried)?\00"
@str.5 = [55 x i8] c"Is the customer male or female (1 = female, 0 = male)?\00"
@str.6 = [28 x i8] c"What is the customer'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 ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %16, label %15
15: ; preds = %0
store i32 0, i32* %2
br label %16
16: ; preds = %0, %15
%17 = phi float [ 1.000000e+02, %15 ], [ 9.000000e+01, %0 ]
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 1
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 23
%22 = select i1 %19, i1 %21, i1 false
%23 = fmul float %17, 1.500000e+00
%24 = select i1 %22, float %23, float %17
%25 = icmp eq i32 %18, 0
%26 = icmp slt i32 %20, 25
%27 = select i1 %25, i1 %26, i1 false
br i1 %27, label %28, label %30
28: ; preds = %16
%29 = fmul float %24, 2.000000e+00
br label %35
30: ; preds = %16
%31 = icmp sgt i32 %20, 24
%32 = select i1 %25, i1 %31, i1 false
%33 = fmul float %24, 1.500000e+00
%34 = select i1 %32, float %33, float %24
br label %35
35: ; preds = %30, %28
%36 = phi float [ %29, %28 ], [ %34, %30 ]
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %37)
ret i32 0
}