#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*/ check(int, int, int);
int /*<<< orphan*/ printf(char *);
int output(int first, int second, int end) {
  int i;
  i = 1;
  while (i < end) {
    check(i, first, second);
    printf(" ");
    i++;
  }
  check(i, first, second);
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <output+0x4c>
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <check@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <output+0x18>
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <check@plt>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
mov    $0x1,%edi
cmp    $0x2,%edx
jl     1160 <output+0x40>
mov    %edx,%ebx
mov    $0x1,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <check@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <output+0x20>
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <check@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @output(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %7
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @check(i32 %13, i32 %14, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %8
20: ; preds = %8
%21 = load i32, i32* %7
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @check(i32 %21, i32 %22, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @output(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 1, %3 ]
%7 = tail call i32 @check(i32 %6, i32 %0, i32 %1)
%8 = tail call i32 @putchar(i32 32)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
%12 = phi i32 [ 1, %3 ], [ %2, %5 ]
%13 = tail call i32 @check(i32 %12, i32 %0, i32 %1)
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}