xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(long long);
int /*<<< orphan*/ stderr;
void *myMalloc(long long n) {
  void *p;
  if (n == 0)
    return NULL;
  p = (void *)malloc(n);
  if (p == NULL) {
    fprintf(stderr, "Error: malloc failed\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<myMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <myMalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1193 <myMalloc+0x63>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118b <myMalloc+0x5b>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myMalloc>:
push   %rax
test   %rdi,%rdi
je     1142 <myMalloc+0x12>
call   1040 <malloc@plt>
test   %rax,%rax
je     1146 <myMalloc+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Error: malloc failed\0A\00"
define i8* @myMalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %8
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Error: malloc failed\0A\00"
define i8* @myMalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i64 @malloc(i64 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
%11 = inttoptr i64 %4 to i8*
br label %12
12: ; preds = %1, %10
%13 = phi i8* [ %11, %10 ], [ null, %1 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void greet(char *str, int n) { strncpy(str, "Hello, World", n); }


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, World\00"
define void @greet(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 @strncpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
define void @greet(i8* %0, i32 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int foo2();
int bar(void) { return foo2(); }


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @foo2()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo2()
ret i32 %1
}
void fbcon_fb_blanked(struct fb_info *info, int blank) {}


x86 assembly (clang, -O0):
<fbcon_fb_blanked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fb_info = type opaque
define void @fbcon_fb_blanked(%struct.fb_info* %0, i32 %1) {
%3 = alloca %struct.fb_info*
%4 = alloca i32
store %struct.fb_info* %0, %struct.fb_info** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.fb_info = type opaque
define void @fbcon_fb_blanked(%struct.fb_info* nocapture %0, i32 %1) {
ret void
}
unsigned int get4Bits(unsigned char *data, int offset) {
  return (data[offset / 2] >> (4 - ((offset & 1) << 2))) & 0xF;
}


x86 assembly (clang, -O0):
<get4Bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%edx
and    $0x1,%edx
shl    $0x2,%edx
mov    $0x4,%ecx
sub    %edx,%ecx
sar    %cl,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get4Bits>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
cltq
movzbl (%rdi,%rax,1),%eax
lea    0x0(,%rsi,4),%ecx
not    %cl
and    $0x4,%cl
shr    %cl,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @get4Bits(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 = sdiv i32 %6, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 2
%15 = sub nsw i32 4, %14
%16 = ashr i32 %11, %15
%17 = and i32 %16, 15
ret i32 %17
}

LLVM IR (-O2):
define i32 @get4Bits(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %1, 2
%9 = and i32 %8, 4
%10 = xor i32 %9, 4
%11 = lshr i32 %7, %10
%12 = and i32 %11, 15
ret i32 %12
}
/* Variables and functions */
#define HOST_NOT_FOUND 131
#define NO_ADDRESS 130
#define NO_RECOVERY 129
#define TRY_AGAIN 128
int conv_h_errno(int herr) {
  switch (herr) {
  case HOST_NOT_FOUND:
    return ((4 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_ADDRESS:
    return ((5 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case NO_RECOVERY:
    return ((6 | ((1 << 29) | (1 << 30))) | (1 << 7));
  case TRY_AGAIN:
    return ((7 | ((1 << 29) | (1 << 30))) | (1 << 7));
  default:
    return herr;
  }
}


x86 assembly (clang, -O0):
<conv_h_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1160 <conv_h_errno+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x60000084,-0x4(%rbp)
jmp    1166 <conv_h_errno+0x66>
movl   $0x60000085,-0x4(%rbp)
jmp    1166 <conv_h_errno+0x66>
movl   $0x60000086,-0x4(%rbp)
jmp    1166 <conv_h_errno+0x66>
movl   $0x60000087,-0x4(%rbp)
jmp    1166 <conv_h_errno+0x66>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_h_errno>:
mov    %edi,%ecx
and    $0xfffffffc,%ecx
mov    $0x60000107,%eax
sub    %edi,%eax
cmp    $0x80,%ecx
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @conv_h_errno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 131, label %5
i32 130, label %6
i32 129, label %7
i32 128, label %8
]
5: ; preds = %1
store i32 1610612868, i32* %2
br label %11
6: ; preds = %1
store i32 1610612869, i32* %2
br label %11
7: ; preds = %1
store i32 1610612870, i32* %2
br label %11
8: ; preds = %1
store i32 1610612871, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %8, %7, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @conv_h_errno(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 128
%4 = sub i32 1610612999, %0
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
double exp(double const);
double selu_gradient(const double x) {
  return (x >= 0) * 1.0507 + (x < 0) * (1.0507 * 1.6732 * exp(x));
}


x86 assembly (clang, -O0):
<selu_gradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe7e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selu_gradient>:
sub    $0x28,%rsp
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
cmplesd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm3
andpd  %xmm1,%xmm3
movapd %xmm3,0x10(%rsp)
movsd  0xec8(%rip),%xmm1
andpd  %xmm2,%xmm1
movapd %xmm1,(%rsp)
call   1030 <exp@plt>
mulsd  0xeba(%rip),%xmm0
mulsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @selu_gradient(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = fcmp olt double %7, 0.000000e+00
%9 = zext i1 %8 to i32
%10 = sitofp i32 %9 to double
%11 = load double, double* %2
%12 = call double @exp(double %11)
%13 = fmul double 0x3FFC20E55D92575B, %12
%14 = fmul double %10, %13
%15 = call double @llvm.fmuladd.f64(double %6, double 1.050700e+00, double %14)
ret double %15
}

LLVM IR (-O2):
define double @selu_gradient(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
%4 = fcmp olt double %0, 0.000000e+00
%5 = uitofp i1 %4 to double
%6 = tail call double @exp(double %0)
%7 = fmul double %6, 0x3FFC20E55D92575B
%8 = fmul double %7, %5
%9 = tail call double @llvm.fmuladd.f64(double %3, double 1.050700e+00, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ notYet(char *);
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basConvBase() {
  notYet("ConvBase");
  pushNumber(0);
}


x86 assembly (clang, -O0):
<basConvBase>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <notYet@plt>
xor    %edi,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basConvBase>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <notYet@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ConvBase\00"
define void @basConvBase() {
%1 = call i32 @notYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @pushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ConvBase\00"
define void @basConvBase() {
%1 = tail call i32 @notYet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @pushNumber(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testLU();
int main() { testLU(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testLU@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testLU()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testLU()
ret i32 0
}
/* Type definitions */
struct pot {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ecs_info(char *);
scalar_t__ pot_next(struct pot *);
int /*<<< orphan*/ pot_reject(struct pot *);
char *scene_file(struct pot *);
void cmd_info(struct pot *pot) {
  char *ecs = scene_file(pot);
  while (pot_next(pot))
    pot_reject(pot);
  ecs_info(ecs);
}


x86 assembly (clang, -O0):
<cmd_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <scene_file@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pot_next@plt>
cmp    $0x0,%rax
je     117a <cmd_info+0x3a>
mov    -0x8(%rbp),%rdi
call   1060 <pot_reject@plt>
jmp    1159 <cmd_info+0x19>
mov    -0x10(%rbp),%rdi
call   1040 <ecs_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_info>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <scene_file@plt>
mov    %rax,%r14
nop
mov    %rbx,%rdi
call   1030 <pot_next@plt>
test   %rax,%rax
je     1167 <cmd_info+0x27>
mov    %rbx,%rdi
call   1060 <pot_reject@plt>
jmp    1150 <cmd_info+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ecs_info@plt>

LLVM IR (-O0):
%struct.pot = type { i32 }
define void @cmd_info(%struct.pot* %0) {
%2 = alloca %struct.pot*
%3 = alloca i8*
store %struct.pot* %0, %struct.pot** %2
%4 = load %struct.pot*, %struct.pot** %2
%5 = call i8* @scene_file(%struct.pot* %4)
store i8* %5, i8** %3
br label %6
6: ; preds = %10, %1
%7 = load %struct.pot*, %struct.pot** %2
%8 = call i64 @pot_next(%struct.pot* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load %struct.pot*, %struct.pot** %2
%12 = call i32 @pot_reject(%struct.pot* %11)
br label %6
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = call i32 @ecs_info(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.pot = type { i32 }
define void @cmd_info(%struct.pot* %0) {
%2 = tail call i8* @scene_file(%struct.pot* %0)
%3 = tail call i64 @pot_next(%struct.pot* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = tail call i32 @pot_reject(%struct.pot* %0)
%7 = tail call i64 @pot_next(%struct.pot* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
%10 = tail call i32 @ecs_info(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ffxmsg(int, char *);
void ffpmsg(const char *err_message) {
  ffxmsg(5, (char *)err_message);
  return;
}


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

x86 assembly (clang, -O2):
<ffpmsg>:
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <ffxmsg@plt>

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

LLVM IR (-O2):
define void @ffpmsg(i8* %0) {
%2 = tail call i32 @ffxmsg(i32 5, i8* %0)
ret void
}
char *strcat(char *strDest, const char *strSource) {
  char *res;
  res = strDest;
  while (*strDest++)
    ;
  while (*strDest++ = *strSource++)
    ;
  return res;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1131 <strcat+0x31>
jmp    1114 <strcat+0x14>
jmp    1136 <strcat+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1165 <strcat+0x65>
jmp    1136 <strcat+0x36>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %12, %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
br label %14
14: ; preds = %21, %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8, i8* %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
%20 = icmp ne i8 %17, 0
br i1 %20, label %21, label %22
21: ; preds = %14
br label %14
22: ; preds = %14
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %5, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int get_l_offset(int r) {
  switch (r) {
  case 0:
    return 0;
  case 1:
    return 2;
  case 2:
    return 4;
  case 3:
    return 6;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_l_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     115c <get_l_offset+0x5c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1163 <get_l_offset+0x63>
movl   $0x2,-0x4(%rbp)
jmp    1163 <get_l_offset+0x63>
movl   $0x4,-0x4(%rbp)
jmp    1163 <get_l_offset+0x63>
movl   $0x6,-0x4(%rbp)
jmp    1163 <get_l_offset+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_l_offset>:
lea    (%rdi,%rdi,1),%ecx
cmp    $0x4,%edi
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_l_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 0, i32* %2
br label %10
6: ; preds = %1
store i32 2, i32* %2
br label %10
7: ; preds = %1
store i32 4, i32* %2
br label %10
8: ; preds = %1
store i32 6, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_l_offset(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = shl i32 %0, 1
%4 = select i1 %2, i32 %3, i32 -1
ret i32 %4
}
/* Variables and functions */
void *best_fit_alloc(int);
int count_extfrag();
int /*<<< orphan*/ dealloc(void *);
int /*<<< orphan*/ memory_init(int, int);
int /*<<< orphan*/ printf(char *, void *);
int main(int argc, char *argv[]) {
  int num = 0;
  void *p;
  memory_init(1024, 1);
  p = best_fit_alloc(8);
  printf("p=%p\n", p);
  if (p != NULL) {
    dealloc(p);
  }
  num = count_extfrag();
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
mov    $0x400,%edi
mov    $0x1,%esi
call   1030 <memory_init@plt>
mov    $0x8,%edi
call   1060 <best_fit_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
je     11ae <main+0x5e>
mov    -0x20(%rbp),%rdi
call   1040 <dealloc@plt>
mov    $0x0,%al
call   1070 <count_extfrag@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
mov    $0x1,%esi
call   1030 <memory_init@plt>
mov    $0x8,%edi
call   1060 <best_fit_alloc@plt>
mov    %rax,%rbx
lea    0xe8c(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
test   %rbx,%rbx
je     1189 <main+0x39>
mov    %rbx,%rdi
call   1040 <dealloc@plt>
xor    %eax,%eax
call   1070 <count_extfrag@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"p=%p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 @memory_init(i32 1024, i32 1)
%9 = call i8* @best_fit_alloc(i32 8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %7
%16 = call i32 @dealloc(i8* %15)
br label %17
17: ; preds = %14, %2
%18 = call i32 (...) @count_extfrag()
store i32 %18, i32* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"p=%p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @memory_init(i32 1024, i32 1)
%4 = tail call i8* @best_fit_alloc(i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i8* %4, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @dealloc(i8* %4)
br label %9
9: ; preds = %7, %2
%10 = tail call i32 (...) @count_extfrag()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
float caller_f32(float (*callback)(float), float value) {
  printf("calling f32 callback\n");
  return callback(value);
}


x86 assembly (clang, -O0):
<caller_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller_f32>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm0
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
jmp    *%rax

LLVM IR (-O0):
@.str = [22 x i8] c"calling f32 callback\0A\00"
define float @caller_f32(float (float)* %0, float %1) {
%3 = alloca float (float)*
%4 = alloca float
store float (float)* %0, float (float)** %3
store float %1, float* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load float (float)*, float (float)** %3
%7 = load float, float* %4
%8 = call float %6(float %7)
ret float %8
}

LLVM IR (-O2):
@str = [21 x i8] c"calling f32 callback\00"
define float @caller_f32(float (float)* nocapture %0, float %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call float %0(float %1)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Refer 9.6 \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Refer 9.6 \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Refer 9.6 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int hasProcess() { return 0; }


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

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

LLVM IR (-O0):
define i32 @hasProcess() {
ret i32 0
}

LLVM IR (-O2):
define i32 @hasProcess() {
ret i32 0
}
/* Variables and functions */
int _monrestart(int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_restart(int val) {
  int ret;
  monLock();
  ret = _monrestart(val);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_restart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x4(%rbp),%edi
call   1030 <_monrestart@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_restart>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %ebx,%edi
call   1030 <_monrestart@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mon_restart(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @monLock()
%5 = load i32, i32* %2
%6 = call i32 @_monrestart(i32 %5)
store i32 %6, i32* %3
%7 = call i32 (...) @monUnlock()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @mon_restart(i32 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_monrestart(i32 %0)
%4 = tail call i32 (...) @monUnlock()
ret i32 %3
}
char *StrCat(char *dest, const char *src) {
  char *str = dest;
  while (*dest != '\0') {
    dest++;
  }
  while ((*dest = *src) != '\0') {
    dest++;
    src++;
  }
  return str;
}


x86 assembly (clang, -O0):
<StrCat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <StrCat+0x35>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <StrCat+0x14>
jmp    113a <StrCat+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <StrCat+0x6f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <StrCat+0x3a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrCat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <StrCat+0x10>
mov    (%rsi),%dl
mov    %dl,-0x1(%rcx)
test   %dl,%dl
je     1142 <StrCat+0x42>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1130 <StrCat+0x30>
ret

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

LLVM IR (-O2):
define i8* @StrCat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %14, %11 ], [ %4, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret i8* %0
}
void test_safelen_simdlen() {
  int i;
#pragma omp target simd simdlen(6) safelen(5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target simd safelen(5) simdlen(6)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_safelen_simdlen>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_safelen_simdlen+0x28>
jmp    111a <test_safelen_simdlen+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_safelen_simdlen+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_safelen_simdlen+0x4c>
jmp    113e <test_safelen_simdlen+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_safelen_simdlen+0x2f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_safelen_simdlen() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
store i32 0, i32* %1
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 16
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %10
17: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @test_safelen_simdlen() {
ret void
}
int f2fs_init_acl(struct inode *inode, struct inode *dir) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @f2fs_init_acl(%struct.inode* %0, %struct.inode* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %3
store %struct.inode* %1, %struct.inode** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @f2fs_init_acl(%struct.inode* nocapture readnone %0, %struct.inode* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int **allocateIntStarArray(int num) {
  int **ptr = (int **)malloc(num * sizeof(int *));
  return ptr;
}


x86 assembly (clang, -O0):
<allocateIntStarArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateIntStarArray>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32** @allocateIntStarArray(i32 %0) {
%2 = alloca i32
%3 = alloca i32**
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32**
store i32** %9, i32*** %3
%10 = load i32**, i32*** %3
ret i32** %10
}

LLVM IR (-O2):
define i32** @allocateIntStarArray(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32**
ret i32** %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_set_name(void *bus,
                                                           const char *name) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_set_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_set_name>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_set_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_set_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
unsigned int hash(char word[]) {
  unsigned int h = 11;
  for (int i = 0; word[i] != '\n' && word[i] != '\0'; i++) {
    h = h * 31 + word[i];
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xb,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1145 <hash+0x45>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <hash+0x55>
jmp    1178 <hash+0x78>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    $0xb,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rdi),%ecx
cmp    $0xa,%ecx
je     112d <hash+0x2d>
test   %cl,%cl
je     112d <hash+0x2d>
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
add    %ecx,%edx
add    $0x1,%rdi
mov    %edx,%eax
jmp    1110 <hash+0x10>
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 11, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %33, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %36
23: ; preds = %21
%24 = load i32, i32* %3
%25 = mul i32 %24, 31
%26 = load i8*, i8** %2
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = add i32 %25, %31
store i32 %32, i32* %3
br label %33
33: ; preds = %23
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %5
36: ; preds = %21
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i64 [ %12, %8 ], [ 0, %1 ]
%4 = phi i32 [ %11, %8 ], [ 11, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %8 [
i8 10, label %7
i8 0, label %7
]
7: ; preds = %2, %2
ret i32 %4
8: ; preds = %2
%9 = sext i8 %6 to i32
%10 = mul i32 %4, 31
%11 = add i32 %10, %9
%12 = add nuw i64 %3, 1
br label %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t _dl(uint8_t *data, uint8_t i) { return (*data << (6 - (i << 1))); }


x86 assembly (clang, -O0):
<_dl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    $0x6,%ecx
sub    %edx,%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl>:
mov    (%rdi),%eax
add    %sil,%sil
mov    $0x6,%cl
sub    %sil,%cl
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @_dl(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 %7, 1
%9 = sub nsw i32 6, %8
%10 = shl i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @_dl(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = mul i32 %1, -2
%5 = add i32 %4, 6
%6 = shl i32 %3, %5
ret i32 %6
}
int pifacedigital_enable_interrupts() { return 0; }


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

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

LLVM IR (-O0):
define i32 @pifacedigital_enable_interrupts() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pifacedigital_enable_interrupts() {
ret i32 0
}
/* Variables and functions */
double fabs(scalar_t__);
scalar_t__ pow(double, double);
int main(int argc, char const *argv[]) {
  if (fabs(pow(2.5, -2.5) - 0.10119) < 0.01) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  0xed2(%rip),%xmm1
call   1040 <pow@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1187 <main+0x67>
movl   $0x0,-0x4(%rbp)
jmp    118e <main+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <fabs@plt>
movsd  0xec0(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @pow(double 2.500000e+00, double -2.500000e+00)
%7 = sitofp i64 %6 to double
%8 = fsub double %7, 1.011900e-01
%9 = fptosi double %8 to i64
%10 = call double @fabs(i64 %9)
%11 = fcmp olt double %10, 1.000000e-02
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @pow(double 2.500000e+00, double -2.500000e+00)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, -1.011900e-01
%6 = fptosi double %5 to i64
%7 = tail call double @fabs(i64 %6)
%8 = fcmp uge double %7, 1.000000e-02
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int findglob(char *);
int findloc(char *);
int findsym(char *s) {
  int y;
  if ((y = findloc(s)) != 0)
    return y;
  return findglob(s);
}


x86 assembly (clang, -O0):
<findsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <findloc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114c <findsym+0x2c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <findsym+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <findglob@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findsym>:
push   %rbx
mov    %rdi,%rbx
call   1040 <findloc@plt>
test   %eax,%eax
je     112f <findsym+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <findglob@plt>

LLVM IR (-O0):
define i32 @findsym(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @findloc(i8* %5)
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @findglob(i8* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @findsym(i8* %0) {
%2 = tail call i32 @findloc(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @findglob(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int vec_i32_asc_compare(const void *p1, const void *p2) {
  const int32_t *pp1 = (const int32_t *)p1;
  const int32_t *pp2 = (const int32_t *)p2;
  if (*pp1 < *pp2)
    return -1;
  if (*pp1 > *pp2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<vec_i32_asc_compare>:
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
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    113c <vec_i32_asc_compare+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <vec_i32_asc_compare+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    115c <vec_i32_asc_compare+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <vec_i32_asc_compare+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_i32_asc_compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @vec_i32_asc_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = icmp sgt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int isarrow(char buf[8]) {
  return buf[0] == '\033' && buf[1] == '[' && buf[2] >= 'A' && buf[2] <= 'D';
}


x86 assembly (clang, -O0):
<isarrow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x1b,%ecx
mov    %al,-0x9(%rbp)
jne    115a <isarrow+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x5b,%ecx
mov    %al,-0x9(%rbp)
jne    115a <isarrow+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x9(%rbp)
jl     115a <isarrow+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x44,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isarrow>:
xor    %eax,%eax
cmpb   $0x1b,(%rdi)
jne    111d <isarrow+0x1d>
cmpb   $0x5b,0x1(%rdi)
jne    111d <isarrow+0x1d>
mov    0x2(%rdi),%cl
cmp    $0x41,%cl
jl     111d <isarrow+0x1d>
xor    %eax,%eax
cmp    $0x45,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @isarrow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 27
br i1 %7, label %8, label %26
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 91
br i1 %13, label %14, label %26
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 68
br label %26
26: ; preds = %20, %14, %8, %1
%27 = phi i1 [ false, %14 ], [ false, %8 ], [ false, %1 ], [ %25, %20 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @isarrow(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 27
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 91
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp sgt i8 %10, 64
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = icmp ult i8 %10, 69
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %8, %4, %1
%16 = phi i32 [ 0, %8 ], [ 0, %4 ], [ 0, %1 ], [ %14, %12 ]
ret i32 %16
}
/* Variables and functions */
scalar_t__ util_saturate_n_no_state(int, int);
int _spack2(int src1, int src2) {
  short s1 = (short)util_saturate_n_no_state(src1, 16);
  short s2 = (short)util_saturate_n_no_state(src2, 16);
  return ((unsigned int)s1 << 16) | (((int)s2) & 0xFFFF);
}


x86 assembly (clang, -O0):
<_spack2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1030 <util_saturate_n_no_state@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x10,%esi
call   1030 <util_saturate_n_no_state@plt>
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%eax
shl    $0x10,%eax
movswl -0xc(%rbp),%ecx
and    $0xffff,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_spack2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    $0x10,%esi
call   1030 <util_saturate_n_no_state@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    $0x10,%esi
call   1030 <util_saturate_n_no_state@plt>
shl    $0x10,%ebx
movzwl %ax,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_spack2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i64 @util_saturate_n_no_state(i32 %7, i32 16)
%9 = trunc i64 %8 to i16
store i16 %9, i16* %5
%10 = load i32, i32* %4
%11 = call i64 @util_saturate_n_no_state(i32 %10, i32 16)
%12 = trunc i64 %11 to i16
store i16 %12, i16* %6
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = shl i32 %14, 16
%16 = load i16, i16* %6
%17 = sext i16 %16 to i32
%18 = and i32 %17, 65535
%19 = or i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @_spack2(i32 %0, i32 %1) {
%3 = tail call i64 @util_saturate_n_no_state(i32 %0, i32 16)
%4 = trunc i64 %3 to i32
%5 = tail call i64 @util_saturate_n_no_state(i32 %1, i32 16)
%6 = trunc i64 %5 to i32
%7 = shl i32 %4, 16
%8 = and i32 %6, 65535
%9 = or i32 %8, %7
ret i32 %9
}
__attribute__((always_)) unsigned int
cpumask_next_and(int n, const struct cpumask *srcp,
                 const struct cpumask *andp) {
  return n + 1;
}


x86 assembly (clang, -O0):
<cpumask_next_and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpumask_next_and>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
%struct.cpumask = type opaque
define i32 @cpumask_next_and(i32 %0, %struct.cpumask* %1, %struct.cpumask* %2) {
%4 = alloca i32
%5 = alloca %struct.cpumask*
%6 = alloca %struct.cpumask*
store i32 %0, i32* %4
store %struct.cpumask* %1, %struct.cpumask** %5
store %struct.cpumask* %2, %struct.cpumask** %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @cpumask_next_and(i32 %0, %struct.cpumask* nocapture readnone %1, %struct.cpumask* nocapture readnone %2) {
%4 = add nsw i32 %0, 1
ret i32 %4
}