main(int argc, char **argv) {
  extern symtab[], xeof, *ns, nerror;
  extern fin, fout;
  if (argc > 1) {
    if (argc > 2) {
      if ((fout = creat(argv[2], 0777)) < 0) {
        error('fo');
        return (1);
      }
    }
    if ((fin = open(argv[1], 0)) < 0) {
      error('fi');
      return (1);
    }
  }
  while (!xeof) {
    ns = symtab + 51;
    extdef();
    blkend();
  }
  return (nerror != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11fd <main+0xad>
cmpl   $0x2,-0x8(%rbp)
jle    11bd <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x1ff,%esi
mov    $0x0,%al
call   1070 <creat@plt>
mov    0x2e43(%rip),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
jge    11b8 <main+0x68>
mov    $0x666f,%edi
mov    $0x0,%al
call   1040 <error@plt>
movl   $0x1,-0x4(%rbp)
jmp    125e <main+0x10e>
jmp    11bd <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <open@plt>
mov    0x2e0b(%rip),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
jge    11f8 <main+0xa8>
mov    $0x6669,%edi
mov    $0x0,%al
call   1040 <error@plt>
movl   $0x1,-0x4(%rbp)
jmp    125e <main+0x10e>
jmp    11fd <main+0xad>
jmp    1202 <main+0xb2>
mov    0x2ddf(%rip),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    121e <main+0xce>
jmp    1249 <main+0xf9>
mov    0x2da3(%rip),%rax
mov    0x2d8c(%rip),%rcx
add    $0xcc,%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <extdef@plt>
mov    $0x0,%al
call   1060 <blkend@plt>
jmp    1202 <main+0xb2>
mov    0x2d80(%rip),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1196 <main+0x46>
mov    %rsi,%rbx
je     117c <main+0x2c>
mov    0x10(%rbx),%rdi
mov    $0x1ff,%esi
xor    %eax,%eax
call   1070 <creat@plt>
mov    0x2e62(%rip),%rcx
mov    %eax,(%rcx)
test   %eax,%eax
js     11ef <main+0x9f>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <open@plt>
mov    0x2e50(%rip),%rcx
mov    %eax,(%rcx)
test   %eax,%eax
js     11e8 <main+0x98>
mov    0x2e4b(%rip),%r14
cmpl   $0x0,(%r14)
jne    11d7 <main+0x87>
mov    $0xcc,%ebx
add    0x2e09(%rip),%rbx
mov    0x2e12(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,(%r15)
xor    %eax,%eax
call   1030 <extdef@plt>
xor    %eax,%eax
call   1060 <blkend@plt>
cmpl   $0x0,(%r14)
je     11c0 <main+0x70>
mov    0x2df2(%rip),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
setne  %al
jmp    1200 <main+0xb0>
mov    $0x6669,%edi
jmp    11f4 <main+0xa4>
mov    $0x666f,%edi
xor    %eax,%eax
call   1040 <error@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@fout = external global i32
@fin = external global i32
@xeof = external global i32
@symtab = external global [0 x i32]
@ns = external global i32*
@nerror = external global i32
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %29
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 2
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %14, i32 511)
store i32 %15, i32* @fout
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 26223)
store i32 1, i32* %3
br label %41
19: ; preds = %11
br label %20
20: ; preds = %19, %8
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %23, i32 0)
store i32 %24, i32* @fin
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 26217)
store i32 1, i32* %3
br label %41
28: ; preds = %20
br label %29
29: ; preds = %28, %2
br label %30
30: ; preds = %34, %29
%31 = load i32, i32* @xeof
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
br i1 %33, label %34, label %37
34: ; preds = %30
store i32* getelementptr inbounds ([0 x i32], [0 x i32]* @symtab, i64 0, i64 51), i32** @ns
%35 = call i32 (...) @extdef()
%36 = call i32 (...) @blkend()
br label %30
37: ; preds = %30
%38 = load i32, i32* @nerror
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i32
store i32 %40, i32* %3
br label %41
41: ; preds = %37, %26, %17
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@fout = external global i32
@fin = external global i32
@xeof = external global i32
@symtab = external global [0 x i32]
@ns = external global i32*
@nerror = external global i32
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = icmp eq i32 %0, 2
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %8, i32 511)
store i32 %9, i32* @fout
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 26223)
br label %32
13: ; preds = %6, %4
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %15, i32 0)
store i32 %16, i32* @fin
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 26217)
br label %32
20: ; preds = %13, %2
%21 = load i32, i32* @xeof
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20, %23
store i32* getelementptr inbounds ([0 x i32], [0 x i32]* @symtab, i64 0, i64 51), i32** @ns
%24 = tail call i32 (...) @extdef()
%25 = tail call i32 (...) @blkend()
%26 = load i32, i32* @xeof
%27 = icmp eq i32 %26, 0
br i1 %27, label %23, label %28
28: ; preds = %23, %20
%29 = load i32, i32* @nerror
%30 = icmp ne i32 %29, 0
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %28, %18, %11
%33 = phi i32 [ 1, %11 ], [ 1, %18 ], [ %31, %28 ]
ret i32 %33
}