#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 male or female (0=male, 1=female)?\n");
  scanf("%d", &value2);
  printf("What is the customer's 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    0xefa(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%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    120e <main+0xee>
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    11eb <main+0xcb>
jmp    11eb <main+0xcb>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe14(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    123b <main+0x11b>
cmpl   $0x19,-0x20(%rbp)
jge    1236 <main+0x116>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    123b <main+0x11b>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%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    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf29(%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     11af <main+0x7f>
cmp    $0x19,%eax
jl     11b8 <main+0x88>
jmp    11c0 <main+0x90>
cmp    $0x19,%eax
jge    11b8 <main+0x88>
addss  %xmm0,%xmm0
mulss  0xe48(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe44(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Is the customer married (1=married, 0=unmarried)?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [52 x i8] c"Is the customer male or female (0=male, 1=female)?\0A\00"
@.str.3 = [29 x i8] c"What is the customer's age?\0A\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 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 ([51 x i8], [51 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 ([52 x i8], [52 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 ([29 x i8], [29 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 %34
33: ; preds = %30
br label %34
34: ; preds = %33, %30
%35 = load float, float* %9
%36 = fpext float %35 to double
%37 = fmul double %36, 1.500000e+00
%38 = fptrunc double %37 to float
store float %38, float* %9
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, %34
%49 = load float, float* %9
%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.1 = [3 x i8] c"%d\00"
@.str.4 = [42 x i8] c"The daily rate for the customer is:$ %.2f\00"
@str = [50 x i8] c"Is the customer married (1=married, 0=unmarried)?\00"
@str.5 = [51 x i8] c"Is the customer male or female (0=male, 1=female)?\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 ([50 x i8], [50 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 ([51 x i8], [51 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 ([28 x i8], [28 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 %24
20: ; preds = %0
%21 = fmul float %15, 2.000000e+00
%22 = select i1 %19, float %21, float %15
%23 = fmul float %22, 1.500000e+00
br label %27
24: ; preds = %0
%25 = fmul float %15, 1.500000e+00
%26 = select i1 %19, float %25, float %15
br label %27
27: ; preds = %24, %20
%28 = phi float [ %23, %20 ], [ %26, %24 ]
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), double %29)
ret i32 0
}