#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void fus_bigint_core_fprintf(FILE *file, int i_len, int *i) {
  fprintf(file, "[");
  if (i_len >= 1) {
    fprintf(file, "%i", i[i_len - 1]);
  }
  for (int j = i_len - 2; j >= 0; j--) {
    fprintf(file, " %i", i[j]);
  }
  fprintf(file, "]");
}


x86 assembly (clang, -O0):
<fus_bigint_core_fprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x1,-0xc(%rbp)
jl     1161 <fus_bigint_core_fprintf+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     119f <fus_bigint_core_fprintf+0x8f>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    116a <fus_bigint_core_fprintf+0x5a>
mov    -0x8(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fus_bigint_core_fprintf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
mov    $0x5b,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
test   %ebx,%ebx
jle    1187 <fus_bigint_core_fprintf+0x67>
lea    -0x1(%rbx),%eax
mov    (%r14,%rax,4),%edx
lea    0xeb2(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    $0x1,%ebx
je     1187 <fus_bigint_core_fprintf+0x67>
add    $0xfffffffe,%ebx
lea    0xe98(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xffffffffffffffff,%rbx
jb     1170 <fus_bigint_core_fprintf+0x50>
mov    $0x5d,%edi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [4 x i8] c" %i\00"
@.str.3 = [2 x i8] c"]\00"
define void @fus_bigint_core_fprintf(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
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 1
br i1 %11, label %12, label %21
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32*, i32** %6
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = load i32, i32* %18
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %12, %3
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 2
store i32 %23, i32* %7
br label %24
24: ; preds = %35, %21
%25 = load i32, i32* %7
%26 = icmp sge i32 %25, 0
br i1 %26, label %27, label %38
27: ; preds = %24
%28 = load i32*, i32** %4
%29 = load i32*, i32** %6
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
%33 = load i32, i32* %32
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %27
%36 = load i32, i32* %7
%37 = add nsw i32 %36, -1
store i32 %37, i32* %7
br label %24
38: ; preds = %24
%39 = load i32*, i32** %4
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [4 x i8] c" %i\00"
define void @fus_bigint_core_fprintf(i32* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fputc(i32 91, i32* %0)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = add nsw i32 %1, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %1, 1
br i1 %12, label %16, label %13
13: ; preds = %6
%14 = add nsw i32 %1, -2
%15 = zext i32 %14 to i64
br label %18
16: ; preds = %18, %3, %6
%17 = tail call i32 @fputc(i32 93, i32* %0)
ret void
18: ; preds = %13, %18
%19 = phi i64 [ %15, %13 ], [ %23, %18 ]
%20 = getelementptr inbounds i32, i32* %2, i64 %19
%21 = load i32, i32* %20
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = add nsw i64 %19, -1
%24 = icmp eq i64 %19, 0
br i1 %24, label %16, label %18
}