#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);
scalar_t__ is_money(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int test_is_money() {
  char str[20], curr[20];
  printf("test_is_money...");
  sprintf(str, "%s", "$123");
  assert(is_money(str, curr) != 0);
  sprintf(str, "%s", "$123.2.4");
  assert(is_money(str, curr) == 0);
  sprintf(str, "%s", "$123.2");
  assert(is_money(str, curr) != 0);
  sprintf(str, "%s", "$1A3.2");
  assert(is_money(str, curr) == 0);
  printf("ok\n");
  return 1;
}


x86 assembly (clang, -O0):
<test_is_money>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb2(%rip),%rsi
lea    0xeae(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <is_money@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe7d(%rip),%rsi
lea    0xe7e(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <is_money@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe48(%rip),%rsi
lea    0xe52(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <is_money@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe13(%rip),%rsi
lea    0xe24(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <is_money@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe01(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_is_money>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeb2(%rip),%rdi
call   1050 <printf@plt>
movl   $0x33323124,(%rsp)
movb   $0x0,0x4(%rsp)
mov    %rsp,%rbx
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <is_money@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <assert@plt>
movabs $0x342e322e33323124,%rax
32 2e 34
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <is_money@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
movl   $0x33323124,(%rsp)
movl   $0x322e33,0x3(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <is_money@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <assert@plt>
movl   $0x33413124,(%rsp)
movl   $0x322e33,0x3(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <is_money@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    0xe2a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"test_is_money...\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"$123\00"
@.str.3 = [9 x i8] c"$123.2.4\00"
@.str.4 = [7 x i8] c"$123.2\00"
@.str.5 = [7 x i8] c"$1A3.2\00"
@.str.6 = [4 x i8] c"ok\0A\00"
define i32 @test_is_money() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i64 @is_money(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%13 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%16 = call i64 @is_money(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%21 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%24 = call i64 @is_money(i8* %22, i8* %23)
%25 = icmp ne i64 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%29 = call i32 @sprintf(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%32 = call i64 @is_money(i8* %30, i8* %31)
%33 = icmp eq i64 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"test_is_money...\00"
@.str.2 = [5 x i8] c"$123\00"
@.str.3 = [9 x i8] c"$123.2.4\00"
@.str.4 = [7 x i8] c"$123.2\00"
@.str.5 = [7 x i8] c"$1A3.2\00"
@str = [3 x i8] c"ok\00"
define i32 @test_is_money() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @is_money(i8* %3, i8* %4)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i64 @is_money(i8* %3, i8* %4)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i64 @is_money(i8* %3, i8* %4)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i64 @is_money(i8* %3, i8* %4)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 1
}