#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 getc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
char next_char(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skip_ws(FILE *i) {
  int ch;
  while ((ch = getc(i)) != 0) {
    if (isspace(ch)) {
      continue;
    } else if (ch == ';' && (next_char(i) == ':')) {
      ch = getc(i);
      while ((ch = getc(i)) != 0 && (ch != ':' || next_char(i) != ';')) {
      }
      continue;
    } else if (ch == ';' && (next_char(i) != ':')) {
      while ((ch = getc(i)) != 0 && ch != '\n') {
      }
      continue;
    }
    ungetc(ch, i);
    break;
  }
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     127d <skip_ws+0x13d>
mov    -0xc(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1178 <skip_ws+0x38>
jmp    114c <skip_ws+0xc>
cmpl   $0x3b,-0xc(%rbp)
jne    1203 <skip_ws+0xc3>
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
movsbl %al,%eax
cmp    $0x3a,%eax
jne    1203 <skip_ws+0xc3>
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     11e9 <skip_ws+0xa9>
mov    $0x1,%al
cmpl   $0x3a,-0xc(%rbp)
mov    %al,-0xe(%rbp)
jne    11e3 <skip_ws+0xa3>
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
movsbl %al,%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    11f9 <skip_ws+0xb9>
jmp    11fe <skip_ws+0xbe>
jmp    11a3 <skip_ws+0x63>
jmp    114c <skip_ws+0xc>
cmpl   $0x3b,-0xc(%rbp)
jne    1267 <skip_ws+0x127>
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
movsbl %al,%eax
cmp    $0x3a,%eax
je     1267 <skip_ws+0x127>
jmp    1227 <skip_ws+0xe7>
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xf(%rbp)
je     124d <skip_ws+0x10d>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
test   $0x1,%al
jne    125d <skip_ws+0x11d>
jmp    1262 <skip_ws+0x122>
jmp    1227 <skip_ws+0xe7>
jmp    114c <skip_ws+0xc>
jmp    126c <skip_ws+0x12c>
jmp    1271 <skip_ws+0x131>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <getc@plt>
test   %eax,%eax
je     11e6 <skip_ws+0xa6>
mov    %eax,%ebp
jmp    116e <skip_ws+0x2e>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%ebp
test   %eax,%eax
je     11e6 <skip_ws+0xa6>
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1160 <skip_ws+0x20>
cmp    $0x3b,%ebp
jne    11ed <skip_ws+0xad>
mov    %rbx,%rdi
call   1030 <next_char@plt>
mov    %rbx,%rdi
cmp    $0x3a,%al
jne    11bf <skip_ws+0x7f>
call   1060 <getc@plt>
jmp    11ac <skip_ws+0x6c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <next_char@plt>
cmp    $0x3b,%al
je     1160 <skip_ws+0x20>
mov    %rbx,%rdi
call   1060 <getc@plt>
cmp    $0x3a,%eax
je     11a0 <skip_ws+0x60>
test   %eax,%eax
jne    11ac <skip_ws+0x6c>
jmp    1160 <skip_ws+0x20>
call   1030 <next_char@plt>
cmp    $0x3a,%al
je     11ed <skip_ws+0xad>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <getc@plt>
test   %eax,%eax
je     1160 <skip_ws+0x20>
cmp    $0xa,%eax
jne    11d0 <skip_ws+0x90>
jmp    1160 <skip_ws+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ungetc@plt>

LLVM IR (-O0):
define void @skip_ws(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %61, %41, %12, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %68
8: ; preds = %4
%9 = load i32, i32* %3
%10 = call i64 @isspace(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %4
13: ; preds = %8
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 59
br i1 %15, label %16, label %42
16: ; preds = %13
%17 = load i32*, i32** %2
%18 = call signext i8 @next_char(i32* %17)
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 58
br i1 %20, label %21, label %42
21: ; preds = %16
%22 = load i32*, i32** %2
%23 = call i32 @getc(i32* %22)
store i32 %23, i32* %3
br label %24
24: ; preds = %40, %21
%25 = load i32*, i32** %2
%26 = call i32 @getc(i32* %25)
store i32 %26, i32* %3
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = load i32, i32* %3
%30 = icmp ne i32 %29, 58
br i1 %30, label %36, label %31
31: ; preds = %28
%32 = load i32*, i32** %2
%33 = call signext i8 @next_char(i32* %32)
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 59
br label %36
36: ; preds = %31, %28
%37 = phi i1 [ true, %28 ], [ %35, %31 ]
br label %38
38: ; preds = %36, %24
%39 = phi i1 [ false, %24 ], [ %37, %36 ]
br i1 %39, label %40, label %41
40: ; preds = %38
br label %24
41: ; preds = %38
br label %4
42: ; preds = %16, %13
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 59
br i1 %44, label %45, label %62
45: ; preds = %42
%46 = load i32*, i32** %2
%47 = call signext i8 @next_char(i32* %46)
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 58
br i1 %49, label %50, label %62
50: ; preds = %45
br label %51
51: ; preds = %60, %50
%52 = load i32*, i32** %2
%53 = call i32 @getc(i32* %52)
store i32 %53, i32* %3
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = load i32, i32* %3
%57 = icmp ne i32 %56, 10
br label %58
58: ; preds = %55, %51
%59 = phi i1 [ false, %51 ], [ %57, %55 ]
br i1 %59, label %60, label %61
60: ; preds = %58
br label %51
61: ; preds = %58
br label %4
62: ; preds = %45, %42
br label %63
63: ; preds = %62
br label %64
64: ; preds = %63
%65 = load i32, i32* %3
%66 = load i32*, i32** %2
%67 = call i32 @ungetc(i32 %65, i32* %66)
br label %68
68: ; preds = %64, %4
ret void
}

LLVM IR (-O2):
define void @skip_ws(i32* %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %31, label %4
4: ; preds = %1, %21
%5 = phi i32 [ %22, %21 ], [ %2, %1 ]
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = icmp eq i32 %5, 59
br i1 %9, label %10, label %29
10: ; preds = %8
%11 = tail call signext i8 @next_char(i32* %0)
%12 = icmp eq i8 %11, 58
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = tail call i32 @getc(i32* %0)
br label %15
15: ; preds = %17, %13
%16 = tail call i32 @getc(i32* %0)
switch i32 %16, label %17 [
i32 0, label %21
i32 58, label %18
]
17: ; preds = %15, %18
br label %15
18: ; preds = %15
%19 = tail call signext i8 @next_char(i32* %0)
%20 = icmp eq i8 %19, 59
br i1 %20, label %21, label %17
21: ; preds = %27, %27, %18, %15, %4
%22 = tail call i32 @getc(i32* %0)
%23 = icmp eq i32 %22, 0
br i1 %23, label %31, label %4
24: ; preds = %10
%25 = tail call signext i8 @next_char(i32* %0)
%26 = icmp eq i8 %25, 58
br i1 %26, label %29, label %27
27: ; preds = %24, %27
%28 = tail call i32 @getc(i32* %0)
switch i32 %28, label %27 [
i32 10, label %21
i32 0, label %21
]
29: ; preds = %8, %24
%30 = tail call i32 @ungetc(i32 %5, i32* %0)
br label %31
31: ; preds = %21, %1, %29
ret void
}