#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int clean_exit) {
  fprintf(stderr, "Usage: recoverjpeg [options] file|device\n");
  fprintf(stderr, "Options:\n");
  fprintf(stderr, "   -b blocksize   Block size in bytes "
                  "(default: 512)\n");
  fprintf(stderr,
          "   -d format      Directory format string in printf syntax\n");
  fprintf(stderr, "   -f format      File format string in printf syntax\n");
  fprintf(stderr, "   -h             This help message\n");
  fprintf(stderr, "   -i index       Initial picture index\n");
  fprintf(stderr, "   -m maxsize     Max jpeg file size in bytes "
                  "(default: 6m)\n");
  fprintf(stderr, "   -o directory   Restore jpeg files into this directory\n");
  fprintf(stderr, "   -q             Be quiet\n");
  fprintf(stderr, "   -r readsize    Size of disk reads in bytes "
                  "(default: 128m)\n");
  fprintf(stderr, "   -s cutoff      Minimal file size in bytes to restore\n");
  fprintf(stderr, "   -S skipsize    Size to skip at the beginning\n");
  fprintf(stderr, "   -v             Be verbose\n");
  fprintf(stderr, "   -V             Display version and exit\n");
  exit(clean_exit ? 0 : 1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xef0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xf17(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xf39(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xf49(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xf5d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xf85(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
lea    0xfaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
lea    0xfb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
lea    0xfdb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xfff(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0x101b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2d88(%rip),%rax
mov    (%rax),%edi
lea    0x1024(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1,%edi
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2eb4(%rip),%rbx
mov    (%rbx),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf39(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf62(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf79(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf94(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfc3(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfef(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xffd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x102e(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1059(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x107c(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x108c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
test   %ebp,%ebp
sete   %dil
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: recoverjpeg [options] file|device\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [54 x i8] c" -b blocksize Block size in bytes (default: 512)\0A\00"
@.str.3 = [60 x i8] c" -d format Directory format string in printf syntax\0A\00"
@.str.4 = [55 x i8] c" -f format File format string in printf syntax\0A\00"
@.str.5 = [37 x i8] c" -h This help message\0A\00"
@.str.6 = [41 x i8] c" -i index Initial picture index\0A\00"
@.str.7 = [61 x i8] c" -m maxsize Max jpeg file size in bytes (default: 6m)\0A\00"
@.str.8 = [58 x i8] c" -o directory Restore jpeg files into this directory\0A\00"
@.str.9 = [28 x i8] c" -q Be quiet\0A\00"
@.str.10 = [63 x i8] c" -r readsize Size of disk reads in bytes (default: 128m)\0A\00"
@.str.11 = [57 x i8] c" -s cutoff Minimal file size in bytes to restore\0A\00"
@.str.12 = [49 x i8] c" -S skipsize Size to skip at the beginning\0A\00"
@.str.13 = [30 x i8] c" -v Be verbose\0A\00"
@.str.14 = [44 x i8] c" -V Display version and exit\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.7, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.14, i64 0, i64 0))
%33 = load i32, i32* %2
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 0, i32 1
%37 = call i32 @exit(i32 %36)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: recoverjpeg [options] file|device\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [54 x i8] c" -b blocksize Block size in bytes (default: 512)\0A\00"
@.str.3 = [60 x i8] c" -d format Directory format string in printf syntax\0A\00"
@.str.4 = [55 x i8] c" -f format File format string in printf syntax\0A\00"
@.str.5 = [37 x i8] c" -h This help message\0A\00"
@.str.6 = [41 x i8] c" -i index Initial picture index\0A\00"
@.str.7 = [61 x i8] c" -m maxsize Max jpeg file size in bytes (default: 6m)\0A\00"
@.str.8 = [58 x i8] c" -o directory Restore jpeg files into this directory\0A\00"
@.str.9 = [28 x i8] c" -q Be quiet\0A\00"
@.str.10 = [63 x i8] c" -r readsize Size of disk reads in bytes (default: 128m)\0A\00"
@.str.11 = [57 x i8] c" -s cutoff Minimal file size in bytes to restore\0A\00"
@.str.12 = [49 x i8] c" -S skipsize Size to skip at the beginning\0A\00"
@.str.13 = [30 x i8] c" -v Be verbose\0A\00"
@.str.14 = [44 x i8] c" -V Display version and exit\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.14, i64 0, i64 0))
%32 = icmp eq i32 %0, 0
%33 = zext i1 %32 to i32
%34 = tail call i32 @exit(i32 %33)
unreachable
}