#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__ __AFL_LOOP(int);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int main(int argc, char **argv) {
  char buf[100];
  while (__AFL_LOOP(1000)) {
    memset(buf, 0, 100);
    read(0, buf, 100);
    if (buf[0] == 'f') {
      printf("one\n");
      if (buf[1] == 'o') {
        printf("two\n");
        if (buf[2] == 'o') {
          printf("three\n");
          if (buf[3] == '!') {
            printf("four\n");
            abort();
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3e8,%edi
call   1070 <__AFL_LOOP@plt>
cmp    $0x0,%rax
je     121c <main+0xcc>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x80(%rbp),%rsi
xor    %edi,%edi
mov    $0x64,%edx
call   1060 <read@plt>
movsbl -0x80(%rbp),%eax
cmp    $0x66,%eax
jne    1217 <main+0xc7>
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x7f(%rbp),%eax
cmp    $0x6f,%eax
jne    1212 <main+0xc2>
lea    0xe3b(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x7e(%rbp),%eax
cmp    $0x6f,%eax
jne    120d <main+0xbd>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x7d(%rbp),%eax
cmp    $0x21,%eax
jne    1208 <main+0xb8>
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    120d <main+0xbd>
jmp    1212 <main+0xc2>
jmp    1217 <main+0xc7>
jmp    1169 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    $0x3e8,%edi
call   1070 <__AFL_LOOP@plt>
test   %rax,%rax
je     1203 <main+0xb3>
mov    %rsp,%rbx
lea    0xe88(%rip),%r14
lea    0xe85(%rip),%r15
lea    0xe82(%rip),%r12
jmp    119f <main+0x4f>
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1070 <__AFL_LOOP@plt>
test   %rax,%rax
je     1203 <main+0xb3>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1060 <read@plt>
cmpb   $0x66,(%rsp)
jne    1190 <main+0x40>
mov    %r14,%rdi
call   1040 <puts@plt>
cmpb   $0x6f,0x1(%rsp)
jne    1190 <main+0x40>
mov    %r15,%rdi
call   1040 <puts@plt>
cmpb   $0x6f,0x2(%rsp)
jne    1190 <main+0x40>
mov    %r12,%rdi
call   1040 <puts@plt>
cmpb   $0x21,0x3(%rsp)
jne    1190 <main+0x40>
lea    0xe17(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"one\0A\00"
@.str.1 = [5 x i8] c"two\0A\00"
@.str.2 = [7 x i8] c"three\0A\00"
@.str.3 = [6 x i8] c"four\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %43, %2
%8 = call i64 @__AFL_LOOP(i32 1000)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %44
10: ; preds = %7
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = call i32 @memset(i8* %11, i32 0, i32 100)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @read(i32 0, i8* %13, i32 100)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 102
br i1 %18, label %19, label %43
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 111
br i1 %24, label %25, label %42
25: ; preds = %19
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 2
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 111
br i1 %30, label %31, label %41
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 3
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 33
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 (...) @abort()
unreachable
40: ; preds = %31
br label %41
41: ; preds = %40, %25
br label %42
42: ; preds = %41, %19
br label %43
43: ; preds = %42, %10
br label %7
44: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"one\00"
@str.4 = [4 x i8] c"two\00"
@str.5 = [6 x i8] c"three\00"
@str.6 = [5 x i8] c"four\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i64 @__AFL_LOOP(i32 1000)
%6 = icmp eq i64 %5, 0
br i1 %6, label %34, label %7
7: ; preds = %2
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 2
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 3
br label %11
11: ; preds = %7, %31
%12 = call i32 @memset(i8* %4, i32 0, i32 100)
%13 = call i32 @read(i32 0, i8* %4, i32 100)
%14 = load i8, i8* %4
%15 = icmp eq i8 %14, 102
br i1 %15, label %16, label %31
16: ; preds = %11
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%18 = load i8, i8* %8
%19 = icmp eq i8 %18, 111
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
%22 = load i8, i8* %9
%23 = icmp eq i8 %22, 111
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
%26 = load i8, i8* %10
%27 = icmp eq i8 %26, 33
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %16, %24, %20, %11
%32 = call i64 @__AFL_LOOP(i32 1000)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %11
34: ; preds = %31, %2
ret i32 0
}