#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *malloc(size_t);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
size_t strtoul(char *, int /*<<< orphan*/, int);
int main(int ac, char *av[]) {
  if (ac != 4) {
    fprintf(stderr, "usage : %s start num_line width\n", av[0]);
    return 1;
  }
  size_t start = strtoul(av[1], 0, 10);
  size_t num_line = strtoul(av[2], 0, 10);
  size_t width = strtoul(av[3], 0, 10);
  char *s = malloc(width + 1);
  if (!s)
    return 1;
  for (size_t i = 0; i < width; ++i) {
    s[i] = 'x';
  }
  s[width] = '\0';
  for (size_t l = start; l < start + num_line; ++l) {
    fprintf(stdout, "%lu %.*s\n", l, width, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     117a <main+0x4a>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1281 <main+0x151>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11ea <main+0xba>
movl   $0x1,-0x4(%rbp)
jmp    1281 <main+0x151>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    121d <main+0xed>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11f2 <main+0xc2>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    -0x20(%rbp),%rcx
cmp    %rcx,%rax
jae    127a <main+0x14a>
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1231 <main+0x101>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
cmp    $0x4,%edi
jne    11f8 <main+0xb8>
mov    0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
mov    %rax,%r14
mov    0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1213 <main+0xd3>
mov    %rax,%r12
test   %r15,%r15
je     11b6 <main+0x76>
mov    %r12,%rdi
mov    $0x78,%esi
mov    %r15,%rdx
call   1030 <memset@plt>
movb   $0x0,(%r12,%r15,1)
lea    (%r14,%rbx,1),%rax
xor    %ebp,%ebp
cmp    %rax,%rbx
jae    1218 <main+0xd8>
lea    0xe54(%rip),%r13
xor    %ebp,%ebp
nop
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r12,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
jne    11d0 <main+0x90>
jmp    1218 <main+0xd8>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage : %s start num_line width\0A\00"
@stdout = global i32 0
@.str.1 = [10 x i8] c"%lu %.*s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 4
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 1, i32* %3
br label %72
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @strtoul(i8* %23, i32 0, i32 10)
store i64 %24, i64* %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i64 @strtoul(i8* %27, i32 0, i32 10)
store i64 %28, i64* %7
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call i64 @strtoul(i8* %31, i32 0, i32 10)
store i64 %32, i64* %8
%33 = load i64, i64* %8
%34 = add i64 %33, 1
%35 = call i8* @malloc(i64 %34)
store i8* %35, i8** %9
%36 = load i8*, i8** %9
%37 = icmp ne i8* %36, null
br i1 %37, label %39, label %38
38: ; preds = %20
store i32 1, i32* %3
br label %72
39: ; preds = %20
store i64 0, i64* %10
br label %40
40: ; preds = %48, %39
%41 = load i64, i64* %10
%42 = load i64, i64* %8
%43 = icmp ult i64 %41, %42
br i1 %43, label %44, label %51
44: ; preds = %40
%45 = load i8*, i8** %9
%46 = load i64, i64* %10
%47 = getelementptr inbounds i8, i8* %45, i64 %46
store i8 120, i8* %47
br label %48
48: ; preds = %44
%49 = load i64, i64* %10
%50 = add i64 %49, 1
store i64 %50, i64* %10
br label %40
51: ; preds = %40
%52 = load i8*, i8** %9
%53 = load i64, i64* %8
%54 = getelementptr inbounds i8, i8* %52, i64 %53
store i8 0, i8* %54
%55 = load i64, i64* %6
store i64 %55, i64* %11
br label %56
56: ; preds = %68, %51
%57 = load i64, i64* %11
%58 = load i64, i64* %6
%59 = load i64, i64* %7
%60 = add i64 %58, %59
%61 = icmp ult i64 %57, %60
br i1 %61, label %62, label %71
62: ; preds = %56
%63 = load i32, i32* @stdout
%64 = load i64, i64* %11
%65 = load i64, i64* %8
%66 = load i8*, i8** %9
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %64, i64 %65, i8* %66)
br label %68
68: ; preds = %62
%69 = load i64, i64* %11
%70 = add i64 %69, 1
store i64 %70, i64* %11
br label %56
71: ; preds = %56
store i32 0, i32* %3
br label %72
72: ; preds = %71, %38, %14
%73 = load i32, i32* %3
ret i32 %73
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage : %s start num_line width\0A\00"
@stdout = global i32 0
@.str.1 = [10 x i8] c"%lu %.*s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %34
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strtoul(i8* %10, i32 0, i32 10)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i64 @strtoul(i8* %13, i32 0, i32 10)
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i64 @strtoul(i8* %16, i32 0, i32 10)
%18 = add i64 %17, 1
%19 = tail call i8* @malloc(i64 %18)
%20 = icmp eq i8* %19, null
br i1 %20, label %34, label %21
21: ; preds = %8
%22 = icmp eq i64 %17, 0
br i1 %22, label %24, label %23
23: ; preds = %21
br label %24
24: ; preds = %23, %21
%25 = getelementptr inbounds i8, i8* %19, i64 %17
store i8 0, i8* %25
%26 = add i64 %14, %11
%27 = icmp ult i64 %11, %26
br i1 %27, label %28, label %34
28: ; preds = %24, %28
%29 = phi i64 [ %32, %28 ], [ %11, %24 ]
%30 = load i32, i32* @stdout
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %29, i64 %17, i8* %19)
%32 = add i64 %29, 1
%33 = icmp eq i64 %32, %26
br i1 %33, label %34, label %28
34: ; preds = %28, %24, %8, %4
%35 = phi i32 [ 1, %4 ], [ 1, %8 ], [ 0, %24 ], [ 0, %28 ]
ret i32 %35
}