#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*/ Controller_displayStudentInfo(char *);
scalar_t__ Controller_studentPresent(char *);
int /*<<< orphan*/ GetString();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void HandleInputView_inputStudentDisplayStudentInfo() {
  printf("Display Student Info.\n");
  printf("Student Number: ");
  char studentNumber[256];
  strcpy(studentNumber, GetString());
  if (Controller_studentPresent(studentNumber)) {
    Controller_displayStudentInfo(studentNumber);
  } else {
    printf("Student %s does not exist.\n", studentNumber);
  }
  printf("Press Enter key to continue...");
  getchar();
}


x86 assembly (clang, -O0):
<HandleInputView_inputStudentDisplayStudentInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    $0x0,%al
call   1040 <GetString@plt>
mov    -0x108(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
lea    -0x100(%rbp),%rdi
call   1050 <Controller_studentPresent@plt>
cmp    $0x0,%rax
je     11d1 <HandleInputView_inputStudentDisplayStudentInfo+0x71>
lea    -0x100(%rbp),%rdi
call   1060 <Controller_displayStudentInfo@plt>
jmp    11e6 <HandleInputView_inputStudentDisplayStudentInfo+0x86>
lea    -0x100(%rbp),%rsi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleInputView_inputStudentDisplayStudentInfo>:
push   %rbx
sub    $0x100,%rsp
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
call   1050 <GetString@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <Controller_studentPresent@plt>
test   %rax,%rax
je     11bd <HandleInputView_inputStudentDisplayStudentInfo+0x4d>
mov    %rsp,%rdi
call   1070 <Controller_displayStudentInfo@plt>
jmp    11ce <HandleInputView_inputStudentDisplayStudentInfo+0x5e>
lea    0xe4d(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe58(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
call   1090 <getchar@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Display Student Info.\0A\00"
@.str.1 = [17 x i8] c"Student Number: \00"
@.str.2 = [28 x i8] c"Student %s does not exist.\0A\00"
@.str.3 = [31 x i8] c"Press Enter key to continue...\00"
define void @HandleInputView_inputStudentDisplayStudentInfo() {
%1 = alloca [256 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 (...) @GetString()
%6 = call i32 @strcpy(i8* %4, i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%8 = call i64 @Controller_studentPresent(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%12 = call i32 @Controller_displayStudentInfo(i8* %11)
br label %16
13: ; preds = %0
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Student Number: \00"
@.str.2 = [28 x i8] c"Student %s does not exist.\0A\00"
@.str.3 = [31 x i8] c"Press Enter key to continue...\00"
@str = [22 x i8] c"Display Student Info.\00"
define void @HandleInputView_inputStudentDisplayStudentInfo() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = tail call i32 (...) @GetString()
%6 = call i32 @strcpy(i8* %4, i32 %5)
%7 = call i64 @Controller_studentPresent(i8* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @Controller_displayStudentInfo(i8* %4)
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %13
13: ; preds = %11, %9
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (...) @getchar()
ret void
}