#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*/ emit_section(char *);
int /*<<< orphan*/ printf(char *, ...);
void emit_object_pre(const char *name, unsigned long modifiers,
                     unsigned long alignment, unsigned int byte_size) {
  if ((modifiers & 0x0004) == 0)
    printf(".globl %s\n", name);
  emit_section(".data");
  if (alignment)
    printf("\t.align %lu\n", alignment);
  printf("\t.type\t%s, @object\n", name);
  printf("\t.size\t%s, %d\n", name, byte_size);
  printf("%s:\n", name);
}


x86 assembly (clang, -O0):
<emit_object_pre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
and    $0x4,%rax
cmp    $0x0,%rax
jne    115b <emit_object_pre+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
call   1040 <emit_section@plt>
cmpq   $0x0,-0x18(%rbp)
je     1184 <emit_object_pre+0x64>
mov    -0x18(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_object_pre>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %rdi,%rbx
test   $0x4,%sil
jne    1144 <emit_object_pre+0x24>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
call   1040 <emit_section@plt>
test   %rbp,%rbp
je     1166 <emit_object_pre+0x46>
lea    0xeb5(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c".globl %s\0A\00"
@.str.1 = [6 x i8] c".data\00"
@.str.2 = [13 x i8] c"\09.align %lu\0A\00"
@.str.3 = [20 x i8] c"\09.type\09%s, @object\0A\00"
@.str.4 = [15 x i8] c"\09.size\09%s, %d\0A\00"
@.str.5 = [5 x i8] c"%s:\0A\00"
define void @emit_object_pre(i8* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i64, i64* %6
%10 = and i64 %9, 4
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %4
%16 = call i32 @emit_section(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = load i64, i64* %7
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i64, i64* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 %20)
br label %22
22: ; preds = %19, %15
%23 = load i8*, i8** %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = load i8*, i8** %5
%26 = load i32, i32* %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %25, i32 %26)
%28 = load i8*, i8** %5
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %28)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c".globl %s\0A\00"
@.str.1 = [6 x i8] c".data\00"
@.str.2 = [13 x i8] c"\09.align %lu\0A\00"
@.str.3 = [20 x i8] c"\09.type\09%s, @object\0A\00"
@.str.4 = [15 x i8] c"\09.size\09%s, %d\0A\00"
@.str.5 = [5 x i8] c"%s:\0A\00"
define void @emit_object_pre(i8* %0, i64 %1, i64 %2, i32 %3) {
%5 = and i64 %1, 4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %4
%10 = tail call i32 @emit_section(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %2, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 %2)
br label %14
14: ; preds = %12, %9
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %0, i32 %3)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %0)
ret void
}