#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 */
struct InstrSeq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AppendSeq(struct InstrSeq *, struct InstrSeq *);
struct InstrSeq *GenInstr(int /*<<< orphan*/ *, char *, char *, char *,
                          int /*<<< orphan*/ *);
struct InstrSeq *doPrintLine() {
  struct InstrSeq *code = GenInstr(NULL, NULL, NULL, NULL, NULL);
  AppendSeq(code, GenInstr(NULL, "li", "$v0", "4", NULL));
  AppendSeq(code, GenInstr(NULL, "la", "$a0", "_nl", NULL));
  AppendSeq(code, GenInstr(NULL, "syscall", NULL, NULL, NULL));
  return code;
}


x86 assembly (clang, -O0):
<doPrintLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdi
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <GenInstr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%r8d
lea    0xeaa(%rip),%rsi
lea    0xea6(%rip),%rdx
lea    0xea3(%rip),%rcx
mov    %r8,%rdi
call   1040 <GenInstr@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <AppendSeq@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%r8d
lea    0xe7d(%rip),%rsi
lea    0xe79(%rip),%rdx
lea    0xe76(%rip),%rcx
mov    %r8,%rdi
call   1040 <GenInstr@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1030 <AppendSeq@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%r8d
lea    0xe52(%rip),%rsi
mov    %r8,%rdi
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <GenInstr@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
call   1030 <AppendSeq@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doPrintLine>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <GenInstr@plt>
mov    %rax,%rbx
lea    0xec5(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xebe(%rip),%rcx
xor    %edi,%edi
xor    %r8d,%r8d
call   1040 <GenInstr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <AppendSeq@plt>
lea    0xea4(%rip),%rsi
lea    0xea0(%rip),%rdx
lea    0xe9d(%rip),%rcx
xor    %edi,%edi
xor    %r8d,%r8d
call   1040 <GenInstr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <AppendSeq@plt>
lea    0xe85(%rip),%rsi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <GenInstr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <AppendSeq@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.InstrSeq = type { i32 }
@.str = [3 x i8] c"li\00"
@.str.1 = [4 x i8] c"$v0\00"
@.str.2 = [2 x i8] c"4\00"
@.str.3 = [3 x i8] c"la\00"
@.str.4 = [4 x i8] c"$a0\00"
@.str.5 = [4 x i8] c"_nl\00"
@.str.6 = [8 x i8] c"syscall\00"
define %struct.InstrSeq* @doPrintLine() {
%1 = alloca %struct.InstrSeq*
%2 = call %struct.InstrSeq* @GenInstr(i32* null, i8* null, i8* null, i8* null, i32* null)
store %struct.InstrSeq* %2, %struct.InstrSeq** %1
%3 = load %struct.InstrSeq*, %struct.InstrSeq** %1
%4 = call %struct.InstrSeq* @GenInstr(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* null)
%5 = call i32 @AppendSeq(%struct.InstrSeq* %3, %struct.InstrSeq* %4)
%6 = load %struct.InstrSeq*, %struct.InstrSeq** %1
%7 = call %struct.InstrSeq* @GenInstr(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* null)
%8 = call i32 @AppendSeq(%struct.InstrSeq* %6, %struct.InstrSeq* %7)
%9 = load %struct.InstrSeq*, %struct.InstrSeq** %1
%10 = call %struct.InstrSeq* @GenInstr(i32* null, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* null, i8* null, i32* null)
%11 = call i32 @AppendSeq(%struct.InstrSeq* %9, %struct.InstrSeq* %10)
%12 = load %struct.InstrSeq*, %struct.InstrSeq** %1
ret %struct.InstrSeq* %12
}

LLVM IR (-O2):
%struct.InstrSeq = type { i32 }
@.str = [3 x i8] c"li\00"
@.str.1 = [4 x i8] c"$v0\00"
@.str.2 = [2 x i8] c"4\00"
@.str.3 = [3 x i8] c"la\00"
@.str.4 = [4 x i8] c"$a0\00"
@.str.5 = [4 x i8] c"_nl\00"
@.str.6 = [8 x i8] c"syscall\00"
define %struct.InstrSeq* @doPrintLine() {
%1 = tail call %struct.InstrSeq* @GenInstr(i32* null, i8* null, i8* null, i8* null, i32* null)
%2 = tail call %struct.InstrSeq* @GenInstr(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* null)
%3 = tail call i32 @AppendSeq(%struct.InstrSeq* %1, %struct.InstrSeq* %2)
%4 = tail call %struct.InstrSeq* @GenInstr(i32* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32* null)
%5 = tail call i32 @AppendSeq(%struct.InstrSeq* %1, %struct.InstrSeq* %4)
%6 = tail call %struct.InstrSeq* @GenInstr(i32* null, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* null, i8* null, i32* null)
%7 = tail call i32 @AppendSeq(%struct.InstrSeq* %1, %struct.InstrSeq* %6)
ret %struct.InstrSeq* %1
}