#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*/ putchar(char);
int main(int c, char **v) {
  int i, t;
  t = atoi(v[1]);
  if (t == 3) {
    for (i = 0; i < 1000000; ++i) {
      putchar('a');
    }
  } else if (t == 2) {
    printf("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
  } else {
    printf("abc");
  }
  return (0);
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jne    1191 <main+0x61>
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
jge    118c <main+0x5c>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <main+0x37>
jmp    11bd <main+0x8d>
cmpl   $0x2,-0x18(%rbp)
jne    11ac <main+0x7c>
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
jmp    11b8 <main+0x88>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
jmp    11bd <main+0x8d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
cmp    $0x2,%eax
je     1161 <main+0x31>
cmp    $0x3,%eax
jne    116a <main+0x3a>
mov    $0xf4240,%ebx
nopl   0x0(%rax)
mov    $0x61,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x20>
jmp    1176 <main+0x46>
lea    0xe98(%rip),%rdi
jmp    1171 <main+0x41>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\00"
@.str.1 = [4 x i8] c"abc\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %24
14: ; preds = %2
store i32 0, i32* %6
br label %15
15: ; preds = %20, %14
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 1000000
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = call i32 @putchar(i8 signext 97)
br label %20
20: ; preds = %18
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %15
23: ; preds = %15
br label %32
24: ; preds = %2
%25 = load i32, i32* %7
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %31
29: ; preds = %24
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
br label %32
32: ; preds = %31, %23
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\00"
@.str.1 = [4 x i8] c"abc\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
switch i32 %5, label %11 [
i32 3, label %6
i32 2, label %12
]
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @putchar(i8 signext 97)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 1000000
br i1 %10, label %15, label %6
11: ; preds = %2
br label %12
12: ; preds = %2, %11
%13 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %11 ], [ getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), %2 ]
%14 = tail call i32 @printf(i8* dereferenceable(1) %13)
br label %15
15: ; preds = %6, %12
ret i32 0
}