xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, c;
  printf("Enter two numbers to add:\n");
  scanf("%d%d", &a, &b);
  c = a + b;
  printf("Sum of entered numbers = %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter two numbers to add:\0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [29 x i8] c"Sum of entered numbers = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [29 x i8] c"Sum of entered numbers = %d\0A\00"
@str = [26 x i8] c"Enter two numbers to add:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
int lower(char uc) {
  uc = ((uc >= 'A') && (uc <= 'Z')) ? ('a' + uc - 'A') : uc;
  return uc;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <lower+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 97, %12
%14 = sub nsw i32 %13, 65
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
%6 = sext i8 %5 to i32
ret i32 %6
}
int f(int *p) {
  int a = *p;
  int *null = 0;
  *null = 5;
  return *p == a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %3
store i32* null, i32** %4
%7 = load i32*, i32** %4
store i32 5, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
void md_cleanup_install(void) {}


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

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

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

LLVM IR (-O2):
define void @md_cleanup_install() {
ret void
}
void foo_2_2_1_2_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_1_1_2_1() {
ret void
}
/* Variables and functions */
long long PAPI_get_virt_cyc();
void papif_get_virt_cyc__(long long *virt_cyc) {
  *virt_cyc = PAPI_get_virt_cyc();
}


x86 assembly (clang, -O0):
<papif_get_virt_cyc__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_get_virt_cyc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_get_virt_cyc__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_virt_cyc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_get_virt_cyc__(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_get_virt_cyc()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @papif_get_virt_cyc__(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_virt_cyc()
store i64 %2, i64* %0
ret void
}
void rop3_127_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_127_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_127_1_0>:
not    %sil
or     %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_127_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int strlen(char const *);
char *strncpy(char *, char const *, size_t);
char *ms_copy_str(const char *str) {
  char *result = 0;
  size_t len;
  if (str == 0)
    return result;
  len = strlen(str) + 1;
  result = (char *)malloc(len * sizeof(char));
  return strncpy(result, str, len);
}


x86 assembly (clang, -O0):
<ms_copy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <ms_copy_str+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1194 <ms_copy_str+0x64>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_copy_str>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1163 <ms_copy_str+0x33>
mov    %rdi,%rbx
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
jmp    1166 <ms_copy_str+0x36>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ms_copy_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i8* @strncpy(i8* dereferenceable(1) %8, i8* %0, i64 %6)
br label %10
10: ; preds = %1, %3
%11 = phi i8* [ %8, %3 ], [ null, %1 ]
ret i8* %11
}
int int_to_d6(int x) { return x * (1 << 6); }


x86 assembly (clang, -O0):
<int_to_d6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_d6>:
mov    %edi,%eax
shl    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @int_to_d6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 64
ret i32 %4
}

LLVM IR (-O2):
define i32 @int_to_d6(i32 %0) {
%2 = shl nsw i32 %0, 6
ret i32 %2
}
int cfs_size_round4(int val) { return (val + 3) & (~0x3); }


x86 assembly (clang, -O0):
<cfs_size_round4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_size_round4>:
lea    0x3(%rdi),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @cfs_size_round4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
%5 = and i32 %4, -4
ret i32 %5
}

