#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*/ printf(char *, int, int, int, int, int, int);
int rand();
int /*<<< orphan*/ st_usleep(int);
void foo(int a, int b, int c, int d) {
  int i = rand();
  printf("%d: %d,%d,%d,%d,%d,\n", 91, i, a, b, c, d);
  st_usleep(1);
  printf("%d: %d,%d,%d,%d,%d,\n", 94, i, a, b, c, d);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
lea    0xe9a(%rip),%rdi
mov    $0x5b,%esi
mov    %eax,(%rsp)
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <st_usleep@plt>
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
lea    0xe6b(%rip),%rdi
mov    $0x5e,%esi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r12d
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
mov    %ebp,(%rsp)
lea    0xea7(%rip),%r13
mov    %r13,%rdi
mov    $0x5b,%esi
mov    %eax,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <st_usleep@plt>
mov    %ebp,(%rsp)
mov    %r13,%rdi
mov    $0x5e,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%d: %d,%d,%d,%d,%d,\0A\00"
define void @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i32 (...) @rand()
store i32 %10, i32* %9
%11 = load i32, i32* %9
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 91, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
%17 = call i32 @st_usleep(i32 1)
%18 = load i32, i32* %9
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 94, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%d: %d,%d,%d,%d,%d,\0A\00"
define void @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 91, i32 %5, i32 %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @st_usleep(i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 94, i32 %5, i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}