#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 pow(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ quick_s(int *, int /*<<< orphan*/, int);
int main() {
  int a[] = {20, 15, 30, 25, 50, 10, 40};
  quick_s(a, 0, 6);
  unsigned int c = 0x12345678;
  unsigned char b = *(unsigned char *)&c;
  printf("0x%x\n", b);
  printf("%d\n", pow(2, 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <quick_s@plt>
movl   $0x12345678,-0x24(%rbp)
mov    -0x24(%rbp),%al
mov    %al,-0x25(%rbp)
movzbl -0x25(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <pow@plt>
mov    %eax,%esi
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xed1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <quick_s@plt>
lea    0xebb(%rip),%rdi
mov    $0x78,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <pow@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 20, i32 15, i32 30, i32 25, i32 50, i32 10, i32 40]
@.str = [6 x i8] c"0x%x\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = bitcast [7 x i32]* %2 to i8*
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%7 = call i32 @quick_s(i32* %6, i32 0, i32 6)
store i32 305419896, i32* %3
%8 = bitcast i32* %3 to i8*
%9 = load i8, i8* %8
store i8 %9, i8* %4
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @pow(i32 2, i32 1)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 20, i32 15, i32 30, i32 25, i32 50, i32 10, i32 40]
@.str = [6 x i8] c"0x%x\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @quick_s(i32* %3, i32 0, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 120)
%6 = call i32 @pow(i32 2, i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}