#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);
int /*<<< orphan*/ stdout;
void print_array(int *array) {
  int x;
  for (x = 0; x < 20; x++) {
    if (x != 20 - 1)
      fprintf(stdout, "%d, ", array[x]);
    else
      fprintf(stdout, "%d\n", array[x]);
  }
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    118f <print_array+0x7f>
cmpl   $0x13,-0xc(%rbp)
je     115c <print_array+0x4c>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
jmp    117c <print_array+0x6c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1181 <print_array+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_array+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r15
mov    (%r15),%edi
mov    (%rbx),%edx
lea    0xed5(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x4(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x8(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0xc(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x10(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x14(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x18(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x1c(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x20(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x24(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x28(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x2c(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x30(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x34(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x38(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x3c(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x40(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x44(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x48(%rbx),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x4c(%rbx),%edx
lea    0xdc9(%rip),%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%d, \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @print_array(i32* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = load i32, i32* %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdout
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = getelementptr inbounds i32, i32* %0, i64 4
%19 = load i32, i32* %18
%20 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stdout
%22 = getelementptr inbounds i32, i32* %0, i64 5
%23 = load i32, i32* %22
%24 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @stdout
%26 = getelementptr inbounds i32, i32* %0, i64 6
%27 = load i32, i32* %26
%28 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @stdout
%30 = getelementptr inbounds i32, i32* %0, i64 7
%31 = load i32, i32* %30
%32 = tail call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load i32, i32* @stdout
%34 = getelementptr inbounds i32, i32* %0, i64 8
%35 = load i32, i32* %34
%36 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = load i32, i32* @stdout
%38 = getelementptr inbounds i32, i32* %0, i64 9
%39 = load i32, i32* %38
%40 = tail call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @stdout
%42 = getelementptr inbounds i32, i32* %0, i64 10
%43 = load i32, i32* %42
%44 = tail call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = load i32, i32* @stdout
%46 = getelementptr inbounds i32, i32* %0, i64 11
%47 = load i32, i32* %46
%48 = tail call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = load i32, i32* @stdout
%50 = getelementptr inbounds i32, i32* %0, i64 12
%51 = load i32, i32* %50
%52 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = load i32, i32* @stdout
%54 = getelementptr inbounds i32, i32* %0, i64 13
%55 = load i32, i32* %54
%56 = tail call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %55)
%57 = load i32, i32* @stdout
%58 = getelementptr inbounds i32, i32* %0, i64 14
%59 = load i32, i32* %58
%60 = tail call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = load i32, i32* @stdout
%62 = getelementptr inbounds i32, i32* %0, i64 15
%63 = load i32, i32* %62
%64 = tail call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = load i32, i32* @stdout
%66 = getelementptr inbounds i32, i32* %0, i64 16
%67 = load i32, i32* %66
%68 = tail call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %67)
%69 = load i32, i32* @stdout
%70 = getelementptr inbounds i32, i32* %0, i64 17
%71 = load i32, i32* %70
%72 = tail call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %71)
%73 = load i32, i32* @stdout
%74 = getelementptr inbounds i32, i32* %0, i64 18
%75 = load i32, i32* %74
%76 = tail call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %75)
%77 = load i32, i32* @stdout
%78 = getelementptr inbounds i32, i32* %0, i64 19
%79 = load i32, i32* %78
%80 = tail call i32 @fprintf(i32 %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %79)
ret void
}