#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*/ printaddr(unsigned long const);
int /*<<< orphan*/ tprintf(char *, unsigned long const);
int /*<<< orphan*/ tprints(char *);
void print_seg(const unsigned long *seg) {
  tprints("{");
  printaddr(seg[0]);
  tprintf(", %lu, ", seg[1]);
  printaddr(seg[2]);
  tprintf(", %lu}", seg[3]);
}


x86 assembly (clang, -O0):
<print_seg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <tprints@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printaddr@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <tprintf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <printaddr@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xe86(%rip),%rdi
call   1040 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_seg>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <tprints@plt>
mov    (%rbx),%rdi
call   1030 <printaddr@plt>
mov    0x8(%rbx),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <tprintf@plt>
mov    0x10(%rbx),%rdi
call   1030 <printaddr@plt>
mov    0x18(%rbx),%rsi
lea    0xe9e(%rip),%rdi
pop    %rbx
jmp    1040 <tprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [8 x i8] c", %lu, \00"
@.str.2 = [7 x i8] c", %lu}\00"
define void @print_seg(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i32 @tprints(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = call i32 @printaddr(i64 %6)
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = call i32 @tprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %10)
%12 = load i64*, i64** %2
%13 = getelementptr inbounds i64, i64* %12, i64 2
%14 = load i64, i64* %13
%15 = call i32 @printaddr(i64 %14)
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 3
%18 = load i64, i64* %17
%19 = call i32 @tprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 %18)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"{\00"
@.str.1 = [8 x i8] c", %lu, \00"
@.str.2 = [7 x i8] c", %lu}\00"
define void @print_seg(i64* nocapture %0) {
%2 = tail call i32 @tprints(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i64, i64* %0
%4 = tail call i32 @printaddr(i64 %3)
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = tail call i32 @tprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %6)
%8 = getelementptr inbounds i64, i64* %0, i64 2
%9 = load i64, i64* %8
%10 = tail call i32 @printaddr(i64 %9)
%11 = getelementptr inbounds i64, i64* %0, i64 3
%12 = load i64, i64* %11
%13 = tail call i32 @tprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 %12)
ret void
}