#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 */
scalar_t__ WEXITSTATUS(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ stderr;
int system(char *);
void prepare_data() {
  char cmd[1024];
  snprintf(cmd, 1024, "cp %s %s", "lrc_basic.lrc", "/tmp/");
  int ret;
  ret = system(cmd);
  if (ret == -1 || WEXITSTATUS(ret) != 0) {
    fprintf(stderr, "Faild to prepare data\n");
    exit(1);
  }
  snprintf(cmd, 1024, "cp %s %s", "lrc_gbk.lrc", "/tmp/");
  ret = system(cmd);
  if (ret == -1 || WEXITSTATUS(ret) != 0) {
    fprintf(stderr, "Faild to prepare data\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<prepare_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
lea    0xe92(%rip),%rdx
lea    0xe94(%rip),%rcx
lea    0xe9b(%rip),%r8
call   1040 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x404(%rbp)
cmpl   $0xffffffff,-0x404(%rbp)
je     11b5 <prepare_data+0x65>
mov    -0x404(%rbp),%edi
call   1060 <WEXITSTATUS@plt>
cmp    $0x0,%rax
je     11d4 <prepare_data+0x84>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
lea    0xe19(%rip),%rdx
lea    0xe46(%rip),%rcx
lea    0xe22(%rip),%r8
call   1040 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x404(%rbp)
cmpl   $0xffffffff,-0x404(%rbp)
je     122e <prepare_data+0xde>
mov    -0x404(%rbp),%edi
call   1060 <WEXITSTATUS@plt>
cmp    $0x0,%rax
je     124d <prepare_data+0xfd>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_data>:
push   %rbx
sub    $0x400,%rsp
lea    0xea1(%rip),%rdx
lea    0xea3(%rip),%rcx
lea    0xeaa(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
je     11dd <prepare_data+0x8d>
mov    %eax,%edi
call   1060 <WEXITSTATUS@plt>
test   %rax,%rax
jne    11dd <prepare_data+0x8d>
lea    0xe63(%rip),%rdx
lea    0xe90(%rip),%rcx
lea    0xe6c(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
je     11dd <prepare_data+0x8d>
mov    %eax,%edi
call   1060 <WEXITSTATUS@plt>
test   %rax,%rax
jne    11dd <prepare_data+0x8d>
add    $0x400,%rsp
pop    %rbx
ret
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
lea    0xe30(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"cp %s %s\00"
@.str.1 = [14 x i8] c"lrc_basic.lrc\00"
@.str.2 = [6 x i8] c"/tmp/\00"
@stderr = global i32 0
@.str.3 = [23 x i8] c"Faild to prepare data\0A\00"
@.str.4 = [12 x i8] c"lrc_gbk.lrc\00"
define void @prepare_data() {
%1 = alloca [1024 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -1
br i1 %8, label %13, label %9
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i64 @WEXITSTATUS(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9, %0
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %9
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%19 = call i32 @snprintf(i8* %18, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%21 = call i32 @system(i8* %20)
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, -1
br i1 %23, label %28, label %24
24: ; preds = %17
%25 = load i32, i32* %2
%26 = call i64 @WEXITSTATUS(i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %24, %17
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %24
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"cp %s %s\00"
@.str.1 = [14 x i8] c"lrc_basic.lrc\00"
@.str.2 = [6 x i8] c"/tmp/\00"
@stderr = global i32 0
@.str.3 = [23 x i8] c"Faild to prepare data\0A\00"
@.str.4 = [12 x i8] c"lrc_gbk.lrc\00"
define void @prepare_data() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @system(i8* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = call i64 @WEXITSTATUS(i32 %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6, %0
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %6
%14 = call i32 @snprintf(i8* %2, i32 1024, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @system(i8* %2)
%16 = icmp eq i32 %15, -1
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = call i64 @WEXITSTATUS(i32 %15)
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %17, %13
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %17
ret void
}