#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 setup_pointer_array(FILE *f, int size) {
  int i;
  for (i = 0; i < size; i++) {
    fprintf(f, "\"\\x50\" //push eax\n");
  }
  fprintf(f, "\"\\x53\" //push ebx\n\"\\x89\\xe1\" //mov ecx, esp\n");
}


x86 assembly (clang, -O0):
<setup_pointer_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <setup_pointer_array+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <setup_pointer_array+0x16>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_pointer_array>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    114a <setup_pointer_array+0x3a>
mov    %esi,%ebp
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebp
jne    1130 <setup_pointer_array+0x20>
lea    0xec2(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\22\\x50\22 //push eax\0A\00"
@.str.1 = [45 x i8] c"\22\\x53\22 //push ebx\0A\22\\x89\\xe1\22 //mov ecx, esp\0A\00"
define void @setup_pointer_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
%17 = load i32*, i32** %3
%18 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\22\\x50\22 //push eax\0A\00"
@.str.1 = [45 x i8] c"\22\\x53\22 //push ebx\0A\22\\x89\\xe1\22 //mov ecx, esp\0A\00"
define void @setup_pointer_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 18, i64 1, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i64 44, i64 1, i32* %0)
ret void
}