#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 */
typedef scalar_t__ wchar_t;

/* Variables and functions */
scalar_t__ get_unichar(char *, char **, int /*<<< orphan*/);
int speak_punct(wchar_t wc, char *punct) {
  wchar_t wx;
  if (!punct)
    return 0;
  while ((wx = get_unichar(punct, &punct, 0)) != 0)
    if (wx == wc)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<speak_punct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <speak_punct+0x27>
movl   $0x0,-0x4(%rbp)
jmp    117f <speak_punct+0x6f>
jmp    113c <speak_punct+0x2c>
mov    -0x18(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <get_unichar@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1178 <speak_punct+0x68>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1173 <speak_punct+0x63>
movl   $0x1,-0x4(%rbp)
jmp    117f <speak_punct+0x6f>
jmp    113c <speak_punct+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speak_punct>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,0x8(%rsp)
test   %rsi,%rsi
je     116b <speak_punct+0x5b>
mov    %rdi,%rbx
lea    0x8(%rsp),%rax
xor    %ebp,%ebp
mov    %rsi,%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <get_unichar@plt>
test   %rax,%rax
je     1174 <speak_punct+0x64>
lea    0x8(%rsp),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rbx,%rax
je     116f <speak_punct+0x5f>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <get_unichar@plt>
test   %rax,%rax
jne    1150 <speak_punct+0x40>
jmp    1174 <speak_punct+0x64>
xor    %ebp,%ebp
jmp    1174 <speak_punct+0x64>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @speak_punct(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 0, i32* %3
br label %22
10: ; preds = %2
br label %11
11: ; preds = %20, %10
%12 = load i8*, i8** %5
%13 = call i64 @get_unichar(i8* %12, i8** %5, i32 0)
store i64 %13, i64* %6
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i64, i64* %6
%17 = load i64, i64* %4
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %3
br label %22
20: ; preds = %15
br label %11
21: ; preds = %11
store i32 0, i32* %3
br label %22
22: ; preds = %21, %19, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @speak_punct(i64 %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp eq i8* %1, null
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = call i64 @get_unichar(i8* %1, i8** %3, i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5, %11
%9 = phi i64 [ %13, %11 ], [ %6, %5 ]
%10 = icmp eq i64 %9, %0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = call i64 @get_unichar(i8* %12, i8** %3, i32 0)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %11, %5, %2
%16 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 0, %11 ], [ 1, %8 ]
ret i32 %16
}