#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void print_vector(int *vector, int size) {
  int i = 0;
  char *separator = "";
  for (i = 0; i < size; i++) {
    printf("%s%d", separator, vector[i]);
    separator = ", ";
  }
  printf(".");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118a <print_vector+0x6a>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <print_vector+0x28>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vector>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    119a <print_vector+0x6a>
mov    %esi,%ebp
mov    %rdi,%r12
mov    (%rdi),%edx
lea    0xeb6(%rip),%rdi
lea    0xeb6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
je     119a <print_vector+0x6a>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0xe95(%rip),%r14
lea    0xe93(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%rbx,4),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1180 <print_vector+0x50>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fflush@plt>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"%s%d\00"
@.str.2 = [3 x i8] c", \00"
@stdout = global i32 0
define void @print_vector(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i32 %1, 1
br i1 %8, label %16, label %9
9: ; preds = %4, %9
%10 = phi i64 [ %14, %9 ], [ 1, %4 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %9
16: ; preds = %9, %4, %2
%17 = tail call i32 @putchar(i32 46)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
ret void
}