#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__ accept(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  while (1) {
    printf("String: ");
    char buffer[20];
    scanf("%s", buffer);
    if (accept(buffer)) {
      printf("%s wurde akzeptiert.\n", buffer);
    } else {
      printf("%s wurde nicht akzeptiert.\n", buffer);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <accept@plt>
cmp    $0x0,%rax
je     1187 <main+0x57>
lea    -0x20(%rbp),%rsi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1199 <main+0x69>
lea    -0x20(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xebc(%rip),%r14
lea    0xebe(%rip),%r15
mov    %rsp,%rbx
lea    0xecd(%rip),%r12
lea    0xeb0(%rip),%r13
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <accept@plt>
test   %rax,%rax
mov    %r13,%rdi
cmove  %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [9 x i8] c"String: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"%s wurde akzeptiert.\0A\00"
@.str.3 = [28 x i8] c"%s wurde nicht akzeptiert.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %16
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i64 @accept(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %11)
br label %16
13: ; preds = %3
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %10
br label %3
}

LLVM IR (-O2):
@.str = [9 x i8] c"String: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"%s wurde akzeptiert.\0A\00"
@.str.3 = [28 x i8] c"%s wurde nicht akzeptiert.\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = call i64 @accept(i8* %2)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %8, i8* %2)
br label %3
}