#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 *, ...);
void output(char ary[1000][1000], int j, int _case) {
  printf("Case #%d: ", _case);
  for (int i = j; i >= 0; i--) {
    printf("%s ", ary[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1171 <output+0x61>
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
imul   $0x3e8,%rax,%rax
add    %rax,%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <output+0x29>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
js     116e <output+0x4e>
mov    %ebp,%eax
imul   $0x3e8,%rax,%rbp
lea    0xebe(%rip),%r14
nopl   (%rax)
lea    (%rbx,%rbp,1),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xfffffffffffffc18,%rbp
cmp    $0xfffffffffffffc18,%rbp
jne    1150 <output+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Case #%d: \00"
@.str.1 = [4 x i8] c"%s \00"
define void @output([1000 x i8]* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = icmp sgt i32 %1, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = zext i32 %1 to i64
br label %10
8: ; preds = %10, %3
%9 = tail call i32 @putchar(i32 10)
ret void
10: ; preds = %6, %10
%11 = phi i64 [ %7, %6 ], [ %14, %10 ]
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %0, i64 %11, i64 0
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = add nsw i64 %11, -1
%15 = icmp eq i64 %11, 0
br i1 %15, label %8, label %10
}