#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*/ printf(char *, ...);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  int i, count;
  if (argc < 3) {
    usage(argv[0]);
  }
  count = atoi(argv[2]);
  printf("Oh how I love thee... let me count the ways.\n");
  for (int i = 0; i < count; i++) {
    printf("%3d %s\n", i + 1, argv[1]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    115c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11b7 <main+0x87>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1181 <main+0x51>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x2,%edi
jg     1158 <main+0x18>
mov    (%r14),%rdi
call   1050 <usage@plt>
mov    0x10(%r14),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
test   %r12d,%r12d
jle    11b3 <main+0x73>
neg    %r12d
mov    $0x1,%ebx
lea    0xe7c(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%r14),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Oh how I love thee... let me count the ways.\0A\00"
@.str.1 = [8 x i8] c"%3d %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @usage(i8* %14)
br label %16
16: ; preds = %11, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %22
22: ; preds = %33, %16
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %36
26: ; preds = %22
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %28, i8* %31)
br label %33
33: ; preds = %26
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %22
36: ; preds = %22
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%3d %s\0A\00"
@str = [45 x i8] c"Oh how I love thee... let me count the ways.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%12 = icmp sgt i32 %10, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = getelementptr inbounds i8*, i8** %1, i64 1
br label %16
15: ; preds = %16, %7
ret i32 0
16: ; preds = %13, %16
%17 = phi i32 [ 0, %13 ], [ %18, %16 ]
%18 = add nuw nsw i32 %17, 1
%19 = load i8*, i8** %14
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %18, i8* %19)
%21 = icmp eq i32 %18, %10
br i1 %21, label %15, label %16
}