#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 len;

/* Variables and functions */
int /*<<< orphan*/ C_string2(long **, char *);
scalar_t__ alloca(int);
long get_unbound_variable_value(int /*<<< orphan*/);
int strlen(char *);
long C_retrieve2(long val, char *name) {
  long *p;
  int len;
  if (val == ((long)(0x0000000e | 0x00000020))) {
    len = strlen(name);
    p = ((long *)alloca((((((len) + 7) >> 3) + 2)) * sizeof(long)));
    return get_unbound_variable_value(C_string2(&p, name));
  }
  return val;
}


x86 assembly (clang, -O0):
<C_retrieve2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x2e,-0x10(%rbp)
jne    11a1 <C_retrieve2+0x61>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x7,%eax
sar    $0x3,%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
call   1040 <C_string2@plt>
mov    %eax,%edi
call   1060 <get_unbound_variable_value@plt>
mov    %rax,-0x8(%rbp)
jmp    11a9 <C_retrieve2+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_retrieve2>:
mov    %rdi,%rax
cmp    $0x2e,%rdi
jne    1182 <C_retrieve2+0x42>
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x17(%rax),%edi
and    $0xfffffff8,%edi
call   1050 <alloca@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <C_string2@plt>
mov    %eax,%edi
call   1060 <get_unbound_variable_value@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @C_retrieve2(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 46
br i1 %9, label %10, label %25
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 7
%15 = ashr i32 %14, 3
%16 = add nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 8
%19 = trunc i64 %18 to i32
%20 = call i64 @alloca(i32 %19)
%21 = inttoptr i64 %20 to i64*
store i64* %21, i64** %6
%22 = load i8*, i8** %5
%23 = call i32 @C_string2(i64** %6, i8* %22)
%24 = call i64 @get_unbound_variable_value(i32 %23)
store i64 %24, i64* %3
br label %27
25: ; preds = %2
%26 = load i64, i64* %4
store i64 %26, i64* %3
br label %27
27: ; preds = %25, %10
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @C_retrieve2(i64 %0, i8* %1) {
%3 = alloca i64*
%4 = bitcast i64** %3 to i8*
%5 = icmp eq i64 %0, 46
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = add i32 %7, 23
%9 = and i32 %8, -8
%10 = tail call i64 @alloca(i32 %9)
%11 = inttoptr i64 %10 to i64*
store i64* %11, i64** %3
%12 = call i32 @C_string2(i64** %3, i8* %1)
%13 = call i64 @get_unbound_variable_value(i32 %12)
br label %14
14: ; preds = %2, %6
%15 = phi i64 [ %13, %6 ], [ %0, %2 ]
ret i64 %15
}