#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_pushl_op();
int /*<<< orphan*/ write_bytes(char *, unsigned char *, unsigned int,
                               unsigned int *, unsigned char *, int);
int /*<<< orphan*/ write_int(unsigned char *, int);
void output_term(int number, unsigned char *buf, unsigned int buf_size,
                 unsigned int *bytes_written) {
  unsigned char bytes[5];
  bytes[0] = get_pushl_op();
  write_int(&bytes[1], number);
  write_bytes("term", buf, buf_size, bytes_written, bytes, 5);
}


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

x86 assembly (clang, -O2):
<output_term>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <get_pushl_op@plt>
mov    %al,0x3(%rsp)
lea    0x4(%rsp),%rdi
mov    %ebp,%esi
call   1030 <write_int@plt>
lea    0xea0(%rip),%rdi
lea    0x3(%rsp),%r8
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    $0x5,%r9d
call   1040 <write_bytes@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"term\00"
define void @output_term(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca [5 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%7 = tail call zeroext i8 (...) @get_pushl_op()
store i8 %7, i8* %6
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
%9 = call i32 @write_int(i8* %8, i32 %0)
%10 = call i32 @write_bytes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32* %3, i8* %6, i32 5)
ret void
}