#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 get_must(int, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ syntax(char *);
int get_known(int fd, char *buf, char *val) {
  int ansr;
  for (ansr = get_must(fd, buf); (*buf == '\n' || *buf == '\r');
       ansr = get_must(fd, buf))
    ;
  if (strcmp(buf, val))
    syntax(buf);
  return ansr;
}


x86 assembly (clang, -O0):
<get_known>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <get_must@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x1d(%rbp)
je     1177 <get_known+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1187 <get_known+0x57>
jmp    11a0 <get_known+0x70>
jmp    118c <get_known+0x5c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <get_must@plt>
mov    %eax,-0x1c(%rbp)
jmp    1152 <get_known+0x22>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11c0 <get_known+0x90>
mov    -0x10(%rbp),%rdi
call   1040 <syntax@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_known>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
jmp    1155 <get_known+0x25>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <get_must@plt>
mov    %eax,%r15d
movzbl (%rbx),%eax
cmp    $0xd,%al
je     1150 <get_known+0x20>
cmp    $0xa,%al
je     1150 <get_known+0x20>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1180 <get_known+0x50>
mov    %rbx,%rdi
call   1040 <syntax@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_known(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @get_must(i32 %8, i8* %9)
store i32 %10, i32* %7
br label %11
11: ; preds = %24, %3
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 13
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ true, %11 ], [ %20, %16 ]
br i1 %22, label %23, label %28
23: ; preds = %21
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = load i8*, i8** %5
%27 = call i32 @get_must(i32 %25, i8* %26)
store i32 %27, i32* %7
br label %11
28: ; preds = %21
%29 = load i8*, i8** %5
%30 = load i8*, i8** %6
%31 = call i64 @strcmp(i8* %29, i8* %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = load i8*, i8** %5
%35 = call i32 @syntax(i8* %34)
br label %36
36: ; preds = %33, %28
%37 = load i32, i32* %7
ret i32 %37
}

LLVM IR (-O2):
define i32 @get_known(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @get_must(i32 %0, i8* %1)
br label %5
5: ; preds = %8, %3
%6 = phi i32 [ %4, %3 ], [ %9, %8 ]
%7 = load i8, i8* %1
switch i8 %7, label %10 [
i8 10, label %8
i8 13, label %8
]
8: ; preds = %5, %5
%9 = tail call i32 @get_must(i32 %0, i8* %1)
br label %5
10: ; preds = %5
%11 = tail call i64 @strcmp(i8* %1, i8* %2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @syntax(i8* %1)
br label %15
15: ; preds = %13, %10
ret i32 %6
}