#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 *, int, int, double);
void GP_add_edge_f(void *arg, int type, int src, int dst, double label) {
  if (type == 265) {
    printf("e %d %d %f\n", src, dst, label);
  } else if (type == 266) {
    printf("d %d %d %f\n", src, dst, label);
  } else if (type == 267) {
    printf("u %d %d %f\n", src, dst, label);
  } else {
  }
}


x86 assembly (clang, -O0):
<GP_add_edge_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x109,-0xc(%rbp)
jne    1153 <GP_add_edge_f+0x43>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    11b4 <GP_add_edge_f+0xa4>
cmpl   $0x10a,-0xc(%rbp)
jne    117c <GP_add_edge_f+0x6c>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <GP_add_edge_f+0x9f>
cmpl   $0x10b,-0xc(%rbp)
jne    11a5 <GP_add_edge_f+0x95>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <GP_add_edge_f+0x9a>
jmp    11aa <GP_add_edge_f+0x9a>
jmp    11af <GP_add_edge_f+0x9f>
jmp    11b4 <GP_add_edge_f+0xa4>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GP_add_edge_f>:
add    $0xfffffef7,%esi
cmp    $0x2,%esi
ja     1135 <GP_add_edge_f+0x25>
movslq %esi,%rax
lea    0xeff(%rip),%rsi
movslq (%rsi,%rax,4),%rdi
add    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [12 x i8] c"e %d %d %f\0A\00"
@.str.1 = [12 x i8] c"d %d %d %f\0A\00"
@.str.2 = [12 x i8] c"u %d %d %f\0A\00"
define void @GP_add_edge_f(i8* %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 265
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load double, double* %10
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, double %16)
br label %37
18: ; preds = %5
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 266
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = load double, double* %10
%25 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23, double %24)
br label %36
26: ; preds = %18
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 267
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = load double, double* %10
%33 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %30, i32 %31, double %32)
br label %35
34: ; preds = %26
br label %35
35: ; preds = %34, %29
br label %36
36: ; preds = %35, %21
br label %37
37: ; preds = %36, %13
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"e %d %d %f\0A\00"
@.str.1 = [12 x i8] c"d %d %d %f\0A\00"
@.str.2 = [12 x i8] c"u %d %d %f\0A\00"
@reltable.GP_add_edge_f = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.GP_add_edge_f to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.GP_add_edge_f to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.GP_add_edge_f to i64)) to i32)]
define void @GP_add_edge_f(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = add i32 %1, -265
%7 = icmp ult i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.GP_add_edge_f to i8*), i64 %10)
%12 = tail call i32 @printf(i8* %11, i32 %2, i32 %3, double %4)
br label %13
13: ; preds = %5, %8
ret void
}