#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;
  int sex;
  int age;
  float rate = 100;
  printf("Is the customer married (1 = married, 0 = unmarried)?");
  scanf("%d", &married);
  printf("Is the customer male or female (1 = female, 0 = male)?");
  scanf("%d", &sex);
  printf("What is the customer's age?");
  scanf("%d", &age);
  if (married == 1) {
    rate = rate - 10;
  }
  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 for the customer 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    0xefd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11b6 <main+0x96>
movss  -0x14(%rbp),%xmm0
movss  0xe57(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11dc <main+0xbc>
cmpl   $0x19,-0x10(%rbp)
jge    11dc <main+0xbc>
movss  0xe36(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    120e <main+0xee>
cmpl   $0x19,-0x10(%rbp)
jl     120e <main+0xee>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1240 <main+0x120>
cmpl   $0x19,-0x10(%rbp)
jge    1240 <main+0x120>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xddd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%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    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf08(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xef7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf13(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0xc(%rsp)
sete   %al
lea    0xe72(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%ecx
movaps %xmm0,%xmm1
cmp    $0x19,%ecx
jge    11a7 <main+0x87>
addss  %xmm0,%xmm1
test   %eax,%eax
je     11ae <main+0x8e>
movaps %xmm0,%xmm1
movss  0xe52(%rip),%xmm0
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    11d1 <main+0xb1>
test   %eax,%eax
jne    11d9 <main+0xb9>
cmp    $0x19,%ecx
jl     11e1 <main+0xc1>
movaps %xmm2,%xmm0
cmp    $0x1,%eax
jne    11ea <main+0xca>
jmp    11ed <main+0xcd>
mulss  %xmm0,%xmm2
test   %eax,%eax
je     11c2 <main+0xa2>
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    11c7 <main+0xa7>
mulss  %xmm2,%xmm0
cmp    $0x1,%eax
je     11ed <main+0xcd>
movaps %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [54 x i8] c"Is the customer married (1 = married, 0 = unmarried)?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [55 x i8] c"Is the customer male or female (1 = female, 0 = male)?\00"
@.str.3 = [28 x i8] c"What is the customer's age?\00"
@.str.4 = [42 x i8] c"The daily rate for the customer is: $%.2f\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 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* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, 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 = 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 ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), double %31)
ret i32 0
}