#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 */
char *get_special_input(char);
int getchar();
int /*<<< orphan*/ report_error(char *, int, int, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
char *save_include_src() {
  int c;
  if ((c = getchar()) != '%') {
    ungetc(c, stdin);
    return "";
  } else if ((c = getchar()) != '{')
    report_error("internal error, %c != '{' on line %d in file %s%a", c, 150,
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/coyotebringsfire/MuMoo/"
                 "refs/heads/master/MOO-1.8.1/pgperf/keylist.c");
  else
    return get_special_input('}');
}


x86 assembly (clang, -O0):
<save_include_src>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x25,%eax
je     117c <save_include_src+0x3c>
mov    -0xc(%rbp),%edi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c7 <save_include_src+0x87>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x7b,%eax
je     11af <save_include_src+0x6f>
mov    -0xc(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x96,%edx
lea    0xe8d(%rip),%rcx
call   1050 <report_error@plt>
jmp    11c2 <save_include_src+0x82>
mov    $0x7d,%edi
call   1060 <get_special_input@plt>
mov    %rax,-0x8(%rbp)
jmp    11c7 <save_include_src+0x87>
jmp    11c7 <save_include_src+0x87>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_include_src>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x25,%eax
jne    1164 <save_include_src+0x24>
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x7b,%eax
jne    1176 <save_include_src+0x36>
mov    $0x7d,%edi
pop    %rax
jmp    1060 <get_special_input@plt>
mov    0x2e7d(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <ungetc@plt>
jmp    1190 <save_include_src+0x50>
lea    0xe83(%rip),%rdi
lea    0xeae(%rip),%rcx
mov    %eax,%esi
mov    $0x96,%edx
call   1050 <report_error@plt>
lea    0xe9a(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [50 x i8] c"internal error, %c != '{' on line %d in file %s%a\00"
@.str.2 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/coyotebringsfire/MuMoo/refs/heads/master/MOO-1.8.1/pgperf/keylist.c\00"
define i8* @save_include_src() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
%4 = icmp ne i32 %3, 37
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* %2
%7 = load i32, i32* @stdin
%8 = call i32 @ungetc(i32 %6, i32 %7)
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
br label %18
9: ; preds = %0
%10 = call i32 (...) @getchar()
store i32 %10, i32* %2
%11 = icmp ne i32 %10, 123
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = call i32 @report_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 150, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %9
%16 = call i8* @get_special_input(i8 signext 125)
store i8* %16, i8** %1
br label %18
17: ; preds = %12
br label %18
18: ; preds = %5, %15, %17
%19 = load i8*, i8** %1
ret i8* %19
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [50 x i8] c"internal error, %c != '{' on line %d in file %s%a\00"
@.str.2 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/coyotebringsfire/MuMoo/refs/heads/master/MOO-1.8.1/pgperf/keylist.c\00"
define i8* @save_include_src() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 37
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stdin
%5 = tail call i32 @ungetc(i32 %1, i32 %4)
br label %13
6: ; preds = %0
%7 = tail call i32 (...) @getchar()
%8 = icmp eq i32 %7, 123
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @report_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 150, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %6
%12 = tail call i8* @get_special_input(i8 signext 125)
br label %13
13: ; preds = %9, %11, %3
%14 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %3 ], [ undef, %9 ], [ %12, %11 ]
ret i8* %14
}