#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*/ strncmp(char *, char *, int);
int system(char *);
void _setup(void) {
  int r;
  r = system("dmsetup create "
             "crypt_zero"
             " --table \"0 10000 zero\"");
  r = system("dmsetup create "
             "crypt_error"
             " --table \"0 10000 error\"");
  if (!strncmp("/dev/loop", "/dev/loop5", 9)) {
    r = system(" [ ! -e "
               "compatimage.img"
               " ] && bzip2 -dk "
               "compatimage.img"
               ".bz2");
    r = system("losetup "
               "/dev/loop5"
               " "
               "compatimage.img");
  }
  if (!strncmp("/dev/loop", "/dev/loop6", 9)) {
    r = system("dd if=/dev/zero of="
               "empty.img"
               " bs=1M count=4");
    r = system("losetup "
               "/dev/loop6"
               " "
               "empty.img");
  }
}


x86 assembly (clang, -O0):
<_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xef3(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xf17(%rip),%rdi
lea    0xf1a(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1185 <_setup+0x65>
lea    0xf0b(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xf37(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xed8(%rip),%rdi
lea    0xf44(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11c4 <_setup+0xa4>
lea    0xf35(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xf51(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xefd(%rip),%rdi
call   1040 <system@plt>
lea    0xf24(%rip),%rdi
lea    0xf27(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    116d <_setup+0x4d>
lea    0xf1d(%rip),%rdi
call   1040 <system@plt>
lea    0xf4c(%rip),%rdi
call   1040 <system@plt>
lea    0xef0(%rip),%rdi
lea    0xf5c(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     118b <_setup+0x6b>
pop    %rax
ret
lea    0xf50(%rip),%rdi
call   1040 <system@plt>
lea    0xf6f(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"dmsetup create crypt_zero --table \220 10000 zero\22\00"
@.str.1 = [51 x i8] c"dmsetup create crypt_error --table \220 10000 error\22\00"
@.str.2 = [10 x i8] c"/dev/loop\00"
@.str.3 = [11 x i8] c"/dev/loop5\00"
@.str.4 = [59 x i8] c" [ ! -e compatimage.img ] && bzip2 -dk compatimage.img.bz2\00"
@.str.5 = [35 x i8] c"losetup /dev/loop5 compatimage.img\00"
@.str.6 = [11 x i8] c"/dev/loop6\00"
@.str.7 = [43 x i8] c"dd if=/dev/zero of=empty.img bs=1M count=4\00"
@.str.8 = [29 x i8] c"losetup /dev/loop6 empty.img\00"
define void @_setup() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %1
%4 = call i32 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 9)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = call i32 @system(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
store i32 %7, i32* %1
%8 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %0
%10 = call i32 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
store i32 %13, i32* %1
%14 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
store i32 %14, i32* %1
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"dmsetup create crypt_zero --table \220 10000 zero\22\00"
@.str.1 = [51 x i8] c"dmsetup create crypt_error --table \220 10000 error\22\00"
@.str.2 = [10 x i8] c"/dev/loop\00"
@.str.3 = [11 x i8] c"/dev/loop5\00"
@.str.4 = [59 x i8] c" [ ! -e compatimage.img ] && bzip2 -dk compatimage.img.bz2\00"
@.str.5 = [35 x i8] c"losetup /dev/loop5 compatimage.img\00"
@.str.6 = [11 x i8] c"/dev/loop6\00"
@.str.7 = [43 x i8] c"dd if=/dev/zero of=empty.img bs=1M count=4\00"
@.str.8 = [29 x i8] c"losetup /dev/loop6 empty.img\00"
define void @_setup() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 9)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @system(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %8
8: ; preds = %5, %0
%9 = tail call i32 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 9)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%13 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
ret void
}