#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 uint32_t;

/* Variables and functions */
uint32_t line_sanity_check(char *line) {
  uint32_t i = 0, cnt = 0;
  for (i = 0; i < 256 && line[i] != 0x00; ++i)
    if (line[i] == '#')
      ++cnt;
  return (cnt == 2);
}


x86 assembly (clang, -O0):
<line_sanity_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x100,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jge    1144 <line_sanity_check+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1154 <line_sanity_check+0x54>
jmp    1185 <line_sanity_check+0x85>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    1172 <line_sanity_check+0x72>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1177 <line_sanity_check+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <line_sanity_check+0x1d>
cmpl   $0x2,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_sanity_check>:
xor    %eax,%eax
xor    %ecx,%ecx
jmp    111f <line_sanity_check+0x1f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ecx
add    $0x4,%rax
cmp    $0x100,%rax
je     1181 <line_sanity_check+0x81>
movzbl (%rdi,%rax,1),%edx
cmp    $0x23,%dl
je     1130 <line_sanity_check+0x30>
test   %dl,%dl
jne    1133 <line_sanity_check+0x33>
jmp    1181 <line_sanity_check+0x81>
xchg   %ax,%ax
add    $0x1,%ecx
movzbl 0x1(%rdi,%rax,1),%edx
cmp    $0x23,%dl
je     1150 <line_sanity_check+0x50>
test   %dl,%dl
jne    1153 <line_sanity_check+0x53>
jmp    1181 <line_sanity_check+0x81>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ecx
movzbl 0x2(%rdi,%rax,1),%edx
cmp    $0x23,%dl
je     1170 <line_sanity_check+0x70>
test   %dl,%dl
jne    1173 <line_sanity_check+0x73>
jmp    1181 <line_sanity_check+0x81>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ecx
movzbl 0x3(%rdi,%rax,1),%edx
cmp    $0x23,%dl
je     1110 <line_sanity_check+0x10>
test   %dl,%dl
jne    1113 <line_sanity_check+0x13>
xor    %eax,%eax
cmp    $0x2,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @line_sanity_check(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %30, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %8, %5
%17 = phi i1 [ false, %5 ], [ %15, %8 ]
br i1 %17, label %18, label %33
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 35
br i1 %25, label %26, label %29
26: ; preds = %18
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %29
29: ; preds = %26, %18
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %5
33: ; preds = %16
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 2
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @line_sanity_check(i8* nocapture %0) {
br label %2
2: ; preds = %30, %1
%3 = phi i64 [ 0, %1 ], [ %32, %30 ]
%4 = phi i32 [ 0, %1 ], [ %31, %30 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %34
i8 35, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = or i64 %3, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
switch i8 %13, label %16 [
i8 0, label %34
i8 35, label %14
]
14: ; preds = %9
%15 = add nsw i32 %10, 1
br label %16
16: ; preds = %14, %9
%17 = phi i32 [ %15, %14 ], [ %10, %9 ]
%18 = or i64 %3, 2
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
switch i8 %20, label %23 [
i8 0, label %34
i8 35, label %21
]
21: ; preds = %16
%22 = add nsw i32 %17, 1
br label %23
23: ; preds = %21, %16
%24 = phi i32 [ %22, %21 ], [ %17, %16 ]
%25 = or i64 %3, 3
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = load i8, i8* %26
switch i8 %27, label %30 [
i8 0, label %34
i8 35, label %28
]
28: ; preds = %23
%29 = add nsw i32 %24, 1
br label %30
30: ; preds = %28, %23
%31 = phi i32 [ %29, %28 ], [ %24, %23 ]
%32 = add nuw nsw i64 %3, 4
%33 = icmp eq i64 %32, 256
br i1 %33, label %34, label %2
34: ; preds = %30, %23, %16, %9, %2
%35 = phi i32 [ %4, %2 ], [ %10, %9 ], [ %17, %16 ], [ %24, %23 ], [ %31, %30 ]
%36 = icmp eq i32 %35, 2
%37 = zext i1 %36 to i32
ret i32 %37
}