#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, married, gender;
  float rate;
  rate = 100;
  printf("Are you married?: \n");
  printf("If you are married enter 1 if not enter 0\n");
  scanf("%d", &married);
  if (married == 1) {
    rate = rate - 10;
  }
  printf("Are you male or female?: \n");
  printf("If you are female enter 1 if you are male enter 0\n");
  scanf("%d", &gender);
  printf("Please enter your age: ");
  scanf("%d", &age);
  if ((gender == 0) && (age < 25)) {
    rate = rate * 2;
  }
  if ((gender == 0) && (age >= 25)) {
    rate = rate * 1.5;
  }
  if ((gender == 1) && (age < 25)) {
    rate = rate * 1.5;
  }
  printf("The rate is: %f ", 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    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1188 <main+0x68>
movss  -0x14(%rbp),%xmm0
movss  0xe85(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
jne    11f8 <main+0xd8>
cmpl   $0x19,-0x8(%rbp)
jge    11f8 <main+0xd8>
movss  0xe1a(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    122a <main+0x10a>
cmpl   $0x19,-0x8(%rbp)
jl     122a <main+0x10a>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    125c <main+0x13c>
cmpl   $0x19,-0x8(%rbp)
jge    125c <main+0x13c>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdc1(%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    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0x8(%rsp)
sete   %al
lea    0xe8e(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  %xmm0,(%rsp)
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    $0x19,%ecx
jl     11d7 <main+0xa7>
movss  (%rsp),%xmm0
movaps %xmm0,%xmm1
test   %eax,%eax
jne    11e7 <main+0xb7>
jmp    11ea <main+0xba>
movss  (%rsp),%xmm0
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
test   %eax,%eax
je     11ea <main+0xba>
movaps %xmm0,%xmm1
movss  0xe16(%rip),%xmm0
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    120d <main+0xdd>
test   %eax,%eax
jne    1215 <main+0xe5>
cmp    $0x19,%ecx
jl     121d <main+0xed>
movaps %xmm2,%xmm0
cmp    $0x1,%eax
jne    1226 <main+0xf6>
jmp    1229 <main+0xf9>
mulss  %xmm0,%xmm2
test   %eax,%eax
je     11fe <main+0xce>
movaps %xmm1,%xmm2
cmp    $0x19,%ecx
jge    1203 <main+0xd3>
mulss  %xmm2,%xmm0
cmp    $0x1,%eax
je     1229 <main+0xf9>
movaps %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.5 = [24 x i8] c"Please enter your age: \00"
@.str.6 = [17 x i8] c"The rate is: %f \00"
@str = [19 x i8] c"Are you married?: \00"
@str.7 = [42 x i8] c"If you are married enter 1 if not enter 0\00"
@str.8 = [26 x i8] c"Are you male or female?: \00"
@str.9 = [50 x i8] c"If you are female enter 1 if you are male enter 0\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 ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.7, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = select i1 %11, float 9.000000e+01, float 1.000000e+02
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.9, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 25
%22 = select i1 %19, i1 %21, i1 false
%23 = fmul float %12, 2.000000e+00
%24 = select i1 %22, float %23, float %12
%25 = icmp sgt i32 %20, 24
%26 = select i1 %19, i1 %25, i1 false
%27 = fmul float %24, 1.500000e+00
%28 = select i1 %26, float %27, float %24
%29 = icmp eq i32 %18, 1
%30 = select i1 %29, i1 %21, i1 false
%31 = fmul float %28, 1.500000e+00
%32 = select i1 %30, float %31, float %28
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %33)
ret i32 0
}