#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 *, ...);
void showUnsigned(const unsigned *begin, const unsigned *end) {
  printf("{");
  while (begin < end) {
    printf("%u", *begin);
    ++begin;
    if (begin < end)
      printf(", ");
  }
  printf("}\n");
}


x86 assembly (clang, -O0):
<showUnsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117d <showUnsigned+0x6d>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1178 <showUnsigned+0x68>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112e <showUnsigned+0x1e>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showUnsigned>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x7b,%edi
call   1030 <putchar@plt>
cmp    %r14,%rbx
jae    119f <showUnsigned+0x6f>
mov    (%rbx),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x4,%rbx
cmp    %r14,%rbx
jae    119f <showUnsigned+0x6f>
lea    0xe96(%rip),%r15
lea    0xe8c(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x4,%rbx
cmp    %r14,%rbx
jb     1180 <showUnsigned+0x50>
lea    0xe60(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [3 x i8] c", \00"
@str = [2 x i8] c"}\00"
define void @showUnsigned(i32* %0, i32* readnone %1) {
%3 = tail call i32 @putchar(i32 123)
%4 = icmp ult i32* %0, %1
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = load i32, i32* %0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = icmp ult i32* %8, %1
br i1 %9, label %10, label %17
10: ; preds = %5, %10
%11 = phi i32* [ %15, %10 ], [ %8, %5 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %11
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds i32, i32* %11, i64 1
%16 = icmp ult i32* %15, %1
br i1 %16, label %10, label %17
17: ; preds = %10, %5, %2
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}