#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void mEnter() {
  char name[512];
  char author[512];
  char publisher[512];
  printf("Enter blank name to end.\n");
  while (true) {
    printf("Name: ");
    fgets(name, 512, stdin);
    if (!(name[1])) {
      break;
    }
    printf("Author: ");
    fgets(author, 512, stdin);
    printf("Publisher: ");
    fgets(publisher, 512, stdin);
  }
}


x86 assembly (clang, -O0):
<mEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x600,%rsp
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x200(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1040 <fgets@plt>
cmpb   $0x0,-0x1ff(%rbp)
jne    116f <mEnter+0x4f>
jmp    11c0 <mEnter+0xa0>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0x400(%rbp),%rdi
mov    0x2e5f(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1040 <fgets@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x600(%rbp),%rdi
mov    0x2e39(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1040 <fgets@plt>
jmp    1137 <mEnter+0x17>
add    $0x600,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mEnter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x608,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e88(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x200,%esi
call   1050 <fgets@plt>
cmpb   $0x0,0x1(%rsp)
je     11f3 <mEnter+0xc3>
lea    0x400(%rsp),%r15
lea    0xe8a(%rip),%r12
lea    0x200(%rsp),%r13
lea    0xe6b(%rip),%rbx
mov    %rsp,%rbp
nopl   0x0(%rax,%rax,1)
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    (%r14),%edx
mov    %r15,%rdi
mov    $0x200,%esi
call   1050 <fgets@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    (%r14),%edx
mov    %r13,%rdi
mov    $0x200,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0x200,%esi
call   1050 <fgets@plt>
cmpb   $0x0,0x1(%rsp)
jne    11a0 <mEnter+0x70>
add    $0x608,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter blank name to end.\0A\00"
@.str.1 = [7 x i8] c"Name: \00"
@stdin = global i32 0
@.str.2 = [9 x i8] c"Author: \00"
@.str.3 = [12 x i8] c"Publisher: \00"
define void @mEnter() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %14
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 512, i32 %8)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 1
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %5
br label %23
14: ; preds = %5
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%17 = load i32, i32* @stdin
%18 = call i32 @fgets(i8* %16, i32 512, i32 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%21 = load i32, i32* @stdin
%22 = call i32 @fgets(i8* %20, i32 512, i32 %21)
br label %5
23: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"Name: \00"
@stdin = global i32 0
@.str.2 = [9 x i8] c"Author: \00"
@.str.3 = [12 x i8] c"Publisher: \00"
@str = [25 x i8] c"Enter blank name to end.\00"
define void @mEnter() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %4, i32 512, i32 %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %26, label %14
14: ; preds = %0, %14
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %5, i32 512, i32 %16)
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %6, i32 512, i32 %19)
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* @stdin
%23 = call i32 @fgets(i8* %4, i32 512, i32 %22)
%24 = load i8, i8* %11
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %14
26: ; preds = %14, %0
ret void
}