xunge/DecIR huggingface dataset:
/* Variables and functions */
int __real_puts(char const *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int __wrap_puts(const char *str) {
  printf("puts:chars#:%lu\n", strlen(str));
  int result = __real_puts(str);
  return result;
}


x86 assembly (clang, -O0):
<__wrap_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__real_puts@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_puts>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <__real_puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"puts:chars#:%lu\0A\00"
define i32 @__wrap_puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @__real_puts(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"puts:chars#:%lu\0A\00"
define i32 @__wrap_puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @__real_puts(i8* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printSampleRateError() {
  fprintf(stderr, "Incompatible sample rates in sounds\n");
}


x86 assembly (clang, -O0):
<printSampleRateError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSampleRateError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Incompatible sample rates in sounds\0A\00"
define void @printSampleRateError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Incompatible sample rates in sounds\0A\00"
define void @printSampleRateError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ compareSub(char *, char *, int);
char *compare_equalSub() {
  do {
    if (!(compareSub("Hello1", "Hello2", 5) == 0))
      return "Compare equal sub strings";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<compare_equalSub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x5,%edx
call   1030 <compareSub@plt>
cmp    $0x0,%rax
je     114a <compare_equalSub+0x3a>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <compare_equalSub+0x47>
jmp    114f <compare_equalSub+0x3f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_equalSub>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
call   1030 <compareSub@plt>
test   %rax,%rax
lea    0xedb(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello1\00"
@.str.1 = [7 x i8] c"Hello2\00"
@.str.2 = [26 x i8] c"Compare equal sub strings\00"
define i8* @compare_equalSub() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i64 @compareSub(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 5)
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello1\00"
@.str.1 = [7 x i8] c"Hello2\00"
@.str.2 = [26 x i8] c"Compare equal sub strings\00"
define i8* @compare_equalSub() {
%1 = tail call i64 @compareSub(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0)
ret i8* %3
}
unsigned int hc_hweight32(unsigned int w) {
  unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
  res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
  return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
}


x86 assembly (clang, -O0):
<hc_hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33333333,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hc_hweight32>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hc_hweight32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 1431655765
%9 = add i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 858993459
%12 = load i32, i32* %3
%13 = lshr i32 %12, 2
%14 = and i32 %13, 858993459
%15 = add i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = and i32 %16, 252645135
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = and i32 %19, 252645135
%21 = add i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = and i32 %22, 16711935
%24 = load i32, i32* %3
%25 = lshr i32 %24, 8
%26 = and i32 %25, 16711935
%27 = add i32 %23, %26
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = and i32 %28, 65535
%30 = load i32, i32* %3
%31 = lshr i32 %30, 16
%32 = and i32 %31, 65535
%33 = add i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @hc_hweight32(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ hstrerror(int /*<<< orphan*/);
int main() {
  hstrerror(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hstrerror(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @hstrerror(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_fs(char *, char *, char *, char *, int /*<<< orphan*/ *,
                           int);
void get_filesystem(char *compression, int clientfd) {
  char *exclude = "--exclude=sys --exclude=proc --exclude=dev "
                  "--exclude=home/elubin/filesystem.tar.gz";
  char *target = "/";
  send_fs(compression, "filesystem.tar.gz", target, exclude, NULL, clientfd);
}


x86 assembly (clang, -O0):
<get_filesystem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xf22(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%r9d
lea    0xef5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <send_fs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesystem>:
mov    %esi,%r9d
lea    0xf27(%rip),%rsi
lea    0xf32(%rip),%rdx
lea    0xed8(%rip),%rcx
xor    %r8d,%r8d
jmp    1030 <send_fs@plt>

LLVM IR (-O0):
@.str = [83 x i8] c"--exclude=sys --exclude=proc --exclude=dev --exclude=home/elubin/filesystem.tar.gz\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [18 x i8] c"filesystem.tar.gz\00"
define void @get_filesystem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %3
%8 = load i8*, i8** %6
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = call i32 @send_fs(i8* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %9, i32* null, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [83 x i8] c"--exclude=sys --exclude=proc --exclude=dev --exclude=home/elubin/filesystem.tar.gz\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [18 x i8] c"filesystem.tar.gz\00"
define void @get_filesystem(i8* %0, i32 %1) {
%3 = tail call i32 @send_fs(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32* null, i32 %1)
ret void
}
int easter_julian(unsigned int y) {
  unsigned int a;
  a = (y % 19 * 19 + 15) % 30;
  return 28 + a - ((y * 5 / 4) + a) % 7;
}


x86 assembly (clang, -O0):
<easter_julian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x13,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x13,%edx,%eax
add    $0xf,%eax
mov    $0x1e,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1c,%eax
mov    %eax,-0xc(%rbp)
imul   $0x5,-0x4(%rbp),%eax
shr    $0x2,%eax
add    -0x8(%rbp),%eax
mov    $0x7,%ecx
xor    %edx,%edx
div    %ecx
mov    -0xc(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<easter_julian>:
mov    %edi,%ecx
mov    $0xaf286bcb,%eax
imul   %rcx,%rax
shr    $0x20,%rax
mov    %edi,%ecx
lea    (%rdi,%rdi,4),%edx
sub    %eax,%edi
shr    %edi
add    %eax,%edi
shr    $0x4,%edi
lea    (%rdi,%rdi,8),%eax
lea    (%rdi,%rax,2),%eax
sub    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
lea    (%rcx,%rax,2),%eax
add    $0xf,%eax
movzwl %ax,%ecx
imul   $0x8889,%ecx,%ecx
shr    $0x14,%ecx
mov    %ecx,%esi
shl    $0x5,%esi
mov    %ecx,%edi
sub    %esi,%edi
add    %ecx,%edi
add    %eax,%edi
movzwl %di,%ecx
shr    $0x2,%edx
add    %edx,%ecx
imul   $0x24924925,%rcx,%rax
shr    $0x20,%rax
sub    %eax,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x2,%ecx
lea    0x0(,%rcx,8),%eax
sub    %ecx,%eax
sub    %edx,%eax
add    $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @easter_julian(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = urem i32 %4, 19
%6 = mul i32 %5, 19
%7 = add i32 %6, 15
%8 = urem i32 %7, 30
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add i32 28, %9
%11 = load i32, i32* %2
%12 = mul i32 %11, 5
%13 = udiv i32 %12, 4
%14 = load i32, i32* %3
%15 = add i32 %13, %14
%16 = urem i32 %15, 7
%17 = sub i32 %10, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @easter_julian(i32 %0) {
%2 = urem i32 %0, 19
%3 = trunc i32 %2 to i16
%4 = mul nuw nsw i16 %3, 19
%5 = add nuw nsw i16 %4, 15
%6 = urem i16 %5, 30
%7 = zext i16 %6 to i32
%8 = add nuw nsw i32 %7, 28
%9 = mul i32 %0, 5
%10 = lshr i32 %9, 2
%11 = add nuw nsw i32 %10, %7
%12 = urem i32 %11, 7
%13 = sub nuw nsw i32 %8, %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_min_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi8(int);
__m128i foo(__m128i x) { return _mm_min_epu8(x, _mm_set1_epi8(10)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <_mm_set1_epi8@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_min_epu8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <_mm_set1_epi8@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_mm_min_epu8@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_set1_epi8(i32 10)
%5 = call i32 @_mm_min_epu8(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @_mm_set1_epi8(i32 10)
%3 = tail call i32 @_mm_min_epu8(i32 %0, i32 %2)
ret i32 %3
}
void PECIDomainValueClear(unsigned long ulBase, unsigned long ulDomain) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000040 + (ulDomain * 4)))) &=
      ~0x0000FFFF;
}


x86 assembly (clang, -O0):
<PECIDomainValueClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
and    $0xffffffffffff0000,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainValueClear>:
andq   $0xffffffffffff0000,0x40(%rdi,%rsi,4)
ff ff
ret

LLVM IR (-O0):
define void @PECIDomainValueClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 64
%7 = load i64, i64* %4
%8 = mul i64 %7, 4
%9 = add i64 %6, %8
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -65536
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @PECIDomainValueClear(i64 %0, i64 %1) {
%3 = add i64 %0, 64
%4 = shl i64 %1, 2
%5 = add i64 %3, %4
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -65536
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Kiss_System_Error();
void *malloc(size_t const);
void *Kiss_Malloc(size_t const size) {
  void *p = malloc(size);
  if (p == NULL) {
    Kiss_System_Error();
  }
  return p;
}


x86 assembly (clang, -O0):
<Kiss_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <Kiss_Malloc+0x2b>
mov    $0x0,%al
call   1030 <Kiss_System_Error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kiss_Malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <Kiss_Malloc+0x15>
xor    %eax,%eax
call   1030 <Kiss_System_Error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @Kiss_Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @Kiss_System_Error()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int pq_equals(char *one, char *two, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (*one != *two) {
      return 1;
    }
    one++;
    two++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pq_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    116a <pq_equals+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1144 <pq_equals+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1171 <pq_equals+0x71>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <pq_equals+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq_equals>:
test   %edx,%edx
jle    1121 <pq_equals+0x21>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1124 <pq_equals+0x24>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <pq_equals+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @pq_equals(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3, %12
%6 = phi i32 [ %15, %12 ], [ 0, %3 ]
%7 = phi i8* [ %14, %12 ], [ %1, %3 ]
%8 = phi i8* [ %13, %12 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = load i8, i8* %7
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %5
17: ; preds = %5, %12, %3
%18 = phi i32 [ 0, %3 ], [ 0, %12 ], [ 1, %5 ]
ret i32 %18
}
ot(ptr) char ptr[];
{
  tab();
  outstr(ptr);
}


x86 assembly (clang, -O0):
<ot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <tab@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <outstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ot>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <tab@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outstr@plt>

LLVM IR (-O0):
define i32 @ot(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @tab()
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @ot(i8* %0) {
%2 = tail call i32 (...) @tab()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool smpte_fec_check_extension(const uint8_t *p_fec) {
  return !!(p_fec[4] & 0x80);
}


x86 assembly (clang, -O0):
<smpte_fec_check_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_check_extension>:
mov    0x10(%rdi),%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_check_extension(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @smpte_fec_check_extension(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
scalar_t__ GenerateFastRandom();
int PRANDInt5(void) {
  int x = (int)GenerateFastRandom() & 0x07;
  return ((x < 5) ? x : x - 5);
}


x86 assembly (clang, -O0):
<PRANDInt5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <GenerateFastRandom@plt>
and    $0x7,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113a <PRANDInt5+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <PRANDInt5+0x33>
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRANDInt5>:
push   %rax
xor    %eax,%eax
call   1030 <GenerateFastRandom@plt>
and    $0x7,%eax
mov    %eax,%ecx
sub    $0x5,%ecx
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PRANDInt5() {
%1 = alloca i32
%2 = call i64 (...) @GenerateFastRandom()
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 7
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %1
br label %12
9: ; preds = %0
%10 = load i32, i32* %1
%11 = sub nsw i32 %10, 5
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @PRANDInt5() {
%1 = tail call i64 (...) @GenerateFastRandom()
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 7
%4 = icmp ult i32 %3, 5
%5 = add nsw i32 %3, -5
%6 = select i1 %4, i32 %3, i32 %5
ret i32 %6
}
/* Type definitions */
typedef unsigned int __u32;

/* Variables and functions */
int v1_check(unsigned int capability, __u32 data) {
  return (1U << (capability)) & data ? 1 : 0;
}


x86 assembly (clang, -O0):
<v1_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
and    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v1_check>:
mov    %esi,%eax
mov    %edi,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @v1_check(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 = shl i32 1, %5
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @v1_check(i32 %0, i32 %1) {
%3 = lshr i32 %1, %0
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t write(int fd, const void *buf, uint32_t size) {
  uint32_t ret;
  asm volatile("syscall"
               : "=a"(ret)
               : "0"(1), "D"(fd), "S"(buf), "d"(size)
               : "cc", "rcx", "r11", "memory");
  return ret;
}


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

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

LLVM IR (-O0):
define i8* @write(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{cc},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 1, i32 %8, i8* %9, i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @write(i32 %0, i8* %1, i8* %2) {
%4 = tail call i8* asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{cc},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 1, i32 %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ cocoa_grclear();
void Fgrclear() { cocoa_grclear(); }


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

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

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

LLVM IR (-O2):
define void @Fgrclear() {
%1 = tail call i32 (...) @cocoa_grclear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void printArgs(char *args[]) {
  int i = 0;
  while (args[i] != NULL) {
    printf("%d %s\n", i, args[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<printArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115f <printArgs+0x4f>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printArgs+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArgs>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rdx
test   %rdx,%rdx
je     1148 <printArgs+0x38>
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x8(%r14,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1130 <printArgs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %s\0A\00"
define void @printArgs(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i32, i32* %3
%13 = load i8**, i8*** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %s\0A\00"
define void @printArgs(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %2, %1 ]
%7 = trunc i64 %5 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %6)
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
int finalize(void *self) { return (1); }


x86 assembly (clang, -O0):
<finalize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @finalize(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
char *safe_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *safe_string_alloc(const char *cp) {
  char *ret = safe_malloc(strlen(cp) + 1);
  strcpy(ret, cp);
  return ret;
}


x86 assembly (clang, -O0):
<safe_string_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <safe_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_string_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1040 <safe_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @safe_string_alloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @safe_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @safe_string_alloc(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @safe_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ _ps2sdk_stdlib_init();
void _ps2sdk_libc_init() { _ps2sdk_stdlib_init(); }


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

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

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

LLVM IR (-O2):
define void @_ps2sdk_libc_init() {
%1 = tail call i32 (...) @_ps2sdk_stdlib_init()
ret void
}
char *cbI25Expand(code, ofs)
char *code;
int ofs;
{
  if (ofs % 2 == 0)
    return (code[ofs] == '1') ? "111" : "1";
  else
    return (code[ofs] == '1') ? "000" : "0";
}


x86 assembly (clang, -O0):
<cbI25Expand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <cbI25Expand+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xed0(%rip),%rax
lea    0xec7(%rip),%rcx
cmp    $0x31,%edx
cmove  %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    116e <cbI25Expand+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xeaa(%rip),%rax
lea    0xea1(%rip),%rcx
cmp    $0x31,%edx
cmove  %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbI25Expand>:
movslq %esi,%rax
cmpb   $0x31,(%rdi,%rax,1)
lea    0xef2(%rip),%rax
lea    0xeed(%rip),%rcx
cmove  %rax,%rcx
lea    0xee4(%rip),%rdx
lea    0xedf(%rip),%rax
cmove  %rdx,%rax
test   $0x1,%sil
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"111\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"000\00"
@.str.3 = [2 x i8] c"0\00"
define i8* @cbI25Expand(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 49
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
store i8* %18, i8** %3
br label %29
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 49
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
store i8* %28, i8** %3
br label %29
29: ; preds = %19, %9
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
@.str = [4 x i8] c"111\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"000\00"
@.str.3 = [2 x i8] c"0\00"
define i8* @cbI25Expand(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 49
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%10 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%11 = select i1 %4, i8* %9, i8* %10
ret i8* %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long drawable;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
void set_XNoExposeEvent_drawable(void *_p, unsigned long _v) {
  ((XNoExposeEvent *)_p)->drawable = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XNoExposeEvent_drawable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XNoExposeEvent_drawable>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XNoExposeEvent_drawable(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XNoExposeEvent_drawable(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void curl_global_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @curl_global_cleanup() {
ret void
}
int is_palindrome(int number) {
  int original = number, reversed = 0;
  for (; number > 0; number /= 10) {
    reversed = reversed * 10 + number % 10;
  }
  return original == reversed;
}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114b <is_palindrome+0x4b>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1114 <is_palindrome+0x14>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
xor    %edx,%edx
test   %edi,%edi
jle    1133 <is_palindrome+0x33>
mov    $0xcccccccd,%r8d
mov    %edi,%ecx
xchg   %ax,%ax
lea    (%rdx,%rdx,4),%r9d
mov    %ecx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
lea    (%rdx,%r9,2),%edx
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1110 <is_palindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_palindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 10
%12 = load i32, i32* %2
%13 = srem i32 %12, 10
%14 = add nsw i32 %11, %13
store i32 %14, i32* %4
br label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = sdiv i32 %16, 10
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_palindrome(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
%13 = icmp eq i32 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void inthandler(int sig) {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<inthandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<inthandler>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @inthandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @inthandler(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
const char *_Locale_d_t_fmt(struct _Locale_time *ltime
                            __attribute__((__unused__))) {
  return "%m/%d/%y";
}


x86 assembly (clang, -O0):
<_Locale_d_t_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_d_t_fmt>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_time = type opaque
@.str = [9 x i8] c"%m/%d/%y\00"
define i8* @_Locale_d_t_fmt(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
@.str = [9 x i8] c"%m/%d/%y\00"
define i8* @_Locale_d_t_fmt(%struct._Locale_time* nocapture readnone %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
unsigned insert_rca(insn, value, errmsg)
unsigned insn;
int value __attribute__((unused));
const char **errmsg __attribute__((unused));
{ return insn | ((insn >> 21) & 0x1f); }


x86 assembly (clang, -O0):
<insert_rca>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x15,%ecx
and    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_rca>:
mov    %edi,%eax
shr    $0x15,%eax
and    $0x1f,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @insert_rca(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = lshr i32 %8, 21
%10 = and i32 %9, 31
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @insert_rca(i32 %0, i32 %1, i8** nocapture readnone %2) {
%4 = lshr i32 %0, 21
%5 = and i32 %4, 31
%6 = or i32 %5, %0
ret i32 %6
}
void fips_handler(struct cc_drvdata *drvdata) {}


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

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

LLVM IR (-O0):
%struct.cc_drvdata = type opaque
define void @fips_handler(%struct.cc_drvdata* %0) {
%2 = alloca %struct.cc_drvdata*
store %struct.cc_drvdata* %0, %struct.cc_drvdata** %2
ret void
}

LLVM IR (-O2):
%struct.cc_drvdata = type opaque
define void @fips_handler(%struct.cc_drvdata* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ incrementar(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 9;
  incrementar(&num);
  printf("%d", num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x9,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <incrementar@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
%3 = call i32 @incrementar(i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 9, i32* %1
%3 = call i32 @incrementar(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void startroutine(int id, void *(*routine)(void *), void *arg) {}


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

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

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

LLVM IR (-O2):
define void @startroutine(i32 %0, i8* (i8*)* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *safe_realloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (!ret) {
    fprintf(stderr, "autoupdater: error: failed to allocate memory\n");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <safe_realloc+0x48>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rax
call   1050 <realloc@plt>
test   %rax,%rax
je     113d <safe_realloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"autoupdater: error: failed to allocate memory\0A\00"
define i8* @safe_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"autoupdater: error: failed to allocate memory\0A\00"
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int booster_xstat64(int, char const *, void *);
int __xstat64(int ver, const char *path, void *buf) {
  return booster_xstat64(ver, path, buf);
}


x86 assembly (clang, -O0):
<__xstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <booster_xstat64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xstat64>:
jmp    1030 <booster_xstat64@plt>

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

LLVM IR (-O2):
define i32 @__xstat64(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @booster_xstat64(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
int islenchar(int c) {
  switch (c) {
  case '\t':
  case '\v':
  case '\f':
  case ' ':
  case '\r':
  case '\n':
  case ';':
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<islenchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     1140 <islenchar+0x40>
jmp    111e <islenchar+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1140 <islenchar+0x40>
jmp    112f <islenchar+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
jne    114c <islenchar+0x4c>
jmp    1140 <islenchar+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1153 <islenchar+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islenchar>:
cmp    $0x3b,%edi
ja     111a <islenchar+0x1a>
xor    %eax,%eax
mov    %edi,%ecx
movabs $0x800000100003e00,%rdx
bt     %rcx,%rdx
jae    111a <islenchar+0x1a>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @islenchar(i32 %0) {
switch i32 %0, label %2 [
i32 9, label %3
i32 11, label %3
i32 12, label %3
i32 32, label %3
i32 13, label %3
i32 10, label %3
i32 59, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}