LLVM IR (-O2):
define i32 @cfs_size_round4(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = and i32 %2, -4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DMA1_DMA17_DriverIRQHandler();
__attribute__((weak)) void DMA1_DMA17_IRQHandler(void) {
  DMA1_DMA17_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA1_DMA17_IRQHandler() {
%1 = call i32 (...) @DMA1_DMA17_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_DMA17_IRQHandler() {
%1 = tail call i32 (...) @DMA1_DMA17_DriverIRQHandler()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(void) {
  int *p = (int *)malloc(sizeof(int));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
ret i32 0
}
char to_hex(char code) {
  static const char hex[] = "0123456789abcdef";
  return hex[code & 0x0f];
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@to_hex.hex = internal constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@to_hex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
void *test_anti_range_57(unsigned long n) {
  extern void *alloc_anti_range_57(unsigned long)
      __attribute__((alloc_size(1)));
  if ((0x7fffffffffffffffL * 2LU + 1) - 1 <= n &&
      n <= (0x7fffffffffffffffL * 2LU + 1) - 1)
    n = (0x7fffffffffffffffL * 2LU + 1) - 1 - 1;
  return alloc_anti_range_57(n);
}


x86 assembly (clang, -O0):
<test_anti_range_57>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xfffffffffffffffe,%rax
cmp    -0x8(%rbp),%rax
ja     1140 <test_anti_range_57+0x30>
cmpq   $0xfffffffffffffffe,-0x8(%rbp)
ja     1140 <test_anti_range_57+0x30>
movq   $0xfffffffffffffffd,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_57@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_57>:
cmp    $0xfffffffffffffffe,%rdi
mov    $0xfffffffffffffffd,%rax
cmove  %rax,%rdi
jmp    1030 <alloc_anti_range_57@plt>

LLVM IR (-O0):
define i8* @test_anti_range_57(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 -2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ule i64 %6, -2
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -3, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_57(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_57(i64 %0) {
%2 = icmp eq i64 %0, -2
%3 = select i1 %2, i64 -3, i64 %0
%4 = tail call i8* @alloc_anti_range_57(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
void error(char *msg, int should_exit) {
  perror(msg);
  fflush(stdout);
  if (exit) {
    exit(1);
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1165 <error+0x35>
jmp    116f <error+0x3f>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <perror@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @error(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 = call i32 @perror(i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
br i1 true, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @error(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @perror(i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_E3uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E3uint8_mem>:
testb  $0x1d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E3uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -227
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 29
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *info, size_t size,
                                    void *data),
                    void *data) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

LLVM IR (-O0):
%struct.dl_phdr_info = type opaque
@ENOSYS = global i32 0
define i32 @dl_iterate_phdr(i32 (%struct.dl_phdr_info*, i64, i8*)* %0, i8* %1) {
%3 = alloca i32 (%struct.dl_phdr_info*, i64, i8*)*
%4 = alloca i8*
store i32 (%struct.dl_phdr_info*, i64, i8*)* %0, i32 (%struct.dl_phdr_info*, i64, i8*)** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.dl_phdr_info = type opaque
@ENOSYS = global i32 0
define i32 @dl_iterate_phdr(i32 (%struct.dl_phdr_info*, i64, i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
long PEOPS_SPUtest(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @PEOPS_SPUtest() {
ret i64 0
}

LLVM IR (-O2):
define i64 @PEOPS_SPUtest() {
ret i64 0
}
int abs(int i) {
  if (i < 0)
    i *= -1;
  return i;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <abs+0x18>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void swi_hdlr(void) { asm volatile("nop \n"); }


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

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

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

LLVM IR (-O2):
define void @swi_hdlr() {
tail call void asm sideeffect "nop \0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int strcmp(const char *lhs, const char *rhs) {
  int ret;
  while (1) {
    if ((ret = *lhs - *rhs) != 0)
      return ret;
    if (*lhs == '\0')
      return 0;
    lhs++;
    rhs++;
  }
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1133 <strcmp+0x33>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <strcmp+0x6c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114f <strcmp+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    116c <strcmp+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
movsbl (%rdi),%ecx
movsbl (%rsi),%edx
mov    %ecx,%eax
sub    %edx,%eax
jne    1138 <strcmp+0x38>
test   %cl,%cl
je     1138 <strcmp+0x38>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rdi,%rcx,1),%edx
movsbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1138 <strcmp+0x38>
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcmp+0x20>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
%8 = icmp ne i32 %7, 0
%9 = icmp eq i8 %3, 0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %24, label %11
11: ; preds = %2, %11
%12 = phi i8* [ %15, %11 ], [ %1, %2 ]
%13 = phi i8* [ %14, %11 ], [ %0, %2 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = load i8, i8* %15
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = icmp eq i8 %16, 0
%23 = select i1 %21, i1 true, i1 %22
br i1 %23, label %24, label %11
24: ; preds = %11, %2
%25 = phi i32 [ %7, %2 ], [ %20, %11 ]
ret i32 %25
}
int is_plus_or_minus(char c) { return c == '+' || c == '-'; }


x86 assembly (clang, -O0):
<is_plus_or_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_plus_or_minus+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_plus_or_minus>:
add    $0xd5,%dil
xor    %eax,%eax
test   $0xfd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_plus_or_minus(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_plus_or_minus(i8 signext %0) {
%2 = icmp eq i8 %0, 43
%3 = icmp eq i8 %0, 45
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reqdone(struct client *);
int /*<<< orphan*/ strlen(char *);
void reqhdr(struct client *c, char *line) {
  if (!strlen(line)) {
    reqdone(c);
    return;
  }
}


x86 assembly (clang, -O0):
<reqhdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    114b <reqhdr+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <reqdone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reqhdr>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
je     1132 <reqhdr+0x12>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <reqdone@plt>

LLVM IR (-O0):
%struct.client = type { i32 }
define void @reqhdr(%struct.client* %0, i8* %1) {
%3 = alloca %struct.client*
%4 = alloca i8*
store %struct.client* %0, %struct.client** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strlen(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load %struct.client*, %struct.client** %3
%10 = call i32 @reqdone(%struct.client* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.client = type { i32 }
define void @reqhdr(%struct.client* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @reqdone(%struct.client* %0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
char *xstrdup(char *);
char *iconv_rcc(char *str) { return xstrdup(str); }


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

x86 assembly (clang, -O2):
<iconv_rcc>:
jmp    1030 <xstrdup@plt>

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

LLVM IR (-O2):
define i8* @iconv_rcc(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
size_t strhash(const char *str) {
  size_t hash = 0;
  for (; *str; str++)
    hash = (hash * 1664525) + (unsigned char)(*str) + 1013904223;
  return hash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <strhash+0x4a>
imul   $0x19660d,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %rcx,%rax
add    $0x3c6ef35f,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <strhash+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x19660d,%rax,%rax
movzbl %cl,%ecx
add    %rcx,%rax
add    $0x3c6ef35f,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 1664525
%9 = zext i8 %5 to i64
%10 = add i64 %8, 1013904223
%11 = add i64 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %16
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_dobldobl_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(238, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_dobldobl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xee,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_dobldobl_data>:
mov    $0xee,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_dobldobl_data() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 238, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_dobldobl_data() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 238, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ info(char *);
void __attribute__((noreturn)) fatal(void) {
  info("FLASH did not complete successfully; exiting with failure status (1)");
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <info@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <info@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"FLASH did not complete successfully; exiting with failure status (1)\00"
define void @fatal() {
%1 = call i32 @info(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [69 x i8] c"FLASH did not complete successfully; exiting with failure status (1)\00"
define void @fatal() {
%1 = tail call i32 @info(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ acc_create(int *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int i;
#pragma acc enter data create(i)
  fprintf(stderr, "CheCKpOInT\n");
  acc_create(&i, sizeof i);
  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)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <acc_create@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <acc_create@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @acc_create(i32* %6, i32 4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @acc_create(i32* %3, i32 4)
ret i32 0
}
/* Variables and functions */
int SIGINT;
void sigHandler(int sig) {
  if (sig == SIGINT) {
    return;
  }
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    111e <sigHandler+0x1e>
jmp    111e <sigHandler+0x1e>
pop    %rbp
ret

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

LLVM IR (-O0):
@SIGINT = global i32 0
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @sigHandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ error(char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void error_exit(const char *str) {
  error(str);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <error@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
call   1030 <error@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @error_exit(i8* %0) {
%2 = tail call i32 @error(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
__attribute__((weak)) void Default_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Default_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_Handler+0x9>
jmp    1109 <Default_Handler+0x9>

x86 assembly (clang, -O2):
<Default_Handler>:
jmp    1100 <Default_Handler>

LLVM IR (-O0):
define weak void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int absolute(int value) {
  if (value < 0) {
    return -value;
  } else {
    return value;
  }
}


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <absolute+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <absolute+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absolute(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
struct hash_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ hash_set_slot(struct hash_table *, char *, int /*<<< orphan*/ *);
char *strdup(char *);
char *get_string(struct hash_table *hash, char *buffer) {
  char **slot = (char **)hash_set_slot(hash, buffer, NULL);
  if (!*slot) {
    *slot = strdup(buffer);
    assert(*slot);
  }
  return *slot;
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <hash_set_slot@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1182 <get_string+0x52>
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %edx,%edx
call   1030 <hash_set_slot@plt>
mov    %rax,%rbx
mov    (%rax),%rax
test   %rax,%rax
jne    115f <get_string+0x2f>
mov    %r14,%rdi
call   1050 <strdup@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
call   1040 <assert@plt>
mov    (%rbx),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.hash_table = type { i32 }
define i8* @get_string(%struct.hash_table* %0, i8* %1) {
%3 = alloca %struct.hash_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.hash_table* %0, %struct.hash_table** %3
store i8* %1, i8** %4
%6 = load %struct.hash_table*, %struct.hash_table** %3
%7 = load i8*, i8** %4
%8 = call i64 @hash_set_slot(%struct.hash_table* %6, i8* %7, i32* null)
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %5
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %20, label %13
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i8* @strdup(i8* %14)
%16 = load i8**, i8*** %5
store i8* %15, i8** %16
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %17
%19 = call i32 @assert(i8* %18)
br label %20
20: ; preds = %13, %2
%21 = load i8**, i8*** %5
%22 = load i8*, i8** %21
ret i8* %22
}

LLVM IR (-O2):
%struct.hash_table = type { i32 }
define i8* @get_string(%struct.hash_table* %0, i8* %1) {
%3 = tail call i64 @hash_set_slot(%struct.hash_table* %0, i8* %1, i32* null)
%4 = inttoptr i64 %3 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = tail call i8* @strdup(i8* %1)
store i8* %8, i8** %4
%9 = tail call i32 @assert(i8* %8)
%10 = load i8*, i8** %4
br label %11
11: ; preds = %7, %2
%12 = phi i8* [ %10, %7 ], [ %5, %2 ]
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ readData();
int32_t LCDIntf_ReadData(void) { return readData(); }


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

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

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

LLVM IR (-O2):
define i32 @LCDIntf_ReadData() {
%1 = tail call i32 (...) @readData()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, size_t);
size_t strlen(char *);
char *strdel(char *str, size_t len) {
  size_t length = strlen(str);
  if (len > length)
    len = length;
  memmove(str, str + len, length - len + 1);
  return str;
}


x86 assembly (clang, -O0):
<strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1153 <strdel+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdel>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    %rbx,%rax
cmovb  %rax,%rbx
lea    (%r14,%rbx,1),%rsi
sub    %rbx,%rax
lea    0x1(%rax),%rdx
mov    %r14,%rdi
call   1040 <memmove@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdel(i8* returned %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp ult i64 %3, %1
%5 = select i1 %4, i64 %3, i64 %1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = add i64 %3, 1
%8 = sub i64 %7, %5
%9 = tail call i32 @memmove(i8* %0, i8* %6, i64 %8)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void _close_fds() {
  close(0);
  close(1);
  close(2);
}


x86 assembly (clang, -O0):
<_close_fds>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close_fds>:
push   %rax
xor    %edi,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @_close_fds() {
%1 = call i32 @close(i32 0)
%2 = call i32 @close(i32 1)
%3 = call i32 @close(i32 2)
ret void
}

LLVM IR (-O2):
define void @_close_fds() {
%1 = tail call i32 @close(i32 0)
%2 = tail call i32 @close(i32 1)
%3 = tail call i32 @close(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello, World!\n");
  exit(0);
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
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 i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
char *astrncpy(char *s, char *ct, int n) {
  char *out = s;
  while (n-- && (*s++ = *ct++))
    ;
  return out;
}


x86 assembly (clang, -O0):
<astrncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     115e <astrncpy+0x5e>
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)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    116e <astrncpy+0x6e>
jmp    1173 <astrncpy+0x73>
jmp    1117 <astrncpy+0x17>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrncpy>:
mov    %rdi,%rax
mov    %edx,%edi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %edx,%edi
je     1123 <astrncpy+0x23>
movzbl (%rsi,%rdx,1),%ecx
mov    %cl,(%rax,%rdx,1)
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <astrncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @astrncpy(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %1, %3 ], [ %11, %9 ]
%6 = phi i32 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp eq i32 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add nsw i32 %6, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ kexit();
int sys_exit(void) {
  kexit();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sys_exit() {
%1 = tail call i32 (...) @kexit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f6();
void f5() { f6(); }


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

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

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

LLVM IR (-O2):
define void @f5() {
%1 = tail call i32 (...) @f6()
ret void
}