#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 Pcap_finish_time();
int Pcap_start_time();
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void start_array(void *pr_data, const char *name) {
  FILE *fp = pr_data;
  assert(fp);
  fprintf(fp, "<array");
  fprintf(fp, " name=\"%s\"", name);
  fprintf(fp, " dimensions=\"%d\"", 2);
  fprintf(fp, " start_time=\"%d\"", Pcap_start_time());
  fprintf(fp, " stop_time=\"%d\"", Pcap_finish_time());
  fprintf(fp, ">\n");
}


x86 assembly (clang, -O0):
<start_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <Pcap_start_time@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <Pcap_finish_time@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
lea    0xe55(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe53(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_array>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
lea    0xe9a(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <Pcap_start_time@plt>
lea    0xe73(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1060 <Pcap_finish_time@plt>
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe67(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"<array\00"
@.str.1 = [11 x i8] c" name=\22%s\22\00"
@.str.2 = [17 x i8] c" dimensions=\22%d\22\00"
@.str.3 = [17 x i8] c" start_time=\22%d\22\00"
@.str.4 = [16 x i8] c" stop_time=\22%d\22\00"
@.str.5 = [3 x i8] c">\0A\00"
define void @start_array(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @assert(i32* %8)
%10 = load i32*, i32** %5
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = load i32*, i32** %5
%13 = load i8*, i8** %4
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %5
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 2)
%17 = load i32*, i32** %5
%18 = call i32 (...) @Pcap_start_time()
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = load i32*, i32** %5
%21 = call i32 (...) @Pcap_finish_time()
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load i32*, i32** %5
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<array\00"
@.str.1 = [11 x i8] c" name=\22%s\22\00"
@.str.2 = [17 x i8] c" dimensions=\22%d\22\00"
@.str.3 = [17 x i8] c" start_time=\22%d\22\00"
@.str.4 = [16 x i8] c" stop_time=\22%d\22\00"
@.str.5 = [3 x i8] c">\0A\00"
define void @start_array(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @assert(i32* %3)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 6, i64 1, i32* %3)
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 2)
%8 = tail call i32 (...) @Pcap_start_time()
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @Pcap_finish_time()
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %3)
ret void
}