#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 /*<<< orphan*/ PATH_MAX;
int atoi(char *);
char *gettok(char *, char *, char *);
int /*<<< orphan*/ strlcpy(char *, char *, int /*<<< orphan*/);
int pragma(char *buffer, int *lineNo, char *file) {
  char *p, nextc;
  if (buffer[1] == ' ') {
    *lineNo = atoi(gettok(buffer, "# \t\n", &nextc)) - 1;
    if ((p = gettok(NULL, " \t\n", &nextc)) != NULL) {
      (void)strlcpy(file, p, PATH_MAX);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<pragma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
jne    11b9 <pragma+0x89>
mov    -0x8(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    -0x21(%rbp),%rdx
call   1050 <gettok@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe7a(%rip),%rsi
lea    -0x21(%rbp),%rdx
call   1050 <gettok@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     11b4 <pragma+0x84>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2e43(%rip),%rax
mov    (%rax),%edx
call   1030 <strlcpy@plt>
jmp    11b9 <pragma+0x89>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pragma>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
cmpb   $0x20,0x1(%rdi)
jne    1190 <pragma+0x60>
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xeb4(%rip),%rsi
lea    0xf(%rsp),%r15
mov    %r15,%rdx
call   1050 <gettok@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
add    $0xffffffff,%eax
mov    %eax,(%rbx)
lea    0xe94(%rip),%rsi
xor    %edi,%edi
mov    %r15,%rdx
call   1050 <gettok@plt>
test   %rax,%rax
je     1190 <pragma+0x60>
mov    0x2e6d(%rip),%rcx
mov    (%rcx),%edx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strlcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"# \09\0A\00"
@.str.1 = [4 x i8] c" \09\0A\00"
@PATH_MAX = global i32 0
define i32 @pragma(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 32
br i1 %13, label %14, label %28
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = call i8* @gettok(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%17 = call i32 @atoi(i8* %16)
%18 = sub nsw i32 %17, 1
%19 = load i32*, i32** %5
store i32 %18, i32* %19
%20 = call i8* @gettok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
store i8* %20, i8** %7
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %14
%23 = load i8*, i8** %6
%24 = load i8*, i8** %7
%25 = load i32, i32* @PATH_MAX
%26 = call i32 @strlcpy(i8* %23, i8* %24, i32 %25)
br label %27
27: ; preds = %22, %14
br label %28
28: ; preds = %27, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"# \09\0A\00"
@.str.1 = [4 x i8] c" \09\0A\00"
@PATH_MAX = global i32 0
define i32 @pragma(i8* %0, i32* nocapture writeonly %1, i8* %2) {
%4 = alloca i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %17
8: ; preds = %3
%9 = call i8* @gettok(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @atoi(i8* %9)
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = call i8* @gettok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = load i32, i32* @PATH_MAX
%16 = call i32 @strlcpy(i8* %2, i8* %12, i32 %15)
br label %17
17: ; preds = %8, %14, %3
ret i32 0
}