#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*/ filename(char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void showbin() {
  char path[256], command[256], *pager;
  filename(path, "MIRBIN", "", "");
  pager = "ls";
  sprintf(command, "%s %s", pager, path);
  printf("%s\n", command);
  system(command);
  return;
}


x86 assembly (clang, -O0):
<showbin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    -0x100(%rbp),%rdi
lea    0xea7(%rip),%rsi
lea    0xeb3(%rip),%rcx
mov    %rcx,%rdx
call   1050 <filename@plt>
lea    0xe98(%rip),%rax
mov    %rax,-0x208(%rbp)
lea    -0x200(%rbp),%rdi
mov    -0x208(%rbp),%rdx
lea    -0x100(%rbp),%rcx
lea    0xe78(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x200(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
lea    -0x200(%rbp),%rdi
call   1030 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showbin>:
push   %r14
push   %rbx
sub    $0x208,%rsp
lea    0xeaf(%rip),%rsi
lea    0xebb(%rip),%rcx
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    %rcx,%rdx
call   1050 <filename@plt>
lea    0xe98(%rip),%rsi
lea    0xe8e(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rcx
call   1060 <sprintf@plt>
lea    0xe82(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"MIRBIN\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define void @showbin() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @filename(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %3
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%13 = call i32 @system(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"MIRBIN\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define void @showbin() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @filename(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%8 = call i32 @system(i8* %4)
ret void
}