#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 gett(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syntax_check(int, char *);
void main() {
  int i, c, l;
  char text[10000];
  printf("Enter text, what has to be formatted.\n");
  while ((l = gett(text)) > 0) {
    printf("\nThe result of check:\n");
    syntax_check(l, text);
  }
  printf("normal end of program\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x2720(%rbp),%rdi
call   1030 <gett@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    117f <main+0x4f>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
lea    -0x2720(%rbp),%rsi
call   1050 <syntax_check@plt>
jmp    1147 <main+0x17>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x2710,%rsp
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <gett@plt>
test   %eax,%eax
jle    1180 <main+0x50>
mov    %eax,%ebp
lea    0xee0(%rip),%r14
mov    %rsp,%rbx
nop
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <syntax_check@plt>
mov    %rbx,%rdi
call   1040 <gett@plt>
mov    %eax,%ebp
test   %eax,%eax
jg     1160 <main+0x30>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
add    $0x2710,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Enter text, what has to be formatted.\0A\00"
@.str.1 = [23 x i8] c"\0AThe result of check:\0A\00"
@.str.2 = [23 x i8] c"normal end of program\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10000 x i8]
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %10, %0
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%8 = call i32 @gett(i8* %7)
store i32 %8, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%14 = call i32 @syntax_check(i32 %12, i8* %13)
br label %6
15: ; preds = %6
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Enter text, what has to be formatted.\00"
@str.3 = [22 x i8] c"normal end of program\00"
@str.4 = [22 x i8] c"\0AThe result of check:\00"
define void @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gett(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
%9 = call i32 @syntax_check(i32 %7, i8* %2)
%10 = call i32 @gett(i8* %2)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
ret void
}