#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 jsw_skip {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ jsw_insert(struct jsw_skip *, int);
struct jsw_skip *new_skip();
int /*<<< orphan*/ puts(char *);
struct jsw_skip *make_list(int *vals, int n_vals) {
  struct jsw_skip *res = new_skip();
  if (1)
    puts("Blabla2");
  while (n_vals > 0) {
    if (1)
      puts("Blabla3");
    jsw_insert(res, vals[n_vals - 1]);
    if (1)
      puts("Blabla4");
    n_vals--;
  }
  return res;
}


x86 assembly (clang, -O0):
<make_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <new_skip@plt>
mov    %rax,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0xc(%rbp)
jle    119f <make_list+0x6f>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <jsw_insert@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <make_list+0x26>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_list>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <new_skip@plt>
mov    %rax,%rbx
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    1199 <make_list+0x69>
mov    %ebp,%ebp
add    $0x1,%rbp
lea    0xea4(%rip),%r15
lea    0xea5(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
lea    -0x2(%rbp),%eax
mov    (%r14,%rax,4),%esi
mov    %rbx,%rdi
call   1050 <jsw_insert@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     1170 <make_list+0x40>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.jsw_skip = type { i32 }
@.str = [8 x i8] c"Blabla2\00"
@.str.1 = [8 x i8] c"Blabla3\00"
@.str.2 = [8 x i8] c"Blabla4\00"
define %struct.jsw_skip* @make_list(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %struct.jsw_skip*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call %struct.jsw_skip* (...) @new_skip()
store %struct.jsw_skip* %6, %struct.jsw_skip** %5
%7 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = load %struct.jsw_skip*, %struct.jsw_skip** %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @jsw_insert(%struct.jsw_skip* %13, i32 %19)
%21 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %4
%23 = add nsw i32 %22, -1
store i32 %23, i32* %4
br label %8
24: ; preds = %8
%25 = load %struct.jsw_skip*, %struct.jsw_skip** %5
ret %struct.jsw_skip* %25
}

LLVM IR (-O2):
%struct.jsw_skip = type { i32 }
@.str = [8 x i8] c"Blabla2\00"
@.str.1 = [8 x i8] c"Blabla3\00"
@.str.2 = [8 x i8] c"Blabla4\00"
define %struct.jsw_skip* @make_list(i32* nocapture %0, i32 %1) {
%3 = tail call %struct.jsw_skip* (...) @new_skip()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %11, %8 ]
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = add nsw i64 %9, -1
%12 = and i64 %11, 4294967295
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = tail call i32 @jsw_insert(%struct.jsw_skip* %3, i32 %14)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp ugt i64 %9, 1
br i1 %17, label %8, label %18
18: ; preds = %8, %2
ret %struct.jsw_skip* %3
}