#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 isValid(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  char *s = ")";
  bool result = isValid(s);
  if (result) {
    printf("括号格式正确\n");
  } else {
    printf("括号格式不正确\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <isValid@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1174 <main+0x54>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <isValid@plt>
test   %eax,%eax
lea    0xece(%rip),%rax
lea    0xedd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@.str.1 = [2 x i8] c")\00"
@.str.2 = [20 x i8] c"\E6\8B\AC\E5\8F\B7\E6\A0\BC\E5\BC\8F\E6\AD\A3\E7\A1\AE\0A\00"
@.str.3 = [23 x i8] c"\E6\8B\AC\E5\8F\B7\E6\A0\BC\E5\BC\8F\E4\B8\8D\E6\AD\A3\E7\A1\AE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @isValid(i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c")\00"
@str = [14 x i8] c"Hello, World!\00"
@str.4 = [22 x i8] c"\E6\8B\AC\E5\8F\B7\E6\A0\BC\E5\BC\8F\E4\B8\8D\E6\AD\A3\E7\A1\AE\00"
@str.5 = [19 x i8] c"\E6\8B\AC\E5\8F\B7\E6\A0\BC\E5\BC\8F\E6\AD\A3\E7\A1\AE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @isValid(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}