#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*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ system(char *);
void downWeb(char *id) {
  char shellCommand[64];
  sprintf(shellCommand, "wget -O %s/webFile https://www.wish.com/c/%s", id, id);
  if (0 != system(shellCommand)) {
    printf("system() failed\n");
  }
  printf("\nbefore downWeb()return: 网页下载完成\n");
}


x86 assembly (clang, -O0):
<downWeb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb1(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1177 <downWeb+0x47>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downWeb>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rcx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
test   %rax,%rax
je     1166 <downWeb+0x36>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
add    $0x40,%rsp
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"wget -O %s/webFile https://www.wish.com/c/%s\00"
@.str.1 = [17 x i8] c"system() failed\0A\00"
@.str.2 = [45 x i8] c"\0Abefore downWeb()return: \E7\BD\91\E9\A1\B5\E4\B8\8B\E8\BD\BD\E5\AE\8C\E6\88\90\0A\00"
define void @downWeb(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = call i64 @system(i8* %8)
%10 = icmp ne i64 0, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"wget -O %s/webFile https://www.wish.com/c/%s\00"
@str = [44 x i8] c"\0Abefore downWeb()return: \E7\BD\91\E9\A1\B5\E4\B8\8B\E8\BD\BD\E5\AE\8C\E6\88\90\00"
@str.3 = [16 x i8] c"system() failed\00"
define void @downWeb(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%5 = call i64 @system(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}