#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 */
unsigned char get_movl_ebp_op();
int /*<<< orphan*/ write_bytes(char *, unsigned char *, unsigned int,
                               unsigned int *, unsigned char *, int);
int /*<<< orphan*/ write_int(unsigned char *, int);
void output_stack_assign_int(unsigned int depth, int number, unsigned char *buf,
                             unsigned int buf_size,
                             unsigned int *bytes_written) {
  unsigned char bytes[9];
  bytes[0] = get_movl_ebp_op();
  write_int(&bytes[1], depth);
  write_int(&bytes[5], number);
  write_bytes("stack assign int", buf, buf_size, bytes_written, bytes, 9);
}


x86 assembly (clang, -O0):
<output_stack_assign_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0x0,%al
call   1040 <get_movl_ebp_op@plt>
mov    %al,-0x29(%rbp)
lea    -0x29(%rbp),%rdi
add    $0x1,%rdi
mov    -0x4(%rbp),%esi
call   1030 <write_int@plt>
lea    -0x29(%rbp),%rdi
add    $0x5,%rdi
mov    -0x8(%rbp),%esi
call   1030 <write_int@plt>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    -0x29(%rbp),%r8
lea    0xe77(%rip),%rdi
mov    $0x9,%r9d
call   1050 <write_bytes@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_stack_assign_int>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <get_movl_ebp_op@plt>
mov    %al,0x7(%rsp)
lea    0x8(%rsp),%rdi
mov    %ebx,%esi
call   1030 <write_int@plt>
lea    0xc(%rsp),%rdi
mov    %ebp,%esi
call   1030 <write_int@plt>
lea    0xe8d(%rip),%rdi
lea    0x7(%rsp),%r8
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    $0x9,%r9d
call   1050 <write_bytes@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"stack assign int\00"
define void @output_stack_assign_int(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca [9 x i8]
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%12 = call zeroext i8 (...) @get_movl_ebp_op()
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
store i8 %12, i8* %13
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 1
%15 = load i32, i32* %6
%16 = call i32 @write_int(i8* %14, i32 %15)
%17 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 5
%18 = load i32, i32* %7
%19 = call i32 @write_int(i8* %17, i32 %18)
%20 = load i8*, i8** %8
%21 = load i32, i32* %9
%22 = load i32*, i32** %10
%23 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%24 = call i32 @write_bytes(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %20, i32 %21, i32* %22, i8* %23, i32 9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"stack assign int\00"
define void @output_stack_assign_int(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = alloca [9 x i8]
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%8 = tail call zeroext i8 (...) @get_movl_ebp_op()
store i8 %8, i8* %7
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 1
%10 = call i32 @write_int(i8* %9, i32 %0)
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 5
%12 = call i32 @write_int(i8* %11, i32 %1)
%13 = call i32 @write_bytes(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i32* %4, i8* %7, i32 9)
ret void
}