#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printCompositeId(int /*<<< orphan*/, unsigned long,
                                    unsigned long, unsigned long);
int /*<<< orphan*/ stdout;
void printIndex(char *indexName, char *typeName, unsigned long parentId,
                unsigned long userId, unsigned long collectionId) {
  fprintf(stdout, "{\"index\":{\"_index\":\"%s\",\"_type\":\"%s\",\"_id\":\"",
          indexName, typeName);
  printCompositeId(stdout, parentId, userId, collectionId);
  fprintf(stdout, "\",\"_parent\":\"%lu\"}}\n", parentId);
}


x86 assembly (clang, -O0):
<printIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <printCompositeId@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIndex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ea2(%rip),%r12
mov    (%r12),%edi
lea    0xeb7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <printCompositeId@plt>
mov    (%r12),%edi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [45 x i8] c"{\22index\22:{\22_index\22:\22%s\22,\22_type\22:\22%s\22,\22_id\22:\22\00"
@.str.1 = [21 x i8] c"\22,\22_parent\22:\22%lu\22}}\0A\00"
define void @printIndex(i8* %0, i8* %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32, i32* @stdout
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = load i32, i32* @stdout
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = load i64, i64* %10
%19 = call i32 @printCompositeId(i32 %15, i64 %16, i64 %17, i64 %18)
%20 = load i32, i32* @stdout
%21 = load i64, i64* %8
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i64 %21)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [45 x i8] c"{\22index\22:{\22_index\22:\22%s\22,\22_type\22:\22%s\22,\22_id\22:\22\00"
@.str.1 = [21 x i8] c"\22,\22_parent\22:\22%lu\22}}\0A\00"
define void @printIndex(i8* %0, i8* %1, i64 %2, i64 %3, i64 %4) {
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%8 = load i32, i32* @stdout
%9 = tail call i32 @printCompositeId(i32 %8, i64 %2, i64 %3, i64 %4)
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i64 %2)
ret void
}