#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*/ dnormal();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ srand48(long);
void dnormal_test(long iseed) {
  int i;
  printf("initilization %d\n", iseed);
  srand48(iseed);
  for (i = 0; i < 10; i++) {
    printf("%10d%10.6f\n", i, dnormal());
  }
}


x86 assembly (clang, -O0):
<dnormal_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <srand48@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1198 <dnormal_test+0x68>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dnormal@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <dnormal_test+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnormal_test>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <srand48@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <dnormal@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"initilization %d\0A\00"
@.str.1 = [12 x i8] c"%10d%10.6f\0A\00"
define void @dnormal_test(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i64, i64* %2
%8 = call i32 @srand48(i64 %7)
store i32 0, i32* %3
br label %9
9: ; preds = %16, %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = call i32 (...) @dnormal()
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"initilization %d\0A\00"
@.str.1 = [12 x i8] c"%10d%10.6f\0A\00"
define void @dnormal_test(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @srand48(i64 %0)
%5 = tail call i32 (...) @dnormal()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %5)
%7 = tail call i32 (...) @dnormal()
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %7)
%9 = tail call i32 (...) @dnormal()
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %9)
%11 = tail call i32 (...) @dnormal()
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %11)
%13 = tail call i32 (...) @dnormal()
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %13)
%15 = tail call i32 (...) @dnormal()
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %15)
%17 = tail call i32 (...) @dnormal()
%18 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %17)
%19 = tail call i32 (...) @dnormal()
%20 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 %19)
%21 = tail call i32 (...) @dnormal()
%22 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 %21)
%23 = tail call i32 (...) @dnormal()
%24 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 %23)
ret void
}