#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 rand();
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *config_dummy_uuid() {
  static char device_uuid[256];
  if (device_uuid[0])
    return device_uuid;
  srand(time(NULL));
  snprintf(device_uuid, 256, "%08x-%08x-%08x-%08x", rand(), rand(), rand(),
           rand());
  return device_uuid;
}


x86 assembly (clang, -O0):
<config_dummy_uuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cmpb   $0x0,0x2f01(%rip)
je     1165 <config_dummy_uuid+0x25>
lea    0x2ef4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11cb <config_dummy_uuid+0x8b>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0x2ea4(%rip),%rdi
mov    $0x100,%esi
lea    0xe48(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
lea    0x2e89(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_dummy_uuid>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmpb   $0x0,0x2f01(%rip)
jne    11a6 <config_dummy_uuid+0x66>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,(%rsp)
lea    0x2ec4(%rip),%rdi
lea    0xe6d(%rip),%rdx
mov    $0x100,%esi
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
call   1030 <snprintf@plt>
lea    0x2ea3(%rip),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@config_dummy_uuid.device_uuid = internal global [256 x i8] zeroinitializer
@.str = [20 x i8] c"%08x-%08x-%08x-%08x\00"
define i8* @config_dummy_uuid() {
%1 = alloca i8*
%2 = load i8, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0)
%3 = icmp ne i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0), i8** %1
br label %13
5: ; preds = %0
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = call i32 (...) @rand()
%10 = call i32 (...) @rand()
%11 = call i32 (...) @rand()
%12 = call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11)
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0), i8** %1
br label %13
13: ; preds = %5, %4
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@config_dummy_uuid.device_uuid = internal global [256 x i8] zeroinitializer
@.str = [20 x i8] c"%08x-%08x-%08x-%08x\00"
define i8* @config_dummy_uuid() {
%1 = load i8, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i32 @time(i32* null)
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (...) @rand()
%7 = tail call i32 (...) @rand()
%8 = tail call i32 (...) @rand()
%9 = tail call i32 (...) @rand()
%10 = tail call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %9)
br label %11
11: ; preds = %0, %3
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @config_dummy_uuid.device_uuid, i64 0, i64 0)
}