xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
bool is_union(const char *type) { return (strncmp(type, "union", 5) == 0); }


x86 assembly (clang, -O0):
<is_union>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_union>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"union\00"
define i32 @is_union(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"union\00"
define i32 @is_union(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buflist_bar_item_update(int /*<<< orphan*/);
int /*<<< orphan*/ buflist_config_change_signals_refresh(int /*<<< orphan*/ *,
                                                         int /*<<< orphan*/ *,
                                                         int /*<<< orphan*/ *);
void buflist_config_change_nick_prefix(const void *pointer, void *data,
                                       struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  buflist_config_change_signals_refresh(NULL, NULL, NULL);
  buflist_bar_item_update(0);
}


x86 assembly (clang, -O0):
<buflist_config_change_nick_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <buflist_config_change_signals_refresh@plt>
xor    %edi,%edi
call   1040 <buflist_bar_item_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buflist_config_change_nick_prefix>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <buflist_config_change_signals_refresh@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <buflist_bar_item_update@plt>

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @buflist_config_change_nick_prefix(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 @buflist_config_change_signals_refresh(i32* null, i32* null, i32* null)
%11 = call i32 @buflist_bar_item_update(i32 0)
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @buflist_config_change_nick_prefix(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 @buflist_config_change_signals_refresh(i32* null, i32* null, i32* null)
%5 = tail call i32 @buflist_bar_item_update(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int mincore(void *__start, size_t __len, unsigned char *__vec) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<mincore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mincore>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @mincore(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @mincore(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void foo395(int p) {}


x86 assembly (clang, -O0):
<foo395>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo395>:
ret

LLVM IR (-O0):
define void @foo395(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo395(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int ui32Base;

/* Variables and functions */
uint32_t PWMGenPeriodGet(uint32_t ui32Base, uint32_t ui32Gen) {
  ;
  ;
  ui32Gen = ((ui32Base) + (ui32Gen));
  if ((*((volatile unsigned long *)(ui32Gen + 0x00000000))) & 0x00000002) {
    return ((*((volatile unsigned long *)(ui32Gen + 0x00000010))) * 2);
  } else {
    return ((*((volatile unsigned long *)(ui32Gen + 0x00000010))) + 1);
  }
}


x86 assembly (clang, -O0):
<PWMGenPeriodGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1143 <PWMGenPeriodGet+0x43>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
cltq
mov    (%rax),%rax
shl    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    1155 <PWMGenPeriodGet+0x55>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
cltq
mov    (%rax),%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenPeriodGet>:
movslq %esi,%rax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%rdx
mov    0x10(%rax,%rcx,1),%rax
lea    (%rax,%rax,1),%ecx
add    $0x1,%eax
test   $0x2,%rdx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @PWMGenPeriodGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, 2
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 16
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = mul i64 %21, 2
%23 = trunc i64 %22 to i32
store i32 %23, i32* %3
br label %32
24: ; preds = %2
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 16
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i64*
%29 = load volatile i64, i64* %28
%30 = add i64 %29, 1
%31 = trunc i64 %30 to i32
store i32 %31, i32* %3
br label %32
32: ; preds = %24, %16
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @PWMGenPeriodGet(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 2
%8 = icmp eq i64 %7, 0
%9 = add nsw i32 %3, 16
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 1
%15 = add i32 %13, 1
%16 = select i1 %8, i32 %15, i32 %14
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void kernel_panic(char *message) {
  printf("KERNEL PANIC: %s\n", message);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<kernel_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <kernel_panic+0x1c>

x86 assembly (clang, -O2):
<kernel_panic>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <kernel_panic+0x10>

LLVM IR (-O0):
@.str = [18 x i8] c"KERNEL PANIC: %s\0A\00"
define void @kernel_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"KERNEL PANIC: %s\0A\00"
define void @kernel_panic(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t xumem_read32(void *base, int offset) {
  volatile uint32_t *p = (volatile uint32_t *)((char *)base + offset);
  return *p;
}


x86 assembly (clang, -O0):
<xumem_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xumem_read32>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @xumem_read32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = load volatile i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @xumem_read32(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load volatile i32, i32* %5
ret i32 %6
}
/* Type definitions */
struct stackNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int isStackEmpty(struct stackNode *newStackNode) {
  printf("isStackEmpty called.\n");
  if (newStackNode == NULL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isStackEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    113f <isStackEmpty+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <isStackEmpty+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isStackEmpty>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
test   %rbx,%rbx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.stackNode = type { i32 }
@.str = [22 x i8] c"isStackEmpty called.\0A\00"
define i32 @isStackEmpty(%struct.stackNode* %0) {
%2 = alloca i32
%3 = alloca %struct.stackNode*
store %struct.stackNode* %0, %struct.stackNode** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.stackNode*, %struct.stackNode** %3
%6 = icmp eq %struct.stackNode* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.stackNode = type { i32 }
@str = [21 x i8] c"isStackEmpty called.\00"
define i32 @isStackEmpty(%struct.stackNode* readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = icmp eq %struct.stackNode* %0, null
%4 = zext i1 %3 to i32
ret i32 %4
}
int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
                                  struct net_bridge_port *p,
                                  struct net_bridge_vlan_group *vg) {
  return 0;
}


x86 assembly (clang, -O0):
<br_handle_ingress_vlan_tunnel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<br_handle_ingress_vlan_tunnel>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.sk_buff = type opaque
%struct.net_bridge_port = type opaque
%struct.net_bridge_vlan_group = type opaque
define i32 @br_handle_ingress_vlan_tunnel(%struct.sk_buff* %0, %struct.net_bridge_port* %1, %struct.net_bridge_vlan_group* %2) {
%4 = alloca %struct.sk_buff*
%5 = alloca %struct.net_bridge_port*
%6 = alloca %struct.net_bridge_vlan_group*
store %struct.sk_buff* %0, %struct.sk_buff** %4
store %struct.net_bridge_port* %1, %struct.net_bridge_port** %5
store %struct.net_bridge_vlan_group* %2, %struct.net_bridge_vlan_group** %6
ret i32 0
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
%struct.net_bridge_port = type opaque
%struct.net_bridge_vlan_group = type opaque
define i32 @br_handle_ingress_vlan_tunnel(%struct.sk_buff* nocapture readnone %0, %struct.net_bridge_port* nocapture readnone %1, %struct.net_bridge_vlan_group* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ guiput_(char *, float *, int *, int *, int *);
void guiput(char *aname, float *array, int *dimx, int *dimy, int *dimz) {
  guiput_(aname, array, dimx, dimy, dimz);
}


x86 assembly (clang, -O0):
<guiput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <guiput_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guiput>:
jmp    1030 <guiput_@plt>

LLVM IR (-O0):
define void @guiput(i8* %0, float* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca float*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store float* %1, float** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load float*, float** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @guiput_(i8* %11, float* %12, i32* %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @guiput(i8* %0, float* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @guiput_(i8* %0, float* %1, i32* %2, i32* %3, i32* %4)
ret void
}
void matmul_fini() {}


x86 assembly (clang, -O0):
<matmul_fini>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matmul_fini>:
ret

LLVM IR (-O0):
define void @matmul_fini() {
ret void
}

LLVM IR (-O2):
define void @matmul_fini() {
ret void
}
/* Variables and functions */
float sin(float);
float sine_easeOut(float t, float b, float c, float d) {
  return c * sin(t / d * (3.14159265f / 2)) + b;
}


x86 assembly (clang, -O0):
<sine_easeOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xeb8(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_easeOut>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
mulss  0xed8(%rip),%xmm0
call   1030 <sin@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sine_easeOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = load float, float* %8
%12 = fdiv float %10, %11
%13 = fmul float %12, 0x3FF921FB60000000
%14 = call float @sin(float %13)
%15 = load float, float* %6
%16 = call float @llvm.fmuladd.f32(float %9, float %14, float %15)
ret float %16
}

LLVM IR (-O2):
define float @sine_easeOut(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fmul float %5, 0x3FF921FB60000000
%7 = tail call float @sin(float %6)
%8 = tail call float @llvm.fmuladd.f32(float %2, float %7, float %1)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int /*<<< orphan*/ xfree(void *);
void free_ptr(void *p) {
  printf("free: %p\n", p);
  xfree(p);
}


x86 assembly (clang, -O0):
<free_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <xfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ptr>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xfree@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"free: %p\0A\00"
define void @free_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @xfree(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"free: %p\0A\00"
define void @free_ptr(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @xfree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void run(char *fmt, char *str) {
  char cmd[255];
  sprintf(cmd, fmt, str);
  system(cmd);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @run(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
define void @run(i8* nocapture %0, i8* %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x5f() {
  Assert_real((isalpha(95) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              480, ("isalpha should be 0 for _"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x5f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e0,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x5f>:
push   %rax
mov    $0x5f,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for _\00"
define void @t_isalpha_0x5f() {
%1 = call i64 @isalpha(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for _\00"
define void @t_isalpha_0x5f() {
%1 = tail call i64 @isalpha(i32 95)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int64_t to_nanosec(struct timespec *ts) {
  return (int64_t)ts->tv_sec * 1000000000 + (int64_t)ts->tv_nsec;
}


x86 assembly (clang, -O0):
<to_nanosec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0x3b9aca00,%eax,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_nanosec>:
imul   $0x3b9aca00,0x8(%rdi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @to_nanosec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @to_nanosec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = add nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int exp_b(int);
int exp_d(int x) {
  int shift_left = x << ((sizeof(int) - 1) << 3);
  return exp_b(shift_left);
}


x86 assembly (clang, -O0):
<exp_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <exp_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_d>:
shl    $0x18,%edi
jmp    1030 <exp_b@plt>

LLVM IR (-O0):
define i32 @exp_d(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 24
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @exp_b(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @exp_d(i32 %0) {
%2 = shl i32 %0, 24
%3 = tail call i32 @exp_b(i32 %2)
ret i32 %3
}
void fun_2(char *arr1, unsigned int index) { arr1[index * 2 + 1] = 10; }


x86 assembly (clang, -O0):
<fun_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movb   $0xa,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_2>:
add    %esi,%esi
movb   $0xa,0x1(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @fun_2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul i32 %6, 2
%8 = add i32 %7, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 10, i8* %10
ret void
}

LLVM IR (-O2):
define void @fun_2(i8* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = or i32 %3, 1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 10, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ klog(char const *);
void printf(const char text[]) { klog(text); }


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <klog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
jmp    1030 <klog@plt>

LLVM IR (-O0):
define void @printf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @klog(i8* %3)
ret void
}

LLVM IR (-O2):
define void @printf(i8* %0) {
%2 = tail call i32 @klog(i8* %0)
ret void
}
/* Variables and functions */
int strcasecmp(char *, char *);
int compara_palavras(void *p1, void *p2) {
  char *s1 = p1, *s2 = p2;
  return strcasecmp(s1, s2);
}


x86 assembly (clang, -O0):
<compara_palavras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compara_palavras>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @compara_palavras(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @strcasecmp(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compara_palavras(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
int kiSetCameraFeature(int cameraID, int feature, int value) { return 1; }


x86 assembly (clang, -O0):
<kiSetCameraFeature>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kiSetCameraFeature>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @kiSetCameraFeature(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @kiSetCameraFeature(i32 %0, i32 %1, i32 %2) {
ret i32 1
}
void XRaySaveReport(struct XRayTraceCapture *capture, const char *filename,
                    float percent_cutoff, int cycle_cutoff) {}


x86 assembly (clang, -O0):
<XRaySaveReport>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<XRaySaveReport>:
ret

LLVM IR (-O0):
%struct.XRayTraceCapture = type opaque
define void @XRaySaveReport(%struct.XRayTraceCapture* %0, i8* %1, float %2, i32 %3) {
%5 = alloca %struct.XRayTraceCapture*
%6 = alloca i8*
%7 = alloca float
%8 = alloca i32
store %struct.XRayTraceCapture* %0, %struct.XRayTraceCapture** %5
store i8* %1, i8** %6
store float %2, float* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.XRayTraceCapture = type opaque
define void @XRaySaveReport(%struct.XRayTraceCapture* nocapture %0, i8* nocapture %1, float %2, i32 %3) {
ret void
}
long double test_exp2l(long double x) { return __builtin_exp2l(x); }


x86 assembly (clang, -O0):
<test_exp2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp2l@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exp2l>:
jmp    1030 <exp2l@plt>

LLVM IR (-O0):
define x86_fp80 @test_exp2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @exp2l(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test_exp2l(x86_fp80 %0) {
%2 = tail call x86_fp80 @exp2l(x86_fp80 %0)
ret x86_fp80 %2
}
void main() {
  int i = 0, j = 0;
  int s = 0;
  s = i / j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = sdiv i32 %4, %5
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
struct sStreamCodec {
  int dummy;
};

/* Variables and functions */
scalar_t__ StreamDecoder_GetU08(struct sStreamCodec *);
signed char StreamDecoder_GetS08(struct sStreamCodec *p) {
  return (signed char)StreamDecoder_GetU08(p);
}


x86 assembly (clang, -O0):
<StreamDecoder_GetS08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <StreamDecoder_GetU08@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StreamDecoder_GetS08>:
push   %rax
call   1030 <StreamDecoder_GetU08@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sStreamCodec = type { i32 }
define signext i8 @StreamDecoder_GetS08(%struct.sStreamCodec* %0) {
%2 = alloca %struct.sStreamCodec*
store %struct.sStreamCodec* %0, %struct.sStreamCodec** %2
%3 = load %struct.sStreamCodec*, %struct.sStreamCodec** %2
%4 = call i64 @StreamDecoder_GetU08(%struct.sStreamCodec* %3)
%5 = trunc i64 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
%struct.sStreamCodec = type { i32 }
define signext i8 @StreamDecoder_GetS08(%struct.sStreamCodec* %0) {
%2 = tail call i64 @StreamDecoder_GetU08(%struct.sStreamCodec* %0)
%3 = trunc i64 %2 to i8
ret i8 %3
}
unsigned xrop3_79_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_79_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_79_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_79_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %7
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
%44 = load i32, i32* %5
%45 = load i32, i32* %7
%46 = and i32 %44, %45
%47 = or i32 %43, %46
ret i32 %47
}

LLVM IR (-O2):
define i32 @xrop3_79_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_delline(void) { conio_init(); }


x86 assembly (clang, -O0):
<caca_conio_delline>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <conio_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<caca_conio_delline>:
xor    %eax,%eax
jmp    1030 <conio_init@plt>

LLVM IR (-O0):
define void @caca_conio_delline() {
%1 = call i32 (...) @conio_init()
ret void
}

LLVM IR (-O2):
define void @caca_conio_delline() {
%1 = tail call i32 (...) @conio_init()
ret void
}
int mycomp(const void *p1, const void *p2) {
  const double *a1 = (const double *)p1;
  const double *a2 = (const double *)p2;
  if (*a1 < *a2) {
    return -1;
  } else if (*a1 == *a2) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<mycomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <mycomp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <mycomp+0x76>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    116a <mycomp+0x6a>
jp     116a <mycomp+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <mycomp+0x76>
jmp    116f <mycomp+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycomp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mycomp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %27
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %27
25: ; preds = %18
br label %26
26: ; preds = %25
store i32 1, i32* %3
br label %27
27: ; preds = %26, %24, %17
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @mycomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp une double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void f_getown(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<f_getown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_getown>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.f_getown = [9 x i8] c"f_getown\00"
define void @f_getown() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.f_getown, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.f_getown = [9 x i8] c"f_getown\00"
define void @f_getown() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.f_getown, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pd_random_29bit();
double pd_random_double(void) {
  double r29 = pd_random_29bit();
  return (r29 / ((unsigned int)(1 << 29)));
}


x86 assembly (clang, -O0):
<pd_random_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pd_random_29bit@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_random_double>:
push   %rax
xor    %eax,%eax
call   1030 <pd_random_29bit@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pd_random_double() {
%1 = alloca double
%2 = call double (...) @pd_random_29bit()
store double %2, double* %1
%3 = load double, double* %1
%4 = fdiv double %3, 0x41C0000000000000
ret double %4
}

LLVM IR (-O2):
define double @pd_random_double() {
%1 = tail call double (...) @pd_random_29bit()
%2 = fmul double %1, 0x3E20000000000000
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ read(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
uint8_t comm_rx(void) {
  uint8_t c;
  if (read(0, &c, 1) > 0)
    return c;
  exit(1);
}


x86 assembly (clang, -O0):
<comm_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jle    114b <comm_rx+0x2b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<comm_rx>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
jle    113d <comm_rx+0x1d>
mov    0x4(%rsp),%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @comm_rx() {
%1 = alloca i32
%2 = call i64 @read(i32 0, i32* %1, i32 1)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* %1
ret i32 %5
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @comm_rx() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @read(i32 0, i32* %1, i32 1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %1
ret i32 %6
7: ; preds = %0
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int SSL_set_fd(void *, int);
int dv_openssl_set_fd(void *s, int fd) { return SSL_set_fd(s, fd); }


x86 assembly (clang, -O0):
<dv_openssl_set_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <SSL_set_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_openssl_set_fd>:
jmp    1030 <SSL_set_fd@plt>

LLVM IR (-O0):
define i32 @dv_openssl_set_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @SSL_set_fd(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @dv_openssl_set_fd(i8* %0, i32 %1) {
%3 = tail call i32 @SSL_set_fd(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void testConstString(void) {
  const char *str = "abcdef";
  printf("abcdef is %lu\n", sizeof(str));
  printf("shit is %lu\n", sizeof("shit"));
}


x86 assembly (clang, -O0):
<testConstString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConstString>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x5,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [15 x i8] c"abcdef is %lu\0A\00"
@.str.2 = [13 x i8] c"shit is %lu\0A\00"
define void @testConstString() {
%1 = alloca i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"abcdef is %lu\0A\00"
@.str.2 = [13 x i8] c"shit is %lu\0A\00"
define void @testConstString() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ encode(void *, int, char *);
void decode(void *data, int size, char *key) { encode(data, size, key); }


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
jmp    1030 <encode@plt>

LLVM IR (-O0):
define void @decode(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @encode(i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @decode(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @encode(i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_print(void *i) {
  switch (*((int *)i)) {
  case 1:
    printf("hello\n");
    break;
  case 2:
    printf("byebye\n");
    break;
  default:
    printf("?\n");
  }
}


x86 assembly (clang, -O0):
<test_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1144 <test_print+0x34>
jmp    1133 <test_print+0x23>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1155 <test_print+0x45>
jmp    1166 <test_print+0x56>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <test_print+0x62>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <test_print+0x62>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print>:
mov    (%rdi),%eax
cmp    $0x2,%eax
lea    0xee4(%rip),%rcx
lea    0xeea(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x1,%eax
lea    0xed6(%rip),%rdi
cmovne %rdx,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
@.str.1 = [8 x i8] c"byebye\0A\00"
@.str.2 = [3 x i8] c"?\0A\00"
define void @test_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"byebye\00"
@str.3 = [6 x i8] c"hello\00"
@str.4 = [2 x i8] c"?\00"
define void @test_print(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0)
%6 = icmp eq i32 %3, 1
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* %5
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __up_write(struct rw_semaphore *);
void up_write(struct rw_semaphore *sem) { __up_write(sem); }


x86 assembly (clang, -O0):
<up_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__up_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_write>:
jmp    1030 <__up_write@plt>

LLVM IR (-O0):
%struct.rw_semaphore = type { i32 }
define void @up_write(%struct.rw_semaphore* %0) {
%2 = alloca %struct.rw_semaphore*
store %struct.rw_semaphore* %0, %struct.rw_semaphore** %2
%3 = load %struct.rw_semaphore*, %struct.rw_semaphore** %2
%4 = call i32 @__up_write(%struct.rw_semaphore* %3)
ret void
}

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @up_write(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__up_write(%struct.rw_semaphore* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t gettimestamp(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (uint64_t)tv.tv_sec * (uint64_t)1000000 + (uint64_t)tv.tv_usec;
}


x86 assembly (clang, -O0):
<gettimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @gettimestamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @gettimestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}