#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 */
scalar_t__ EOF;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *);
int /*<<< orphan*/ stdout;
char *viewtags_input_tag(void) {
  static char tag[64];
  printf("tag? ");
  fflush(stdout);
  if (scanf("%63s", tag) == EOF)
    return NULL;
  return tag;
}


x86 assembly (clang, -O0):
<viewtags_input_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xead(%rip),%rdi
lea    0x2ef0(%rip),%rsi
call   1050 <scanf@plt>
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
jne    1182 <viewtags_input_tag+0x52>
movq   $0x0,-0x8(%rbp)
jmp    118d <viewtags_input_tag+0x5d>
lea    0x2ec7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewtags_input_tag>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeb4(%rip),%rdi
lea    0x2ef7(%rip),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x2e80(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
cmovne %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@viewtags_input_tag.tag = internal global [64 x i8] zeroinitializer
@.str = [6 x i8] c"tag? \00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"%63s\00"
@EOF = global i64 0
define i8* @viewtags_input_tag() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @viewtags_input_tag.tag, i64 0, i64 0))
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %0
store i8* null, i8** %1
br label %10
9: ; preds = %0
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @viewtags_input_tag.tag, i64 0, i64 0), i8** %1
br label %10
10: ; preds = %9, %8
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@viewtags_input_tag.tag = internal global [64 x i8] zeroinitializer
@.str = [6 x i8] c"tag? \00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"%63s\00"
@EOF = global i64 0
define i8* @viewtags_input_tag() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @viewtags_input_tag.tag, i64 0, i64 0))
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
%7 = select i1 %6, i8* null, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @viewtags_input_tag.tag, i64 0, i64 0)
ret i8* %7
}