#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*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ show_file(char *, char const *, int, int);
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void show_textbox(const char *title, const char *text, int r, int c) {
  int fd;
  fd = creat(".help.tmp", 0777);
  write(fd, text, strlen(text));
  close(fd);
  show_file(".help.tmp", title, r, c);
  unlink(".help.tmp");
}


x86 assembly (clang, -O0):
<show_textbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    0xe83(%rip),%rdi
mov    $0x1ff,%esi
call   1080 <creat@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe38(%rip),%rdi
call   1070 <show_file@plt>
lea    0xe2c(%rip),%rdi
call   1030 <unlink@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_textbox>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r13
lea    0xe82(%rip),%r12
mov    %r12,%rdi
mov    $0x1ff,%esi
call   1080 <creat@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %ebp,%edi
call   1060 <close@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1070 <show_file@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [10 x i8] c".help.tmp\00"
define void @show_textbox(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i32 @creat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 511)
store i32 %10, i32* %9
%11 = load i32, i32* %9
%12 = load i8*, i8** %6
%13 = load i8*, i8** %6
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @write(i32 %11, i8* %12, i32 %14)
%16 = load i32, i32* %9
%17 = call i32 @close(i32 %16)
%18 = load i8*, i8** %5
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 @show_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19, i32 %20)
%22 = call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c".help.tmp\00"
define void @show_textbox(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @creat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 511)
%6 = tail call i32 @strlen(i8* %1)
%7 = tail call i32 @write(i32 %5, i8* %1, i32 %6)
%8 = tail call i32 @close(i32 %5)
%9 = tail call i32 @show_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %3)
%10 = tail call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}