#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*/ dbgHashMake(char *);
scalar_t__ malloc(int);
scalar_t__ printf(char *);
scalar_t__ scanf(char *, char *);
int main(void) {
  char *guo = (char *)malloc(100);
  while (printf("input: ") && scanf("%s", guo) != EOF) {
    dbgHashMake(guo);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     119b <main+0x5b>
mov    -0x10(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    11ab <main+0x6b>
jmp    11b9 <main+0x79>
mov    -0x10(%rbp),%rdi
call   1060 <dbgHashMake@plt>
jmp    115d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
test   %rax,%rax
je     11a6 <main+0x66>
lea    0xe9b(%rip),%r14
mov    0x2e74(%rip),%r12
lea    0xe85(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r12),%rax
je     11a6 <main+0x66>
mov    %rbx,%rdi
call   1060 <dbgHashMake@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
test   %rax,%rax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"input: \00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
br label %5
5: ; preds = %15, %0
%6 = call i64 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = call i32 @dbgHashMake(i8* %16)
br label %5
18: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"input: \00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0, %9
%6 = tail call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call i32 @dbgHashMake(i8* %2)
%11 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %0
ret i32 0
}