#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*/ printf(char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    printf("chickens");
    for (int j = 0; j < argc; j++) {
      printf("turkeys");
    }
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1185 <main+0x75>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x62>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <main+0x3c>
jmp    1177 <main+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    1156 <main+0x46>
mov    %edi,%r15d
xor    %r12d,%r12d
lea    0xed7(%rip),%r14
lea    0xed9(%rip),%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15d,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1140 <main+0x30>
add    $0x1,%r12d
cmp    %r15d,%r12d
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"chickens\00"
@.str.1 = [8 x i8] c"turkeys\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
store i32 0, i32* %6
br label %8
8: ; preds = %24, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %14
14: ; preds = %20, %12
%15 = load i32, i32* %7
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %14
23: ; preds = %14
br label %24
24: ; preds = %23
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %8
27: ; preds = %8
ret i32 0
}

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