#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 */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ absmin(int, double *, int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  double array[] = {3, 1, -3, 0, 4};
  int array_size = sizeof(array) / sizeof(array[0]);
  int amin = 0;
  absmin(array_size, array, &amin);
  printf("Minimum bei %d\n", amin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe82(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x5,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1040 <absmin@plt>
mov    -0x38(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0xc008000000000000,%rax
mov    %rax,0x20(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x30(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x5,%edi
call   1040 <absmin@plt>
mov    0xc(%rsp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Minimum bei %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x double]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x double]* %2 to i8*
%6 = bitcast i8* %5 to [5 x double]*
%7 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 0
store double 3.000000e+00, double* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 1
store double 1.000000e+00, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 2
store double -3.000000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 4
store double 4.000000e+00, double* %10
store i32 5, i32* %3
store i32 0, i32* %4
%11 = load i32, i32* %3
%12 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%13 = call i32 @absmin(i32 %11, double* %12, i32* %4)
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Minimum bei %d\0A\00"
define i32 @main() {
%1 = alloca [5 x double]
%2 = alloca i32
%3 = bitcast [5 x double]* %1 to i8*
%4 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 2
%5 = bitcast double* %4 to i8*
%6 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 0
%7 = bitcast [5 x double]* %1 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 1.000000e+00>, <2 x double>* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 2
store double -3.000000e+00, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 4
store double 4.000000e+00, double* %9
%10 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%11 = call i32 @absmin(i32 5, double* %6, i32* %2)
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}