xunge/DecIR huggingface dataset:
/* Variables and functions */
int stb_prefix_count(char *s, char *t) {
  int c = 0;
  while (*t) {
    if (*s++ != *t++)
      break;
    ++c;
  }
  return c;
}


x86 assembly (clang, -O0):
<stb_prefix_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <stb_prefix_count+0x5f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <stb_prefix_count+0x51>
jmp    115f <stb_prefix_count+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <stb_prefix_count+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_prefix_count>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <stb_prefix_count+0x22>
nopl   0x0(%rax,%rax,1)
cmp    %cl,(%rdi,%rax,1)
jne    1122 <stb_prefix_count+0x22>
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <stb_prefix_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @stb_prefix_count(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %16, %12 ], [ %3, %2 ]
%7 = phi i32 [ %15, %12 ], [ 0, %2 ]
%8 = phi i8* [ %13, %12 ], [ %1, %2 ]
%9 = phi i8* [ %14, %12 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %6
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = add nuw nsw i32 %7, 1
%16 = load i8, i8* %13
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %12, %5, %2
%19 = phi i32 [ 0, %2 ], [ %7, %5 ], [ %15, %12 ]
ret i32 %19
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void LCDRasterSubPanelDisable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44050000);
  (*((volatile uint32_t *)(ui32Base + 0x00000038))) &= ~0x80000000;
}


