#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *test_size(char *, int);
int main(int argc, char *argv[]) {
  char *p = NULL;
  p = test_size(p, 0);
  p = test_size(p, 1);
  p = test_size(p, 8);
  p = test_size(p, 128);
  p = test_size(p, 1024);
  p = test_size(p, 16384);
  p = test_size(p, 8);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x80,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x400,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4000,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1030 <test_size@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <test_size@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <test_size@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   1030 <test_size@plt>
mov    %rax,%rdi
mov    $0x80,%esi
call   1030 <test_size@plt>
mov    %rax,%rdi
mov    $0x400,%esi
call   1030 <test_size@plt>
mov    %rax,%rdi
mov    $0x4000,%esi
call   1030 <test_size@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   1030 <test_size@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i8*, i8** %6
%8 = call i8* @test_size(i8* %7, i32 0)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i8* @test_size(i8* %9, i32 1)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = call i8* @test_size(i8* %11, i32 8)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = call i8* @test_size(i8* %13, i32 128)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i8* @test_size(i8* %15, i32 1024)
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = call i8* @test_size(i8* %17, i32 16384)
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i8* @test_size(i8* %19, i32 8)
store i8* %20, i8** %6
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @test_size(i8* null, i32 0)
%4 = tail call i8* @test_size(i8* %3, i32 1)
%5 = tail call i8* @test_size(i8* %4, i32 8)
%6 = tail call i8* @test_size(i8* %5, i32 128)
%7 = tail call i8* @test_size(i8* %6, i32 1024)
%8 = tail call i8* @test_size(i8* %7, i32 16384)
%9 = tail call i8* @test_size(i8* %8, i32 8)
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
}