#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 *, char *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_message(char *message, int length) {
  int message_length = length;
  putc(' ', stdout);
  int i;
  for (i = 0; i < message_length + 1; i++) {
    putc('_', stdout);
  }
  putc('\n', stdout);
  putc('<', stdout);
  putc(' ', stdout);
  printf("%s>\n", message);
  putc(' ', stdout);
  for (i = 0; i < message_length + 1; i++) {
    putc('-', stdout);
  }
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<print_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1181 <print_message+0x61>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    $0x5f,%edi
call   1040 <putc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114f <print_message+0x2f>
mov    0x2e58(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%esi
mov    $0x3c,%edi
call   1040 <putc@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
mov    -0x8(%rbp),%rsi
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1216 <print_message+0xf6>
mov    0x2de4(%rip),%rax
mov    (%rax),%esi
mov    $0x2d,%edi
call   1040 <putc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e4 <print_message+0xc4>
mov    0x2dc3(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_message>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ead(%rip),%r15
mov    (%r15),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
test   %ebx,%ebx
js     11c4 <print_message+0xa4>
lea    0x1(%rbx),%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r15),%esi
mov    $0x5f,%edi
call   1040 <putc@plt>
add    $0xffffffff,%ebp
jne    1150 <print_message+0x30>
mov    (%r15),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    (%r15),%esi
mov    $0x3c,%edi
call   1040 <putc@plt>
mov    (%r15),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
lea    0xe70(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    (%r15),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
test   %ebx,%ebx
js     1207 <print_message+0xe7>
add    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r15),%esi
mov    $0x2d,%edi
call   1040 <putc@plt>
add    $0xffffffff,%ebx
jne    11b0 <print_message+0x90>
jmp    1207 <print_message+0xe7>
mov    (%r15),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    (%r15),%esi
mov    $0x3c,%edi
call   1040 <putc@plt>
mov    (%r15),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
lea    0xe0e(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    (%r15),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
mov    (%r15),%esi
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%s>\0A\00"
define void @print_message(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
store i32 %7, i32* %5
%8 = load i32, i32* @stdout
%9 = call i32 @putc(i8 signext 32, i32 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %18, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = load i32, i32* @stdout
%17 = call i32 @putc(i8 signext 95, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %10
21: ; preds = %10
%22 = load i32, i32* @stdout
%23 = call i32 @putc(i8 signext 10, i32 %22)
%24 = load i32, i32* @stdout
%25 = call i32 @putc(i8 signext 60, i32 %24)
%26 = load i32, i32* @stdout
%27 = call i32 @putc(i8 signext 32, i32 %26)
%28 = load i8*, i8** %3
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @stdout
%31 = call i32 @putc(i8 signext 32, i32 %30)
store i32 0, i32* %6
br label %32
32: ; preds = %40, %21
%33 = load i32, i32* %6
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
%36 = icmp slt i32 %33, %35
br i1 %36, label %37, label %43
37: ; preds = %32
%38 = load i32, i32* @stdout
%39 = call i32 @putc(i8 signext 45, i32 %38)
br label %40
40: ; preds = %37
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %32
43: ; preds = %32
%44 = load i32, i32* @stdout
%45 = call i32 @putc(i8 signext 10, i32 %44)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%s>\0A\00"
define void @print_message(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i8 signext 32, i32 %3)
%5 = icmp slt i32 %1, 0
br i1 %5, label %28, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ 0, %2 ]
%8 = load i32, i32* @stdout
%9 = tail call i32 @putc(i8 signext 95, i32 %8)
%10 = add nuw i32 %7, 1
%11 = icmp eq i32 %7, %1
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = load i32, i32* @stdout
%14 = tail call i32 @putc(i8 signext 10, i32 %13)
%15 = load i32, i32* @stdout
%16 = tail call i32 @putc(i8 signext 60, i32 %15)
%17 = load i32, i32* @stdout
%18 = tail call i32 @putc(i8 signext 32, i32 %17)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%20 = load i32, i32* @stdout
%21 = tail call i32 @putc(i8 signext 32, i32 %20)
br i1 %5, label %38, label %22
22: ; preds = %12, %22
%23 = phi i32 [ %26, %22 ], [ 0, %12 ]
%24 = load i32, i32* @stdout
%25 = tail call i32 @putc(i8 signext 45, i32 %24)
%26 = add nuw i32 %23, 1
%27 = icmp eq i32 %23, %1
br i1 %27, label %38, label %22
28: ; preds = %2
%29 = load i32, i32* @stdout
%30 = tail call i32 @putc(i8 signext 10, i32 %29)
%31 = load i32, i32* @stdout
%32 = tail call i32 @putc(i8 signext 60, i32 %31)
%33 = load i32, i32* @stdout
%34 = tail call i32 @putc(i8 signext 32, i32 %33)
%35 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%36 = load i32, i32* @stdout
%37 = tail call i32 @putc(i8 signext 32, i32 %36)
br label %38
38: ; preds = %22, %28, %12
%39 = load i32, i32* @stdout
%40 = tail call i32 @putc(i8 signext 10, i32 %39)
ret void
}