#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 fprintf_ints(FILE *s, char *message1, int *ints, int size,
                  char *message2) {
  int i;
  fprintf(s, "%s = ", message1);
  if (ints == NULL && size > 0)
    fprintf(s, "(int *) NULL");
  else {
    fprintf(s, "{ ");
    for (i = 0; i < size; i++)
      fprintf(s, "%d %s", ints[i], (i == size - 1) ? "" : ", ");
    fprintf(s, "}");
  }
  fprintf(s, " %s", message2);
}


x86 assembly (clang, -O0):
<fprintf_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
jne    116d <fprintf_ints+0x5d>
cmpl   $0x0,-0x1c(%rbp)
jle    116d <fprintf_ints+0x5d>
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ef <fprintf_ints+0xdf>
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11dd <fprintf_ints+0xcd>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x2c(%rbp),%esi
mov    -0x1c(%rbp),%r8d
sub    $0x1,%r8d
lea    0xe69(%rip),%rcx
lea    0xe64(%rip),%rax
cmp    %r8d,%esi
cmove  %rax,%rcx
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1186 <fprintf_ints+0x76>
mov    -0x8(%rbp),%rdi
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintf_ints>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %ecx,%r12d
mov    %rdx,%r13
mov    %rsi,%rdx
mov    %rdi,%r15
lea    0xeaf(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %r13,%r13
jne    1180 <fprintf_ints+0x50>
test   %r12d,%r12d
jle    1180 <fprintf_ints+0x50>
lea    0xe9d(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
jmp    1201 <fprintf_ints+0xd1>
mov    %rbx,(%rsp)
lea    0xe88(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
test   %r12d,%r12d
jle    11f0 <fprintf_ints+0xc0>
lea    -0x1(%r12),%ebx
mov    %r12d,%ebp
lea    0xe65(%rip),%r12
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%r13,%r14,4),%edx
cmp    %r14,%rbx
lea    0xe4d(%rip),%rcx
lea    0xe48(%rip),%rax
cmove  %rax,%rcx
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    11c0 <fprintf_ints+0x90>
mov    $0x7d,%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
mov    (%rsp),%rbx
lea    0xe10(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s = \00"
@.str.1 = [13 x i8] c"(int *) NULL\00"
@.str.2 = [3 x i8] c"{ \00"
@.str.3 = [6 x i8] c"%d %s\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [3 x i8] c", \00"
@.str.6 = [2 x i8] c"}\00"
@.str.7 = [4 x i8] c" %s\00"
define void @fprintf_ints(i32* %0, i8* %1, i32* %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i32*, i32** %6
%13 = load i8*, i8** %7
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %8
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %23
17: ; preds = %5
%18 = load i32, i32* %9
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32*, i32** %6
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %50
23: ; preds = %17, %5
%24 = load i32*, i32** %6
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %11
br label %26
26: ; preds = %44, %23
%27 = load i32, i32* %11
%28 = load i32, i32* %9
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %47
30: ; preds = %26
%31 = load i32*, i32** %6
%32 = load i32*, i32** %8
%33 = load i32, i32* %11
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %11
%38 = load i32, i32* %9
%39 = sub nsw i32 %38, 1
%40 = icmp eq i32 %37, %39
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %36, i8* %42)
br label %44
44: ; preds = %30
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %26
47: ; preds = %26
%48 = load i32*, i32** %6
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %50
50: ; preds = %47, %20
%51 = load i32*, i32** %6
%52 = load i8*, i8** %10
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %52)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s = \00"
@.str.1 = [13 x i8] c"(int *) NULL\00"
@.str.2 = [3 x i8] c"{ \00"
@.str.3 = [6 x i8] c"%d %s\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [3 x i8] c", \00"
@.str.7 = [4 x i8] c" %s\00"
define void @fprintf_ints(i32* nocapture %0, i8* %1, i32* %2, i32 %3, i8* %4) {
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = icmp eq i32* %2, null
%8 = icmp sgt i32 %3, 0
%9 = and i1 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 12, i64 1, i32* %0)
br label %29
12: ; preds = %5
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
br i1 %8, label %14, label %27
14: ; preds = %12
%15 = add nsw i32 %3, -1
%16 = zext i32 %15 to i64
%17 = zext i32 %3 to i64
br label %18
18: ; preds = %14, %18
%19 = phi i64 [ 0, %14 ], [ %25, %18 ]
%20 = getelementptr inbounds i32, i32* %2, i64 %19
%21 = load i32, i32* %20
%22 = icmp eq i64 %19, %16
%23 = select i1 %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %21, i8* %23)
%25 = add nuw nsw i64 %19, 1
%26 = icmp eq i64 %25, %17
br i1 %26, label %27, label %18
27: ; preds = %18, %12
%28 = tail call i32 @fputc(i32 125, i32* %0)
br label %29
29: ; preds = %27, %10
%30 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %4)
ret void
}