#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ clean_string(char *);
scalar_t__ espacos(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ includefile(int /*<<< orphan*/ *, char *);
scalar_t__ isspace(char);
int /*<<< orphan*/ output_snt(int /*<<< orphan*/ *);
scalar_t__ sscanf(char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strchr(char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int get_proc_command(char *s, FILE *fin, FILE *fout) {
  char t[BUFSIZ];
  char *p;
  if (espacos(s))
    return 0;
  strncpy(t, s, BUFSIZ - 1);
  p = t;
  while (isspace(*p) && *p != '\0')
    p++;
  strncpy(s, p, BUFSIZ - 1);
  p = strchr(s, 13);
  if (p != 0)
    *p = '\0';
  p = strchr(s, 10);
  if (p != 0)
    *p = '\0';
  t[0] = '\0';
  if (sscanf(s, "include: %s", t) > 0) {
    strcpy(t, s + 8);
    clean_string(t);
    if (!strcmp(t, "snt")) {
      output_snt(fout);
      return 1;
    } else {
      fprintf(stderr, "\n\n%s\n\n", t);
      includefile(fout, t);
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_proc_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <espacos@plt>
cmp    $0x0,%rax
je     1216 <get_proc_command+0x66>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    139e <get_proc_command+0x1ee>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2db3(%rip),%rax
mov    (%rax),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x49(%rbp)
je     1265 <get_proc_command+0xb5>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
test   $0x1,%al
jne    1275 <get_proc_command+0xc5>
jmp    1286 <get_proc_command+0xd6>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1237 <get_proc_command+0x87>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    0x2d43(%rip),%rax
mov    (%rax),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1050 <strchr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     12c3 <get_proc_command+0x113>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     12e7 <get_proc_command+0x137>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rdx
movb   $0x0,(%rdx)
mov    -0x10(%rbp),%rdi
lea    0xd07(%rip),%rsi
call   10c0 <sscanf@plt>
cmp    $0x0,%rax
jle    1390 <get_proc_command+0x1e0>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <strcpy@plt>
mov    -0x48(%rbp),%rdi
call   1070 <clean_string@plt>
mov    -0x48(%rbp),%rdi
lea    0xcdf(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    1357 <get_proc_command+0x1a7>
mov    -0x20(%rbp),%rdi
call   1090 <output_snt@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    139e <get_proc_command+0x1ee>
mov    -0x48(%rbp),%rdx
mov    0x2c7e(%rip),%rax
mov    (%rax),%edi
lea    0xca5(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdi
call   1060 <includefile@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    139e <get_proc_command+0x1ee>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_proc_command>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r15
mov    0x2e0d(%rip),%r14
mov    (%r14),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
call   10d0 <espacos@plt>
xor    %r12d,%r12d
test   %rax,%rax
jne    12ef <get_proc_command+0x13f>
mov    %rbx,-0x30(%rbp)
mov    (%r14),%edx
add    $0xffffffff,%edx
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <strncpy@plt>
movsbl 0x0(%r13),%edi
call   1080 <isspace@plt>
mov    %r13,%rbx
test   %rax,%rax
je     1237 <get_proc_command+0x87>
mov    %r13,%rbx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rbx)
je     1237 <get_proc_command+0x87>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1080 <isspace@plt>
test   %rax,%rax
jne    1220 <get_proc_command+0x70>
mov    (%r14),%edx
add    $0xffffffff,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strncpy@plt>
mov    %r15,%rdi
mov    $0xd,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     125d <get_proc_command+0xad>
movb   $0x0,(%rax)
mov    %r15,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
mov    -0x30(%rbp),%rbx
je     1276 <get_proc_command+0xc6>
movb   $0x0,(%rax)
movb   $0x0,0x0(%r13)
lea    0xd7e(%rip),%rsi
mov    %r15,%rdi
mov    %r13,%rdx
call   10c0 <sscanf@plt>
test   %rax,%rax
jle    12ef <get_proc_command+0x13f>
add    $0x8,%r15
mov    %r13,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   1070 <clean_string@plt>
lea    0xd5c(%rip),%rsi
mov    %r13,%rdi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     12e1 <get_proc_command+0x131>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xd44(%rip),%rsi
mov    %r13,%rdx
call   10b0 <fprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <includefile@plt>
jmp    12e9 <get_proc_command+0x139>
mov    %rbx,%rdi
call   1090 <output_snt@plt>
mov    $0x1,%r12d
mov    %r12d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [12 x i8] c"include: %s\00"
@.str.1 = [4 x i8] c"snt\00"
@stderr = global i32 0
@.str.2 = [7 x i8] c"\0A\0A%s\0A\0A\00"
define i32 @get_proc_command(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%12 = load i32, i32* @BUFSIZ
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %8
%15 = alloca i8, i64 %13
store i64 %13, i64* %9
%16 = load i8*, i8** %5
%17 = call i64 @espacos(i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %3
store i32 0, i32* %4
store i32 1, i32* %11
br label %80
20: ; preds = %3
%21 = load i8*, i8** %5
%22 = load i32, i32* @BUFSIZ
%23 = sub nsw i32 %22, 1
%24 = call i32 @strncpy(i8* %15, i8* %21, i32 %23)
store i8* %15, i8** %10
br label %25
25: ; preds = %37, %20
%26 = load i8*, i8** %10
%27 = load i8, i8* %26
%28 = call i64 @isspace(i8 signext %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %25
%31 = load i8*, i8** %10
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 0
br label %35
35: ; preds = %30, %25
%36 = phi i1 [ false, %25 ], [ %34, %30 ]
br i1 %36, label %37, label %40
37: ; preds = %35
%38 = load i8*, i8** %10
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %10
br label %25
40: ; preds = %35
%41 = load i8*, i8** %5
%42 = load i8*, i8** %10
%43 = load i32, i32* @BUFSIZ
%44 = sub nsw i32 %43, 1
%45 = call i32 @strncpy(i8* %41, i8* %42, i32 %44)
%46 = load i8*, i8** %5
%47 = call i8* @strchr(i8* %46, i32 13)
store i8* %47, i8** %10
%48 = load i8*, i8** %10
%49 = icmp ne i8* %48, null
br i1 %49, label %50, label %52
50: ; preds = %40
%51 = load i8*, i8** %10
store i8 0, i8* %51
br label %52
52: ; preds = %50, %40
%53 = load i8*, i8** %5
%54 = call i8* @strchr(i8* %53, i32 10)
store i8* %54, i8** %10
%55 = load i8*, i8** %10
%56 = icmp ne i8* %55, null
br i1 %56, label %57, label %59
57: ; preds = %52
%58 = load i8*, i8** %10
store i8 0, i8* %58
br label %59
59: ; preds = %57, %52
%60 = getelementptr inbounds i8, i8* %15, i64 0
store i8 0, i8* %60
%61 = load i8*, i8** %5
%62 = call i64 @sscanf(i8* %61, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %15)
%63 = icmp sgt i64 %62, 0
br i1 %63, label %64, label %79
64: ; preds = %59
%65 = load i8*, i8** %5
%66 = getelementptr inbounds i8, i8* %65, i64 8
%67 = call i32 @strcpy(i8* %15, i8* %66)
%68 = call i32 @clean_string(i8* %15)
%69 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%70 = icmp ne i32 %69, 0
br i1 %70, label %74, label %71
71: ; preds = %64
%72 = load i32*, i32** %7
%73 = call i32 @output_snt(i32* %72)
store i32 1, i32* %4
store i32 1, i32* %11
br label %80
74: ; preds = %64
%75 = load i32, i32* @stderr
%76 = call i32 @fprintf(i32 %75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%77 = load i32*, i32** %7
%78 = call i32 @includefile(i32* %77, i8* %15)
store i32 1, i32* %4
store i32 1, i32* %11
br label %80
79: ; preds = %59
store i32 0, i32* %4
store i32 1, i32* %11
br label %80
80: ; preds = %79, %74, %71, %19
%81 = load i8*, i8** %8
%82 = load i32, i32* %4
ret i32 %82
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [12 x i8] c"include: %s\00"
@.str.1 = [4 x i8] c"snt\00"
@stderr = global i32 0
@.str.2 = [7 x i8] c"\0A\0A%s\0A\0A\00"
define i32 @get_proc_command(i8* %0, i32* nocapture readnone %1, i32* %2) {
%4 = load i32, i32* @BUFSIZ
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = tail call i64 @espacos(i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %52
9: ; preds = %3
%10 = load i32, i32* @BUFSIZ
%11 = add nsw i32 %10, -1
%12 = call i32 @strncpy(i8* %6, i8* %0, i32 %11)
%13 = load i8, i8* %6
%14 = call i64 @isspace(i8 signext %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %25, label %16
16: ; preds = %9, %20
%17 = phi i8* [ %21, %20 ], [ %6, %9 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %25, label %20
20: ; preds = %16
%21 = getelementptr inbounds i8, i8* %17, i64 1
%22 = load i8, i8* %21
%23 = call i64 @isspace(i8 signext %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %16
25: ; preds = %16, %20, %9
%26 = phi i8* [ %6, %9 ], [ %21, %20 ], [ %17, %16 ]
%27 = load i32, i32* @BUFSIZ
%28 = add nsw i32 %27, -1
%29 = call i32 @strncpy(i8* %0, i8* %26, i32 %28)
%30 = call i8* @strchr(i8* dereferenceable(1) %0, i32 13)
%31 = icmp eq i8* %30, null
br i1 %31, label %33, label %32
32: ; preds = %25
store i8 0, i8* %30
br label %33
33: ; preds = %32, %25
%34 = call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%35 = icmp eq i8* %34, null
br i1 %35, label %37, label %36
36: ; preds = %33
store i8 0, i8* %34
br label %37
37: ; preds = %36, %33
store i8 0, i8* %6
%38 = call i64 @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%39 = icmp sgt i64 %38, 0
br i1 %39, label %40, label %52
40: ; preds = %37
%41 = getelementptr inbounds i8, i8* %0, i64 8
%42 = call i32 @strcpy(i8* %6, i8* %41)
%43 = call i32 @clean_string(i8* %6)
%44 = call i32 @strcmp(i8* %6, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %40
%47 = call i32 @output_snt(i32* %2)
br label %52
48: ; preds = %40
%49 = load i32, i32* @stderr
%50 = call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%51 = call i32 @includefile(i32* %2, i8* %6)
br label %52
52: ; preds = %37, %3, %48, %46
%53 = phi i32 [ 1, %48 ], [ 1, %46 ], [ 0, %3 ], [ 0, %37 ]
ret i32 %53
}