#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);
size_t lace_compat_random_bytes(char *, size_t const);
scalar_t__ memcmp(char *, char *, size_t const);
int main() {
  char buf1[256];
  char buf2[256];
  const size_t capacity = 256;
  size_t n;
  n = lace_compat_random_bytes(buf1, capacity);
  assert(n == capacity);
  do {
    n = lace_compat_random_bytes(buf2, capacity);
    assert(n == capacity);
  } while (0 == memcmp(buf1, buf2, capacity));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x100,-0x218(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1030 <lace_compat_random_bytes@plt>
mov    %rax,-0x220(%rbp)
cmpq   $0x100,-0x220(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x210(%rbp),%rdi
mov    $0x100,%esi
call   1030 <lace_compat_random_bytes@plt>
mov    %rax,-0x220(%rbp)
cmpq   $0x100,-0x220(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x100,%edx
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     117d <main+0x4d>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
lea    0x100(%rsp),%r14
mov    $0x100,%esi
mov    %r14,%rdi
call   1030 <lace_compat_random_bytes@plt>
xor    %edi,%edi
cmp    $0x100,%rax
sete   %dil
call   1050 <assert@plt>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x100,%esi
mov    %rbx,%rdi
call   1030 <lace_compat_random_bytes@plt>
xor    %edi,%edi
cmp    $0x100,%rax
sete   %dil
call   1050 <assert@plt>
mov    $0x100,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <memcmp@plt>
test   %rax,%rax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 256, i64* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i64 @lace_compat_random_bytes(i8* %6, i64 256)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp eq i64 %8, 256
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
br label %12
12: ; preds = %19, %0
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%14 = call i64 @lace_compat_random_bytes(i8* %13, i64 256)
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = icmp eq i64 %15, 256
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
br label %19
19: ; preds = %12
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%22 = call i64 @memcmp(i8* %20, i8* %21, i64 256)
%23 = icmp eq i64 0, %22
br i1 %23, label %12, label %24
24: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i64 @lace_compat_random_bytes(i8* %3, i64 256)
%6 = icmp eq i64 %5, 256
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
br label %9
9: ; preds = %9, %0
%10 = call i64 @lace_compat_random_bytes(i8* %4, i64 256)
%11 = icmp eq i64 %10, 256
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i64 @memcmp(i8* %3, i8* %4, i64 256)
%15 = icmp eq i64 %14, 0
br i1 %15, label %9, label %16
16: ; preds = %9
ret i32 0
}