x86 assembly (clang, -O0):
<LCDRasterSubPanelDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%ecx
and    $0x7fffffff,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterSubPanelDisable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x44050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0x7fffffff,0x38(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @LCDRasterSubPanelDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141178368
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 56
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 2147483647
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @LCDRasterSubPanelDisable(i32 %0) {
%2 = icmp eq i32 %0, 1141178368
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 56
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 2147483647
store volatile i32 %9, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpge_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpge_sd(__m128d __a, __m128d __b) {
  return _mm_cmpge_sd(__a, __b);
}


x86 assembly (clang, -O0):
<test_mm_cmpge_sd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_cmpge_sd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpge_sd>:
jmp    1030 <_mm_cmpge_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpge_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpge_sd(i32 %0, i32 %1)
ret i32 %3
}
int sysfs_create_dir(struct kobject *kobj) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_create_dir(%struct.kobject* nocapture readnone %0) {
ret i32 0
}
int gcd(int a, int b) {
  int i;
  while (b != 0) {
    i = a % b;
    a = b;
    b = i;
  }
  return (a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ smashable(char *);
int main(int argc, char **argv) {
  if (argc != 2)
    return 1;
  smashable(argv[1]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1150 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <smashable@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1123 <main+0x13>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <smashable@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @smashable(i8* %6)
br label %8
8: ; preds = %2, %4
ret i32 1
}
/* Variables and functions */
int vlist_def_att(int, int, int, int, char const *, size_t, size_t,
                  double const *);
int vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len,
                   const double *dp) {
  return vlist_def_att(252, type, vlistID, varID, name, (size_t)len,
                       (size_t)len * sizeof(double), dp);
}


x86 assembly (clang, -O0):
<vlistDefAttFlt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
movslq -0x18(%rbp),%r9
movslq -0x18(%rbp),%r10
shl    $0x3,%r10
mov    -0x20(%rbp),%rax
mov    $0xfc,%edi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vlist_def_att@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistDefAttFlt>:
push   %rbx
mov    %r9,%r10
mov    %rdx,%r11
mov    %esi,%eax
mov    %edi,%edx
movslq %r8d,%r9
lea    0x0(,%r9,8),%rbx
mov    $0xfc,%edi
mov    %ecx,%esi
mov    %eax,%ecx
mov    %r11,%r8
push   %r10
push   %rbx
call   1030 <vlist_def_att@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vlistDefAttFlt(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double* %5, double** %12
%13 = load i32, i32* %10
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = load double*, double** %12
%23 = call i32 @vlist_def_att(i32 252, i32 %13, i32 %14, i32 %15, i8* %16, i64 %18, i64 %21, double* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @vlistDefAttFlt(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, double* %5) {
%7 = sext i32 %4 to i64
%8 = shl nsw i64 %7, 3
%9 = tail call i32 @vlist_def_att(i32 252, i32 %3, i32 %0, i32 %1, i8* %2, i64 %7, i64 %8, double* %5)
ret i32 %9
}
void *list_all_obj() {}


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

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

LLVM IR (-O0):
define i8* @list_all_obj() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @list_all_obj() {
ret i8* undef
}
/* Variables and functions */
double runif();
int rbernoulli(double prob) {
  double u = runif();
  if (u < prob) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<rbernoulli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <runif@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <rbernoulli+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1150 <rbernoulli+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbernoulli>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <runif@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rbernoulli(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = call double (...) @runif()
store double %5, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @rbernoulli(double %0) {
%2 = tail call double (...) @runif()
%3 = fcmp olt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_getstack(const pthread_attr_t *__restrict __attr,
                          void **__restrict __stackaddr,
                          size_t *__restrict __stacksize) {
  ;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_getstack(i32* noalias nocapture readnone %0, i8** noalias nocapture readnone %1, i64* noalias nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long int n;
  scanf("%lld", &n);
  if ((n < 0) || (n & (n - 1)) == 0) {
    printf("TAK\n");
    return 0;
  }
  printf("NIE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x0,-0x10(%rbp)
jl     1163 <main+0x43>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jne    117b <main+0x5b>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    118e <main+0x6e>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rax
lea    -0x1(%rax),%rcx
test   %rcx,%rax
lea    0xec7(%rip),%rcx
lea    0xebc(%rip),%rdi
cmove  %rcx,%rdi
test   %rax,%rax
cmovs  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [5 x i8] c"TAK\0A\00"
@.str.2 = [5 x i8] c"NIE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = load i64, i64* %2
%8 = load i64, i64* %2
%9 = sub nsw i64 %8, 1
%10 = and i64 %7, %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %6, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %16
14: ; preds = %6
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@str = [4 x i8] c"NIE\00"
@str.3 = [4 x i8] c"TAK\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 0
%6 = call i64 @llvm.ctpop.i64(i64 %4)
%7 = icmp ult i64 %6, 2
%8 = or i1 %5, %7
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
int Operand_frs_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_frs_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void chopPath(char *filePath) {
  int lastIndex;
  if (*filePath == '\0') {
    return;
  }
  lastIndex = strlen(filePath) - 1;
  if (filePath[lastIndex] == '/') {
    filePath[lastIndex] = '\0';
  }
}


x86 assembly (clang, -O0):
<chopPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1131 <chopPath+0x21>
jmp    1161 <chopPath+0x51>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1161 <chopPath+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chopPath>:
push   %rbx
cmpb   $0x0,(%rdi)
je     112c <chopPath+0x1c>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    112c <chopPath+0x1c>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @chopPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %25
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %11, 1
store i32 %12, 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 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 47
br i1 %19, label %20, label %25
20: ; preds = %9
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %25
25: ; preds = %8, %20, %9
ret void
}

LLVM IR (-O2):
define void @chopPath(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 47
br i1 %10, label %11, label %12
11: ; preds = %4
store i8 0, i8* %8
br label %12
12: ; preds = %4, %11, %1
ret void
}
/* Type definitions */
typedef scalar_t__ u_int32_t;
typedef int int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fread(void *, int, scalar_t__, int /*<<< orphan*/ *);
int32_t _pst_get(FILE *fp, void *buf, u_int32_t size) {
  {};
  if (fread(buf, 1, size, fp) < size) {
    {};
    return 1;
  }
  {};
  return 0;
}


x86 assembly (clang, -O0):
<_pst_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x20(%rbp),%rax
jge    1150 <_pst_get+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <_pst_get+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pst_get>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_pst_get(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp slt i64 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned scale2x_generic_output_fmts(unsigned input_fmts) { return input_fmts; }


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

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

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

LLVM IR (-O2):
define i32 @scale2x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int hton32(int);
uint64_t hton64(uint64_t n) {
  return (((uint64_t)hton32(n)) << 32) + hton32(n >> 32);
}


x86 assembly (clang, -O0):
<hton64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hton32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <hton32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hton64>:
push   %rax
call   1030 <hton32@plt>
pop    %rax
jmp    1030 <hton32@plt>

LLVM IR (-O0):
define i32 @hton64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @hton32(i32 %3)
%5 = shl i32 %4, 32
%6 = load i32, i32* %2
%7 = ashr i32 %6, 32
%8 = call i32 @hton32(i32 %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @hton64(i32 %0) {
%2 = tail call i32 @hton32(i32 %0)
%3 = tail call i32 @hton32(i32 poison)
ret i32 poison
}
void logicStartScreen(int delta) {}


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

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

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

LLVM IR (-O2):
define void @logicStartScreen(i32 %0) {
ret void
}
int test_imm_E2int8_reg(signed char val) {
  return ((val) & (-0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff1e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E2int8_reg>:
test   $0xffffff1e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E2int8_reg(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, -226
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_E2int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -226
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int UARTStdDevOpen(void *const pDevObj, const char *pDevName, int Flags,
                   int Mode) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @UARTStdDevOpen(i8* %0, i8* %1, i32 %2, i32 %3) {
%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 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @UARTStdDevOpen(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int strip_suffix_mem(char const *, size_t *, char const *);
size_t strlen(char const *);
int strip_suffix(const char *str, const char *suffix, size_t *len) {
  *len = strlen(str);
  return strip_suffix_mem(str, len, suffix);
}


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

x86 assembly (clang, -O2):
<strip_suffix>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,(%r15)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strip_suffix_mem@plt>

LLVM IR (-O0):
define i32 @strip_suffix(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64* %2, i64** %6
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = load i64*, i64** %6
store i64 %8, i64* %9
%10 = load i8*, i8** %4
%11 = load i64*, i64** %6
%12 = load i8*, i8** %5
%13 = call i32 @strip_suffix_mem(i8* %10, i64* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @strip_suffix(i8* %0, i8* %1, i64* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
store i64 %4, i64* %2
%5 = tail call i32 @strip_suffix_mem(i8* %0, i64* %2, i8* %1)
ret i32 %5
}
char sr_parse_digit(const char **input) {
  char digit = **input;
  if (digit < '0' || digit > '9')
    return '\0';
  ++*input;
  return digit;
}


x86 assembly (clang, -O0):
<sr_parse_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
jl     112e <sr_parse_digit+0x2e>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
jle    1137 <sr_parse_digit+0x37>
movb   $0x0,-0x1(%rbp)
jmp    114b <sr_parse_digit+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_parse_digit>:
mov    (%rdi),%rcx
mov    (%rcx),%al
lea    -0x3a(%rax),%edx
cmp    $0xf6,%dl
jae    1110 <sr_parse_digit+0x10>
xor    %eax,%eax
ret
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define signext i8 @sr_parse_digit(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -58
%5 = icmp ult i8 %4, -10
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %1, %6
%9 = phi i8 [ %3, %6 ], [ 0, %1 ]
ret i8 %9
}
/* Variables and functions */
int abs(int);
void unsigned_int_to_two_bytes(int n, unsigned char *byte_ptr) {
  *byte_ptr = (unsigned char)(abs(n) % 256);
  byte_ptr++;
  *byte_ptr = (unsigned char)(abs(n) / 256);
}


x86 assembly (clang, -O0):
<unsigned_int_to_two_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unsigned_int_to_two_bytes(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @abs(i32 %5)
%7 = srem i32 %6, 256
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
store i8 %8, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i32, i32* %3
%13 = call i32 @abs(i32 %12)
%14 = sdiv i32 %13, 256
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
store i8 %15, i8* %16
ret void
}

LLVM IR (-O2):
define void @unsigned_int_to_two_bytes(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = lshr i32 %3, 8
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t stubFuncIV(void) { return -1; }


x86 assembly (clang, -O0):
<stubFuncIV>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @stubFuncIV() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @stubFuncIV() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ strout_lower(int /*<<< orphan*/ *);
void decout_lower(uint16_t v) {
  char buf[9];
  snprintf(buf, 8, "%d", v);
  strout_lower((uint8_t *)buf);
}


x86 assembly (clang, -O0):
<decout_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x8,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0xd(%rbp),%rdi
call   1040 <strout_lower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decout_lower>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strout_lower@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @decout_lower(i32 %0) {
%2 = alloca i32
%3 = alloca [9 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%8 = bitcast i8* %7 to i32*
%9 = call i32 @strout_lower(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @decout_lower(i32 %0) {
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = bitcast [9 x i8]* %2 to i32*
%6 = call i32 @strout_lower(i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main() {
  char s[30] = "hello world";
  char *t = "getline";
  strncat(s, t, 3);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x14(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x3,%edx
call   1040 <strncat@plt>
lea    -0x30(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee2(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xedb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <strncat@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [30 x i8] c"hello world\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [8 x i8] c"getline\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [30 x i8]* %2 to i8*
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @strncat(i8* %5, i8* %6, i32 3)
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [30 x i8] c"hello world\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [8 x i8] c"getline\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void _OS_EnterWaitModeTO(void) {}


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

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

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

LLVM IR (-O2):
define void @_OS_EnterWaitModeTO() {
ret void
}
void wifi_evt_sme_wps_stopped(
    const struct wifi_msg_sme_wps_stopped_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_wps_stopped_evt_t = type opaque
define void @wifi_evt_sme_wps_stopped(%struct.wifi_msg_sme_wps_stopped_evt_t* nocapture %0) {
ret void
}
void foo613(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo613(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int decode_frame(void *data, int *data_size, uint8_t *buf, int buf_size) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @decode_frame(i8* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @decode_frame(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
char *endofline(char *);
char *getbufend();
char *bufline(char *start, int lines) {
  for (int i = 0; i < lines; i++) {
    start = endofline(start);
    if (start != getbufend())
      start++;
  }
  return start;
}


x86 assembly (clang, -O0):
<bufline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118d <bufline+0x6d>
mov    -0x8(%rbp),%rdi
call   1040 <endofline@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getbufend@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     117a <bufline+0x5a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    117f <bufline+0x5f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <bufline+0x16>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufline>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1150 <bufline+0x30>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
call   1040 <endofline@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <getbufend@plt>
xor    %edi,%edi
cmp    %rax,%r14
setne  %dil
add    %r14,%rdi
add    $0xffffffff,%ebx
jne    1130 <bufline+0x10>
mov    %rdi,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @bufline(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi i8* [ %0, %2 ], [ %13, %6 ]
ret i8* %5
6: ; preds = %2, %6
%7 = phi i32 [ %14, %6 ], [ 0, %2 ]
%8 = phi i8* [ %13, %6 ], [ %0, %2 ]
%9 = tail call i8* @endofline(i8* %8)
%10 = tail call i8* (...) @getbufend()
%11 = icmp ne i8* %9, %10
%12 = zext i1 %11 to i64
%13 = getelementptr i8, i8* %9, i64 %12
%14 = add nuw nsw i32 %7, 1
%15 = icmp eq i32 %14, %1
br i1 %15, label %4, label %6
}
int test_imm_7Cint32_mem(int *val) {
  return ((*val) & (0x7C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Cint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 124
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int min(const int a, const int b) { return a > b ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
char *reshape(char *);
void testThatRemoveDeadBindingsRunBeforeEachCall() {
  char *v = malloc(12);
  v = reshape(v);
  v = reshape(v);
}


x86 assembly (clang, -O0):
<testThatRemoveDeadBindingsRunBeforeEachCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <reshape@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <reshape@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testThatRemoveDeadBindingsRunBeforeEachCall>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
call   1040 <reshape@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <reshape@plt>

LLVM IR (-O0):
define void @testThatRemoveDeadBindingsRunBeforeEachCall() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 12)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @reshape(i8* %3)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i8* @reshape(i8* %5)
store i8* %6, i8** %1
ret void
}

LLVM IR (-O2):
define void @testThatRemoveDeadBindingsRunBeforeEachCall() {
%1 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%2 = tail call i8* @reshape(i8* %1)
%3 = tail call i8* @reshape(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wimlib_set_default_compression_level(int, int);
void set_compress_slow(void) { wimlib_set_default_compression_level(-1, 100); }


x86 assembly (clang, -O0):
<set_compress_slow>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x64,%esi
call   1030 <wimlib_set_default_compression_level@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_compress_slow>:
mov    $0xffffffff,%edi
mov    $0x64,%esi
jmp    1030 <wimlib_set_default_compression_level@plt>

LLVM IR (-O0):
define void @set_compress_slow() {
%1 = call i32 @wimlib_set_default_compression_level(i32 -1, i32 100)
ret void
}

LLVM IR (-O2):
define void @set_compress_slow() {
%1 = tail call i32 @wimlib_set_default_compression_level(i32 -1, i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_string_buffer(char *string_buffer) { free(string_buffer); }


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

x86 assembly (clang, -O2):
<free_string_buffer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_string_buffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void Q() {
  {
    ;
    {
      {
        {
          {
            {
              {
                {
                  {
                    {
                      {
                        {
                          {
                            {
                              {{{{{{{;
                              {
                                {}
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                };
              }
            }
          }
        }
      }
    }
  }
}
}
}
}
}
}
}
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ board_setup_from_fen(struct position *, char *);
int /*<<< orphan*/ valid_position(struct position *);
void board_start_position(struct position *pos) {
  assert(pos != NULL);
  (void)board_setup_from_fen(
      pos, "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
  assert(valid_position(pos));
}


x86 assembly (clang, -O0):
<board_start_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <board_setup_from_fen@plt>
mov    -0x8(%rbp),%rdi
call   1040 <valid_position@plt>
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_start_position>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <board_setup_from_fen@plt>
mov    %rbx,%rdi
call   1040 <valid_position@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.position = type { i32 }
@.str = [57 x i8] c"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\00"
define void @board_start_position(%struct.position* %0) {
%2 = alloca %struct.position*
store %struct.position* %0, %struct.position** %2
%3 = load %struct.position*, %struct.position** %2
%4 = icmp ne %struct.position* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.position*, %struct.position** %2
%8 = call i32 @board_setup_from_fen(%struct.position* %7, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.position*, %struct.position** %2
%10 = call i32 @valid_position(%struct.position* %9)
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
%struct.position = type { i32 }
@.str = [57 x i8] c"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\00"
define void @board_start_position(%struct.position* %0) {
%2 = icmp ne %struct.position* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @board_setup_from_fen(%struct.position* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @valid_position(%struct.position* %0)
%7 = tail call i32 @assert(i32 %6)
ret void
}