#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 /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void SeekComments(FILE *f) {
  char tempArray[256];
  char c;
  while (!feof(f)) {
    if (fgets(tempArray, 256, f) != NULL) {
      int found = 0;
      int i = 1;
      int size = strlen(tempArray);
      while (i < size) {
        if (tempArray[i - 1] == '/' && tempArray[i] == '/') {
          found = 1;
          break;
        }
        i++;
      }
      if (found) {
        for (int j = i - 1; j < size - 1; j++) {
          printf("%c", tempArray[j]);
        }
        printf("\\n\n");
      }
    }
  }
}


x86 assembly (clang, -O0):
<SeekComments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116d <SeekComments+0x2d>
jmp    1297 <SeekComments+0x157>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1292 <SeekComments+0x152>
movl   $0x0,-0x118(%rbp)
movl   $0x1,-0x11c(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x120(%rbp)
mov    -0x11c(%rbp),%eax
cmp    -0x120(%rbp),%eax
jge    121b <SeekComments+0xdb>
mov    -0x11c(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x2f,%eax
jne    1207 <SeekComments+0xc7>
movslq -0x11c(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x2f,%eax
jne    1207 <SeekComments+0xc7>
movl   $0x1,-0x118(%rbp)
jmp    121b <SeekComments+0xdb>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    11b2 <SeekComments+0x72>
cmpl   $0x0,-0x118(%rbp)
je     128d <SeekComments+0x14d>
mov    -0x11c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x124(%rbp)
mov    -0x124(%rbp),%eax
mov    -0x120(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    127f <SeekComments+0x13f>
movslq -0x124(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%esi
ff
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1237 <SeekComments+0xf7>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1292 <SeekComments+0x152>
jmp    114f <SeekComments+0xf>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeekComments>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r12
call   1070 <feof@plt>
test   %eax,%eax
je     117d <SeekComments+0x2d>
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    %rsp,%r14
lea    0xe79(%rip),%r15
jmp    11ac <SeekComments+0x5c>
mov    %r15,%rdi
call   1040 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    116c <SeekComments+0x1c>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     11a0 <SeekComments+0x50>
mov    %r14,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jl     11a0 <SeekComments+0x50>
mov    %eax,%ecx
mov    $0x1,%ebx
jmp    11e9 <SeekComments+0x99>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%rcx
je     11a0 <SeekComments+0x50>
cmpb   $0x2f,-0x1(%rsp,%rbx,1)
jne    11e0 <SeekComments+0x90>
cmpb   $0x2f,(%rsp,%rbx,1)
jne    11e0 <SeekComments+0x90>
cmp    %ebx,%eax
jle    1189 <SeekComments+0x39>
add    $0xffffffff,%eax
movslq %eax,%r13
mov    $0x2f,%edi
call   1030 <putchar@plt>
cmp    %r13,%rbx
jge    1189 <SeekComments+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r13,%rbx
jl     1220 <SeekComments+0xd0>
jmp    1189 <SeekComments+0x39>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\\n\0A\00"
define void @SeekComments(i32* %0) {
%2 = alloca i32*
%3 = alloca [256 x i8]
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %2
br label %9
9: ; preds = %69, %1
%10 = load i32*, i32** %2
%11 = call i32 @feof(i32* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %70
14: ; preds = %9
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%16 = load i32*, i32** %2
%17 = call i32* @fgets(i8* %15, i32 256, i32* %16)
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %69
19: ; preds = %14
store i32 0, i32* %5
store i32 1, i32* %6
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%21 = call i32 @strlen(i8* %20)
store i32 %21, i32* %7
br label %22
22: ; preds = %42, %19
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %45
26: ; preds = %22
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 47
br i1 %33, label %34, label %42
34: ; preds = %26
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 47
br i1 %40, label %41, label %42
41: ; preds = %34
store i32 1, i32* %5
br label %45
42: ; preds = %34, %26
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %22
45: ; preds = %41, %22
%46 = load i32, i32* %5
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %68
48: ; preds = %45
%49 = load i32, i32* %6
%50 = sub nsw i32 %49, 1
store i32 %50, i32* %8
br label %51
51: ; preds = %63, %48
%52 = load i32, i32* %8
%53 = load i32, i32* %7
%54 = sub nsw i32 %53, 1
%55 = icmp slt i32 %52, %54
br i1 %55, label %56, label %66
56: ; preds = %51
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %56
%64 = load i32, i32* %8
%65 = add nsw i32 %64, 1
store i32 %65, i32* %8
br label %51
66: ; preds = %51
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %68
68: ; preds = %66, %45
br label %69
69: ; preds = %68, %14
br label %9
70: ; preds = %9
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"\\n\00"
define void @SeekComments(i32* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @feof(i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %48
6: ; preds = %1, %45
%7 = call i32* @fgets(i8* %3, i32 256, i32* %0)
%8 = icmp eq i32* %7, null
br i1 %8, label %45, label %9
9: ; preds = %6
%10 = call i32 @strlen(i8* %3)
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %45
12: ; preds = %9
%13 = zext i32 %10 to i64
br label %14
14: ; preds = %12, %32
%15 = phi i64 [ 1, %12 ], [ %33, %32 ]
%16 = add nsw i64 %15, -1
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 47
br i1 %19, label %20, label %32
20: ; preds = %14
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %15
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 47
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = trunc i64 %15 to i32
%26 = icmp sgt i32 %10, %25
br i1 %26, label %27, label %35
27: ; preds = %24
%28 = add nsw i32 %10, -1
%29 = sext i32 %28 to i64
%30 = call i32 @putchar(i32 47)
%31 = icmp slt i64 %15, %29
br i1 %31, label %37, label %35
32: ; preds = %20, %14
%33 = add nuw nsw i64 %15, 1
%34 = icmp eq i64 %33, %13
br i1 %34, label %45, label %14
35: ; preds = %37, %27, %24
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %45
37: ; preds = %27, %37
%38 = phi i64 [ %43, %37 ], [ %15, %27 ]
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 @putchar(i32 %41)
%43 = add nuw nsw i64 %38, 1
%44 = icmp slt i64 %43, %29
br i1 %44, label %37, label %35
45: ; preds = %32, %9, %35, %6
%46 = call i32 @feof(i32* %0)
%47 = icmp eq i32 %46, 0
br i1 %47, label %6, label %48
48: ; preds = %45, %1
ret void
}