#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 */
struct sn_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sn_send_asoc_msg(struct sn_context *, int, int,
                                    int /*<<< orphan*/);
int sn_do_prio_stress_sched_tests(struct sn_context *snc) {
  int stream, count, repeat;
  for (repeat = 0; repeat < 1000; repeat++)
    for (stream = 0; stream < 10; stream++)
      for (count = 0; count < 10; count++)
        sn_send_asoc_msg(snc, 10240, stream, 0);
  sleep(10);
}


x86 assembly (clang, -O0):
<sn_do_prio_stress_sched_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e8,-0x1c(%rbp)
jge    11a9 <sn_do_prio_stress_sched_tests+0x89>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1196 <sn_do_prio_stress_sched_tests+0x76>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    1183 <sn_do_prio_stress_sched_tests+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x2800,%esi
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <sn_do_prio_stress_sched_tests+0x38>
jmp    1188 <sn_do_prio_stress_sched_tests+0x68>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <sn_do_prio_stress_sched_tests+0x27>
jmp    119b <sn_do_prio_stress_sched_tests+0x7b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1133 <sn_do_prio_stress_sched_tests+0x13>
mov    $0xa,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sn_do_prio_stress_sched_tests>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
mov    %rbx,%rdi
mov    $0x2800,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <sn_send_asoc_msg@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1140 <sn_do_prio_stress_sched_tests+0x20>
add    $0x1,%r14d
cmp    $0x3e8,%r14d
jne    1130 <sn_do_prio_stress_sched_tests+0x10>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sleep@plt>

LLVM IR (-O0):
%struct.sn_context = type { i32 }
define i32 @sn_do_prio_stress_sched_tests(%struct.sn_context* %0) {
%2 = alloca i32
%3 = alloca %struct.sn_context*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.sn_context* %0, %struct.sn_context** %3
store i32 0, i32* %6
br label %7
7: ; preds = %30, %1
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %33
10: ; preds = %7
store i32 0, i32* %4
br label %11
11: ; preds = %26, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %29
14: ; preds = %11
store i32 0, i32* %5
br label %15
15: ; preds = %22, %14
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load %struct.sn_context*, %struct.sn_context** %3
%20 = load i32, i32* %4
%21 = call i32 @sn_send_asoc_msg(%struct.sn_context* %19, i32 10240, i32 %20, i32 0)
br label %22
22: ; preds = %18
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %15
25: ; preds = %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %11
29: ; preds = %11
br label %30
30: ; preds = %29
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %7
%34 = call i32 @sleep(i32 10)
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
%struct.sn_context = type { i32 }
define i32 @sn_do_prio_stress_sched_tests(%struct.sn_context* %0) {
br label %2
2: ; preds = %1, %18
%3 = phi i32 [ 0, %1 ], [ %19, %18 ]
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %16, %4 ]
%6 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%7 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%8 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%9 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%10 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%11 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%12 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%13 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%14 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%15 = tail call i32 @sn_send_asoc_msg(%struct.sn_context* %0, i32 10240, i32 %5, i32 0)
%16 = add nuw nsw i32 %5, 1
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %4
18: ; preds = %4
%19 = add nuw nsw i32 %3, 1
%20 = icmp eq i32 %19, 1000
br i1 %20, label %21, label %2
21: ; preds = %18
%22 = tail call i32 @sleep(i32 10)
ret i32 undef
}