#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 BUFSIZ;
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
void line_skip(FILE *stream, int nlines) {
  int n;
  char buffer[BUFSIZ];
  for (n = 0; n < nlines; n++)
    fgets(buffer, BUFSIZ, stream);
  return;
}


x86 assembly (clang, -O0):
<line_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1182 <line_skip+0x72>
mov    -0x28(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1030 <fgets@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <line_skip+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_skip>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebx
mov    0x2ebc(%rip),%r12
mov    (%r12),%esi
mov    %rsp,%r15
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
test   %ebx,%ebx
jle    1174 <line_skip+0x64>
mov    %rdi,%r14
mov    %r15,%rdi
mov    %r14,%rdx
call   1030 <fgets@plt>
cmp    $0x1,%ebx
je     1174 <line_skip+0x64>
add    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r12),%esi
mov    %r15,%rdi
mov    %r14,%rdx
call   1030 <fgets@plt>
add    $0xffffffff,%ebx
jne    1160 <line_skip+0x50>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
define void @line_skip(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = load i32, i32* @BUFSIZ
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
store i32 0, i32* %5
br label %12
12: ; preds = %20, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* @BUFSIZ
%18 = load i32*, i32** %3
%19 = call i32 @fgets(i8* %11, i32 %17, i32* %18)
br label %20
20: ; preds = %16
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %12
23: ; preds = %12
%24 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define void @line_skip(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = call i32 @fgets(i8* %5, i32 %3, i32* %0)
%9 = icmp eq i32 %1, 1
br i1 %9, label %16, label %10
10: ; preds = %7, %10
%11 = phi i32 [ %14, %10 ], [ 1, %7 ]
%12 = load i32, i32* @BUFSIZ
%13 = call i32 @fgets(i8* %5, i32 %12, i32* %0)
%14 = add nuw nsw i32 %11, 1
%15 = icmp eq i32 %14, %1
br i1 %15, label %16, label %10
16: ; preds = %10, %7, %2
ret void
}