#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*/ assert(int);
int strlen(char const *);
int /*<<< orphan*/ trap_PureSound(char const *);
void G_PureSound(const char *sound) {
  assert(sound && sound[0] && strlen(sound) < 64);
  if (sound[0] == '*') {
    trap_PureSound(sound + 1);
  } else {
    trap_PureSound(sound);
  }
}


x86 assembly (clang, -O0):
<G_PureSound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1173 <G_PureSound+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1173 <G_PureSound+0x43>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x40,%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    11a2 <G_PureSound+0x72>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <trap_PureSound@plt>
jmp    11ab <G_PureSound+0x7b>
mov    -0x8(%rbp),%rdi
call   1040 <trap_PureSound@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_PureSound>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
je     1151 <G_PureSound+0x21>
cmpb   $0x0,(%rbx)
je     1151 <G_PureSound+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x40,%eax
setl   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmpb   $0x2a,(%rbx)
sete   %dil
add    %rbx,%rdi
pop    %rbx
jmp    1040 <trap_PureSound@plt>

LLVM IR (-O0):
define void @G_PureSound(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = icmp slt i32 %13, 64
br label %15
15: ; preds = %11, %5, %1
%16 = phi i1 [ false, %5 ], [ false, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 42
br i1 %23, label %24, label %28
24: ; preds = %15
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = call i32 @trap_PureSound(i8* %26)
br label %31
28: ; preds = %15
%29 = load i8*, i8** %2
%30 = call i32 @trap_PureSound(i8* %29)
br label %31
31: ; preds = %28, %24
ret void
}

LLVM IR (-O2):
define void @G_PureSound(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp slt i32 %7, 64
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %9, %6 ]
%12 = tail call i32 @assert(i32 %11)
%13 = load i8, i8* %0
%14 = icmp eq i8 %13, 42
%15 = zext i1 %14 to i64
%16 = getelementptr i8, i8* %0, i64 %15
%17 = tail call i32 @trap_PureSound(i8* %16)
ret void
}