#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 unmarried;
  int female;
  int male;
  int value1;
  int value2;
  int age;
  float rate = 100.00;
  printf("Is the customer married (1= married, 0=unmarried)?\n");
  scanf("%d", &value1);
  printf(" Is the customer female or male (1= female, 0= male)?\n");
  scanf("%d", &value2);
  printf("What it is the customer age?\n");
  scanf("%d", &age);
  if (value1 > 0) {
    rate = rate - 10;
  }
  if (value2 == 0) {
    if (age < 25)
      rate = rate * 2;
    if (age > 25)
      rate = rate * 1.5;
  } else {
    if (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    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jle    11b6 <main+0x96>
movss  -0x24(%rbp),%xmm0
movss  0xe57(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1209 <main+0xe9>
cmpl   $0x19,-0x20(%rbp)
jge    11dc <main+0xbc>
movss  0xe36(%rip),%xmm0
mulss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
cmpl   $0x19,-0x20(%rbp)
jle    1204 <main+0xe4>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe19(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1236 <main+0x116>
cmpl   $0x19,-0x20(%rbp)
jge    1231 <main+0x111>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdec(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1236 <main+0x116>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,0xc(%rsp)
setg   %al
lea    0xe68(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
cmpl   $0x0,0x8(%rsp)
mov    0x4(%rsp),%eax
je     11cf <main+0x9f>
cmp    $0x19,%eax
jge    11b5 <main+0x85>
mulss  0xe53(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
cmp    $0x19,%eax
jge    11d8 <main+0xa8>
addss  %xmm0,%xmm0
cmp    $0x1a,%eax
jge    11ad <main+0x7d>
jmp    11b5 <main+0x85>

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 = [55 x i8] c" Is the customer female or male (1= female, 0= male)?\0A\00"
@.str.3 = [30 x i8] c"What it is the customer age?\0A\00"
@.str.4 = [43 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 i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store i32 0, i32* %1
store float 1.000000e+02, float* %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%16 = load i32, i32* %6
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %0
%19 = load float, float* %9
%20 = fsub float %19, 1.000000e+01
store float %20, float* %9
br label %21
21: ; preds = %18, %0
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %39
24: ; preds = %21
%25 = load i32, i32* %8
%26 = icmp slt i32 %25, 25
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load float, float* %9
%29 = fmul float %28, 2.000000e+00
store float %29, float* %9
br label %30
30: ; preds = %27, %24
%31 = load i32, i32* %8
%32 = icmp sgt i32 %31, 25
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load float, float* %9
%35 = fpext float %34 to double
%36 = fmul double %35, 1.500000e+00
%37 = fptrunc double %36 to float
store float %37, float* %9
br label %38
38: ; preds = %33, %30
br label %48
39: ; preds = %21
%40 = load i32, i32* %8
%41 = icmp slt i32 %40, 25
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load float, float* %9
%44 = fpext float %43 to double
%45 = fmul double %44, 1.500000e+00
%46 = fptrunc double %45 to float
store float %46, float* %9
br label %47
47: ; preds = %42, %39
br label %48
48: ; preds = %47, %38
%49 = load float, float* %9
%50 = fpext float %49 to double
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), double %50)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [43 x i8] c"The daily rate for the customer is ; $%.2f\00"
@str = [51 x i8] c"Is the customer married (1= married, 0=unmarried)?\00"
@str.5 = [54 x i8] c" Is the customer female or male (1= female, 0= male)?\00"
@str.6 = [29 x i8] c"What it is the customer 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* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 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* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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 sgt i32 %13, 0
%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
br i1 %17, label %20, label %26
20: ; preds = %0
%21 = fmul float %15, 2.000000e+00
%22 = select i1 %19, float %21, float %15
%23 = icmp sgt i32 %18, 25
%24 = fmul float %22, 1.500000e+00
%25 = select i1 %23, float %24, float %22
br label %29
26: ; preds = %0
%27 = fmul float %15, 1.500000e+00
%28 = select i1 %19, float %27, float %15
br label %29
29: ; preds = %20, %26
%30 = phi float [ %28, %26 ], [ %25, %20 ]
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), double %31)
ret i32 0
}