#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 */

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char buffer[1024];
  int lines2skip;
  int line = 0;
  if (argc != 2) {
    fprintf(stderr, "Usage: %s lines2skip\n", argv[0]);
    exit(1);
  }
  lines2skip = atoi(argv[1]);
  while (get_line(buffer, stdin)) {
    if (line++ >= lines2skip)
      printf("%s\n", buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x418(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11a3 <main+0x53>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe6c(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2e24(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     120a <main+0xba>
mov    -0x418(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x418(%rbp)
cmp    -0x414(%rbp),%eax
jl     1205 <main+0xb5>
lea    -0x410(%rbp),%rsi
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
jmp    11b6 <main+0x66>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
cmp    $0x2,%edi
jne    11d7 <main+0x87>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    0x2e72(%rip),%r12
mov    (%r12),%esi
mov    %rsp,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
je     11c5 <main+0x75>
xor    %ebp,%ebp
mov    %rsp,%r14
lea    0xe83(%rip),%r15
jmp    11b4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r12),%esi
mov    %r14,%rdi
call   1030 <get_line@plt>
add    $0x1,%ebp
test   %rax,%rax
je     11c5 <main+0x75>
cmp    %ebx,%ebp
jl     11a0 <main+0x50>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
jmp    11a0 <main+0x50>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe16(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s lines2skip\0A\00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %7
br label %23
23: ; preds = %36, %18
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%25 = load i32, i32* @stdin
%26 = call i64 @get_line(i8* %24, i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %37
28: ; preds = %23
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
%31 = load i32, i32* %7
%32 = icmp sge i32 %29, %31
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %33, %28
br label %23
37: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s lines2skip\0A\00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = load i32, i32* @stdin
%16 = call i64 @get_line(i8* %4, i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %11, %24
%19 = phi i32 [ %20, %24 ], [ 0, %11 ]
%20 = add nuw nsw i32 %19, 1
%21 = icmp slt i32 %19, %14
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %24
24: ; preds = %22, %18
%25 = load i32, i32* @stdin
%26 = call i64 @get_line(i8* %4, i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %18
28: ; preds = %24, %11
ret i32 0
}