#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 /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int pandigital_test_and_set_digits(char *, int);
void pandigital_test_and_set_digits_test(void) {
  char digits[10];
  memset(digits, 0, 10);
  assert(pandigital_test_and_set_digits(digits, 123));
  assert(pandigital_test_and_set_digits(digits, 456));
  assert(!pandigital_test_and_set_digits(digits, 678));
}


x86 assembly (clang, -O0):
<pandigital_test_and_set_digits_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0xa(%rbp),%rdi
mov    $0x7b,%esi
call   1050 <pandigital_test_and_set_digits@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    -0xa(%rbp),%rdi
mov    $0x1c8,%esi
call   1050 <pandigital_test_and_set_digits@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    -0xa(%rbp),%rdi
mov    $0x2a6,%esi
call   1050 <pandigital_test_and_set_digits@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pandigital_test_and_set_digits_test>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x7b,%esi
call   1050 <pandigital_test_and_set_digits@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x1c8,%esi
call   1050 <pandigital_test_and_set_digits@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x2a6,%esi
call   1050 <pandigital_test_and_set_digits@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @pandigital_test_and_set_digits_test() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 10)
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @pandigital_test_and_set_digits(i8* %4, i32 123)
%6 = call i32 @assert(i32 %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%8 = call i32 @pandigital_test_and_set_digits(i8* %7, i32 456)
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%11 = call i32 @pandigital_test_and_set_digits(i8* %10, i32 678)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @pandigital_test_and_set_digits_test() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 10)
%4 = call i32 @pandigital_test_and_set_digits(i8* %2, i32 123)
%5 = call i32 @assert(i32 %4)
%6 = call i32 @pandigital_test_and_set_digits(i8* %2, i32 456)
%7 = call i32 @assert(i32 %6)
%8 = call i32 @pandigital_test_and_set_digits(i8* %2, i32 678)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}