#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 */
typedef int uint32_t;
typedef int int32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int get_one_value(int /*<<< orphan*/ *, size_t, int, int);
int /*<<< orphan*/ printf(char *, int);
void generate_latencies(int16_t *dist_data, size_t dist_size, uint32_t mu,
                        uint32_t sigma, uint32_t rho, uint32_t count) {
  int i;
  for (i = 0; i < count; i++) {
    int32_t val = get_one_value(dist_data, dist_size, mu, sigma);
    printf("%d\n", val);
  }
}


x86 assembly (clang, -O0):
<generate_latencies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1184 <generate_latencies+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <get_one_value@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1145 <generate_latencies+0x25>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_latencies>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %r9d,%r9d
jle    1170 <generate_latencies+0x50>
mov    %r9d,%ebx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbp
lea    0xeba(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <get_one_value@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1150 <generate_latencies+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @generate_latencies(i32* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 0, i32* %13
br label %15
15: ; preds = %27, %6
%16 = load i32, i32* %13
%17 = load i32, i32* %12
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load i32*, i32** %7
%21 = load i64, i64* %8
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = call i32 @get_one_value(i32* %20, i64 %21, i32 %22, i32 %23)
store i32 %24, i32* %14
%25 = load i32, i32* %14
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %19
%28 = load i32, i32* %13
%29 = add nsw i32 %28, 1
store i32 %29, i32* %13
br label %15
30: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @generate_latencies(i32* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %14
8: ; preds = %6, %8
%9 = phi i32 [ %12, %8 ], [ 0, %6 ]
%10 = tail call i32 @get_one_value(i32* %0, i64 %1, i32 %2, i32 %3)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i32 %9, 1
%13 = icmp eq i32 %12, %5
br i1 %13, label %14, label %8
14: ; preds = %8, %6
ret void
}