#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 get_problem() {
  int ch;
  printf("\n\nEnter the number of the problem you wish to solve.");
  printf("\nGIVEN A MEDICAL ORDER IN %5c CALCULATE RATE IN", ' ');
  printf("\n(1) ml/hr & tubing drop factor %5c drops / min", ' ');
  printf("\n(2) 1 L for n hr %5c ml / hr", ' ');
  printf("\n(3) mg/kg/hr & concentration in mg/ml	%5c ml / hr", ' ');
  printf("\n(4) units/hr & concentration in units/ml %5c	ml / hr", ' ');
  printf("\n(5) QUIT");
  printf("\n\nProblem>");
  scanf("%d", &ch);
  return ch;
}


x86 assembly (clang, -O0):
<get_problem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf32(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf79(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_problem>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf64(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf87(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf83(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"\0A\0AEnter the number of the problem you wish to solve.\00"
@.str.1 = [48 x i8] c"\0AGIVEN A MEDICAL ORDER IN %5c CALCULATE RATE IN\00"
@.str.2 = [48 x i8] c"\0A(1) ml/hr & tubing drop factor %5c drops / min\00"
@.str.3 = [30 x i8] c"\0A(2) 1 L for n hr %5c ml / hr\00"
@.str.4 = [51 x i8] c"\0A(3) mg/kg/hr & concentration in mg/ml\09%5c ml / hr\00"
@.str.5 = [54 x i8] c"\0A(4) units/hr & concentration in units/ml %5c\09ml / hr\00"
@.str.6 = [10 x i8] c"\0A(5) QUIT\00"
@.str.7 = [11 x i8] c"\0A\0AProblem>\00"
@.str.8 = [3 x i8] c"%d\00"
define i32 @get_problem() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 32)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 32)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 32)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i32 32)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i32 32)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [53 x i8] c"\0A\0AEnter the number of the problem you wish to solve.\00"
@.str.1 = [48 x i8] c"\0AGIVEN A MEDICAL ORDER IN %5c CALCULATE RATE IN\00"
@.str.2 = [48 x i8] c"\0A(1) ml/hr & tubing drop factor %5c drops / min\00"
@.str.3 = [30 x i8] c"\0A(2) 1 L for n hr %5c ml / hr\00"
@.str.4 = [51 x i8] c"\0A(3) mg/kg/hr & concentration in mg/ml\09%5c ml / hr\00"
@.str.5 = [54 x i8] c"\0A(4) units/hr & concentration in units/ml %5c\09ml / hr\00"
@.str.6 = [10 x i8] c"\0A(5) QUIT\00"
@.str.7 = [11 x i8] c"\0A\0AProblem>\00"
@.str.8 = [3 x i8] c"%d\00"
define i32 @get_problem() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 32)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 32)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 32)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i32 32)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i32 32)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
ret i32 %12
}