#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*/ bmp_to_screen(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int tofb(int argc, char *argv[]) {
  int ret = -1;
  char path[256] = "/mnt/sdcard"
                   "/bmp/in.565.negative.bmp";
  if (argc >= 2) {
    strcpy(path, argv[1]);
  }
  bmp_to_screen(path);
  return 0;
}


x86 assembly (clang, -O0):
<tofb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    -0x120(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x100,%edx
call   1040 <memcpy@plt>
cmpl   $0x2,-0x4(%rbp)
jl     117f <tofb+0x4f>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
call   1050 <bmp_to_screen@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tofb>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xebb(%rip),%rsi
mov    %rsp,%rdi
mov    $0x100,%edx
call   1040 <memcpy@plt>
cmp    $0x2,%ebp
jl     1163 <tofb+0x33>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%rdi
call   1050 <bmp_to_screen@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.tofb.path = [256 x i8] c"/mnt/sdcard/bmp/in.565.negative.bmp\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @tofb(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [256 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 -1, i32* %5
%7 = bitcast [256 x i8]* %6 to i8*
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strcpy(i8* %11, i8* %14)
br label %16
16: ; preds = %10, %2
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%18 = call i32 @bmp_to_screen(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@__const.tofb.path = [256 x i8] c"/mnt/sdcard/bmp/in.565.negative.bmp\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @tofb(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %4, i8* %8)
br label %10
10: ; preds = %6, %2
%11 = call i32 @bmp_to_screen(i8* %4)
ret i32 0
}