#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
char vehicleAndHrs(float *hrs) {
  char type = 'x';
  printf("\n\nMenu Options:");
  printf("\nc = car");
  printf("\nb = bus");
  printf("\nt = truck");
  printf("\n\nEnter c, b, or t to choose a vehicle type: ");
  scanf("%c", &type);
  if (type != 'c' || type != 'b' || type != 't') {
    printf("\n\nInvalid vehicle type entered. Please start over!\n");
    exit(1);
  }
  printf("\nEnter number of hours parked: ");
  scanf("%f", hrs);
  if (*hrs < 0) {
    printf("\n\nNumber of hours must be positive. Please start over!\n");
    exit(1);
  }
  return type;
}


x86 assembly (clang, -O0):
<vehicleAndHrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x78,-0x9(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x63,%eax
jne    11b5 <vehicleAndHrs+0x85>
movsbl -0x9(%rbp),%eax
cmp    $0x62,%eax
jne    11b5 <vehicleAndHrs+0x85>
movsbl -0x9(%rbp),%eax
cmp    $0x74,%eax
je     11cb <vehicleAndHrs+0x9b>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomiss (%rax),%xmm0
jbe    120f <vehicleAndHrs+0xdf>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vehicleAndHrs>:
push   %rax
movb   $0x78,0x7(%rsp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0A\0AMenu Options:\00"
@.str.1 = [9 x i8] c"\0Ac = car\00"
@.str.2 = [9 x i8] c"\0Ab = bus\00"
@.str.3 = [11 x i8] c"\0At = truck\00"
@.str.4 = [46 x i8] c"\0A\0AEnter c, b, or t to choose a vehicle type: \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [52 x i8] c"\0A\0AInvalid vehicle type entered. Please start over!\0A\00"
@.str.7 = [32 x i8] c"\0AEnter number of hours parked: \00"
@.str.8 = [3 x i8] c"%f\00"
@.str.9 = [56 x i8] c"\0A\0ANumber of hours must be positive. Please start over!\0A\00"
define signext i8 @vehicleAndHrs(float* %0) {
%2 = alloca float*
%3 = alloca i8
store float* %0, float** %2
store i8 120, i8* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 99
br i1 %12, label %21, label %13
13: ; preds = %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 98
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 116
br i1 %20, label %21, label %24
21: ; preds = %17, %13, %1
%22 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %17
%25 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
%26 = load float*, float** %2
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %26)
%28 = load float*, float** %2
%29 = load float, float* %28
%30 = fcmp olt float %29, 0.000000e+00
br i1 %30, label %31, label %34
31: ; preds = %24
%32 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %24
%35 = load i8, i8* %3
ret i8 %35
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0A\0AMenu Options:\00"
@.str.1 = [9 x i8] c"\0Ac = car\00"
@.str.2 = [9 x i8] c"\0Ab = bus\00"
@.str.3 = [11 x i8] c"\0At = truck\00"
@.str.4 = [46 x i8] c"\0A\0AEnter c, b, or t to choose a vehicle type: \00"
@.str.5 = [3 x i8] c"%c\00"
@str = [51 x i8] c"\0A\0AInvalid vehicle type entered. Please start over!\00"
define signext i8 @vehicleAndHrs(float* nocapture readnone %0) {
%2 = alloca i8
store i8 120, i8* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}