#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*/ printf(char *, ...);
void put_str_proc() {
  printf("%s PROC\n", "put_str");
  ;
  printf("\tMOV\t%s, %s\n", "BX", "OFFSET Parameters");
  ;
  printf("\tADD\t%s, %s\n", "BX", "Parameter_Offset");
  ;
  printf("\tSUB\t%s, %s\n", "BX", "2");
  ;
  printf("\t_PutStr\tWORD PTR [BX]\n");
  printf("\tRET\n");
  ;
  printf("%s ENDP\n", "put_str");
  ;
}


x86 assembly (clang, -O0):
<put_str_proc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee3(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0xecb(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xeaf(%rip),%rsi
lea    0xee8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0xe62(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_str_proc>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
lea    0xed4(%rip),%rbx
lea    0xed0(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0xed7(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xedd(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s PROC\0A\00"
@.str.1 = [8 x i8] c"put_str\00"
@.str.2 = [13 x i8] c"\09MOV\09%s, %s\0A\00"
@.str.3 = [3 x i8] c"BX\00"
@.str.4 = [18 x i8] c"OFFSET Parameters\00"
@.str.5 = [13 x i8] c"\09ADD\09%s, %s\0A\00"
@.str.6 = [17 x i8] c"Parameter_Offset\00"
@.str.7 = [13 x i8] c"\09SUB\09%s, %s\0A\00"
@.str.8 = [2 x i8] c"2\00"
@.str.9 = [24 x i8] c"\09_PutStr\09WORD PTR [BX]\0A\00"
@.str.10 = [6 x i8] c"\09RET\0A\00"
@.str.11 = [9 x i8] c"%s ENDP\0A\00"
define void @put_str_proc() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s PROC\0A\00"
@.str.1 = [8 x i8] c"put_str\00"
@.str.2 = [13 x i8] c"\09MOV\09%s, %s\0A\00"
@.str.3 = [3 x i8] c"BX\00"
@.str.4 = [18 x i8] c"OFFSET Parameters\00"
@.str.5 = [13 x i8] c"\09ADD\09%s, %s\0A\00"
@.str.6 = [17 x i8] c"Parameter_Offset\00"
@.str.7 = [13 x i8] c"\09SUB\09%s, %s\0A\00"
@.str.8 = [2 x i8] c"2\00"
@.str.11 = [9 x i8] c"%s ENDP\0A\00"
@str = [23 x i8] c"\09_PutStr\09WORD PTR [BX]\00"
@str.12 = [5 x i8] c"\09RET\00"
define void @put_str_proc() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}