xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_cmp(int, int);
int /*<<< orphan*/ emit_orrge_imm(int, int, int);
void emit_cmpge(int s1, int s2, int sr, int temp) {
  emit_andimm(sr, ~1, sr);
  emit_cmp(s2, s1);
  emit_orrge_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_cmpge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <emit_cmp@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_orrge_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmpge>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <emit_cmp@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <emit_orrge_imm@plt>

LLVM IR (-O0):
define void @emit_cmpge(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @emit_andimm(i32 %9, i32 -2, i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @emit_cmp(i32 %12, i32 %13)
%15 = load i32, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @emit_orrge_imm(i32 %15, i32 1, i32 %16)
ret void
}

LLVM IR (-O2):
define void @emit_cmpge(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%6 = tail call i32 @emit_cmp(i32 %1, i32 %0)
%7 = tail call i32 @emit_orrge_imm(i32 %2, i32 1, i32 %2)
ret void
}
/* Variables and functions */
int LZ4_compress_fast(char const *, char *, int, int, int);
int LZ4_compress_default(const char *source, char *dest, int inputSize,
                         int maxOutputSize) {
  return LZ4_compress_fast(source, dest, inputSize, maxOutputSize, 1);
}


x86 assembly (clang, -O0):
<LZ4_compress_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <LZ4_compress_fast@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress_default>:
mov    $0x1,%r8d
jmp    1030 <LZ4_compress_fast@plt>

LLVM IR (-O0):
define i32 @LZ4_compress_default(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
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @LZ4_compress_fast(i8* %9, i8* %10, i32 %11, i32 %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
define i32 @LZ4_compress_default(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @LZ4_compress_fast(i8* %0, i8* %1, i32 %2, i32 %3, i32 1)
ret i32 %5
}
__attribute__((no, noclone)) unsigned short foo13(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(char) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!0) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                      : ((1 << (sizeof(char) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo13>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
jl     1131 <foo13+0x31>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x7e,%eax
jle    113e <foo13+0x3e>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115c <foo13+0x5c>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo13>:
lea    0x1(%rdi),%ecx
cmp    $0x7e,%di
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo13(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 125
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
int euclidean_algorithm_1(int m, int n) {
  while (m != n) {
    if (m > n) {
      m = m - n;
    } else {
      n = n - m;
    }
  }
  return m;
}


x86 assembly (clang, -O0):
<euclidean_algorithm_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113e <euclidean_algorithm_1+0x3e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <euclidean_algorithm_1+0x30>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <euclidean_algorithm_1+0x39>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <euclidean_algorithm_1+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclidean_algorithm_1>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <euclidean_algorithm_1+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <euclidean_algorithm_1+0x10>
ret

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

LLVM IR (-O2):
define i32 @euclidean_algorithm_1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int triplet_ind(char const *);
int chck_triplet(const char *s) { return triplet_ind(s) & 64 ? 0 : 1; }


x86 assembly (clang, -O0):
<chck_triplet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <triplet_ind@plt>
mov    %eax,%edx
and    $0x40,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chck_triplet>:
push   %rax
call   1030 <triplet_ind@plt>
xor    %ecx,%ecx
test   $0x40,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @chck_triplet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @triplet_ind(i8* %3)
%5 = and i32 %4, 64
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @chck_triplet(i8* %0) {
%2 = tail call i32 @triplet_ind(i8* %0)
%3 = lshr i32 %2, 6
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  struct {
    int count : 31;
  } s = {0};
  while (s.count--)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sar    $0x1,%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
and    $0x7fffffff,%edx
and    $0x80000000,%ecx
or     %edx,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1181 <main+0x51>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = bitcast %struct.anon* %2 to i8*
br label %4
4: ; preds = %0
%5 = bitcast %struct.anon* %2 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 1
%8 = ashr i32 %7, 1
%9 = add nsw i32 %8, -1
%10 = load i32, i32* %5
%11 = and i32 %9, 2147483647
%12 = and i32 %10, -2147483648
%13 = or i32 %12, %11
store i32 %13, i32* %5
%14 = shl i32 %11, 1
%15 = ashr i32 %14, 1
%16 = icmp ne i32 %8, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %4
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hi from processor MIPS!\n");
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [25 x i8] c"Hi from processor MIPS!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"Hi from processor MIPS!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char str[50];
  int len;
  strcpy(str, "This is yiibai.com");
  len = strlen(str);
  printf("Length of |%s| is |%d|\n", str, len);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"This is yiibai.com\00"
@.str.1 = [24 x i8] c"Length of |%s| is |%d|\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"This is yiibai.com\00"
@.str.1 = [24 x i8] c"Length of |%s| is |%d|\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %4)
ret i32 0
}
int compound_while(int m) {
  int i = 0;
  int j = 3 * i;
  while (j == 0 && i < m) {
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<compound_while>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    1130 <compound_while+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <compound_while+0x40>
jmp    114e <compound_while+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <compound_while+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compound_while(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %3
%6 = mul nsw i32 3, %5
store i32 %6, i32* %4
br label %7
7: ; preds = %16, %1
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %7
19: ; preds = %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @compound_while(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() {
  while (1)
    sleep(1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 1000)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1000)
br label %1
}
/* Variables and functions */
int EFAULT;
extern int verify_area(int type, const void *addr, unsigned long size) {
  return (1) ? 0 : -EFAULT;
}


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

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

LLVM IR (-O0):
@EFAULT = global i32 0
define i32 @verify_area(i32 %0, i8* %1, i64 %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 0
}

LLVM IR (-O2):
@EFAULT = global i32 0
define i32 @verify_area(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_v32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v32_8_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ skip_ws(char const **);
void next_non_ws(const char **s) {
  ++*s;
  skip_ws(s);
}


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

x86 assembly (clang, -O2):
<next_non_ws>:
addq   $0x1,(%rdi)
jmp    1030 <skip_ws@plt>

LLVM IR (-O0):
define void @next_non_ws(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %3
%6 = load i8**, i8*** %2
%7 = call i32 @skip_ws(i8** %6)
ret void
}

LLVM IR (-O2):
define void @next_non_ws(i8** %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
%4 = tail call i32 @skip_ws(i8** %0)
ret void
}
int f16(int x) {
  x = x * 2;
  x = sizeof(int[x = (x || x + 1) * 2]) ? 5 : 8;
  return x;
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jne    112e <f16+0x2e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,%eax
mov    %eax,%edx
shl    $0x2,%rdx
mov    $0x8,%eax
mov    $0x5,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
%14 = mul nsw i32 %13, 2
store i32 %14, i32* %2
%15 = zext i32 %14 to i64
%16 = mul nuw i64 4, %15
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 5, i32 8
store i32 %19, i32* %2
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @f16(i32 %0) {
ret i32 5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ ptr;
};
typedef TYPE_1__ UDF_INIT;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void udf_past_renewal_date_deinit(UDF_INIT *initid) { free(initid->ptr); }


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

x86 assembly (clang, -O2):
<udf_past_renewal_date_deinit>:
mov    (%rdi),%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @udf_past_renewal_date_deinit(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @free(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @udf_past_renewal_date_deinit(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @free(i32 %3)
ret void
}
int gcd(int a, int b) {
  int tmp;
  while (b > 0) {
    tmp = a - b * ((int)((a) / (b)));
    a = b;
    b = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1142 <gcd+0x42>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
mov    %eax,-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
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     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 sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sdiv i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = sub nsw i32 %10, %15
store i32 %16, i32* %5
%17 = load i32, i32* %4
store i32 %17, i32* %3
%18 = load i32, i32* %5
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
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 sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ MWRateSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void MWRateSettingsRequestUpdate() {
  UAVObjRequestUpdate(MWRateSettingsHandle());
}


x86 assembly (clang, -O0):
<MWRateSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MWRateSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MWRateSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <MWRateSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @MWRateSettingsRequestUpdate() {
%1 = call i32 (...) @MWRateSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @MWRateSettingsRequestUpdate() {
%1 = tail call i32 (...) @MWRateSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
unsigned int reg_read_32(unsigned int volatile *);
unsigned long clk_get_pll_rate(void) {
  unsigned int ctrl;
  unsigned long pll_rate = 0;
  ctrl = reg_read_32((volatile unsigned int *)(0xbfe78030));
  pll_rate =
      (((ctrl & (0xff << (8))) >> (8)) + ((ctrl & (0xff << (16))) >> (16))) *
      ((24000000)) / 4;
  return pll_rate;
}


x86 assembly (clang, -O0):
<clk_get_pll_rate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0xbfe78030,%edi
call   1030 <reg_read_32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x10,%ecx
add    %ecx,%eax
imul   $0x16e3600,%eax,%eax
shr    $0x2,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_get_pll_rate>:
push   %rax
mov    $0xbfe78030,%edi
call   1030 <reg_read_32@plt>
movzbl %ah,%ecx
shr    $0x10,%eax
movzbl %al,%eax
add    %ecx,%eax
imul   $0x16e3600,%eax,%eax
shr    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @clk_get_pll_rate() {
%1 = alloca i32
%2 = alloca i64
store i64 0, i64* %2
%3 = call i32 @reg_read_32(i32* inttoptr (i64 3219619888 to i32*))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, 65280
%6 = lshr i32 %5, 8
%7 = load i32, i32* %1
%8 = and i32 %7, 16711680
%9 = lshr i32 %8, 16
%10 = add i32 %6, %9
%11 = mul i32 %10, 24000000
%12 = udiv i32 %11, 4
%13 = zext i32 %12 to i64
store i64 %13, i64* %2
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @clk_get_pll_rate() {
%1 = tail call i32 @reg_read_32(i32* inttoptr (i64 3219619888 to i32*))
%2 = lshr i32 %1, 8
%3 = and i32 %2, 255
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = add nuw nsw i32 %3, %5
%7 = mul i32 %6, 24000000
%8 = lshr exact i32 %7, 2
%9 = zext i32 %8 to i64
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void handle_hupterm(int signal) { die(("Received SIGHUP or SIGTERM\n")); }


x86 assembly (clang, -O0):
<handle_hupterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_hupterm>:
lea    0xee9(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Received SIGHUP or SIGTERM\0A\00"
define void @handle_hupterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Received SIGHUP or SIGTERM\0A\00"
define void @handle_hupterm(i32 %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int umax(unsigned int a, unsigned int b) { return a >= b ? a : b; }


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

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

LLVM IR (-O0):
define i32 @umax(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 uge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @umax(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void infoSetSearchOnDisk(void) {
  printf("Keep the dictionary on the disk when searching%s", "\n");
}


x86 assembly (clang, -O0):
<infoSetSearchOnDisk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0f(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<infoSetSearchOnDisk>:
lea    0xee9(%rip),%rdi
lea    0xf13(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Keep the dictionary on the disk when searching%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetSearchOnDisk() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Keep the dictionary on the disk when searching%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetSearchOnDisk() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RTStrmGetCh(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmGetCh() {
ret void
}
void SysTick_Wait(unsigned long delay) {
  (*((volatile unsigned long *)0xE000E014)) = delay - 1;
  (*((volatile unsigned long *)0xE000E018)) = 0;
  while (((*((volatile unsigned long *)0xE000E010)) & 0x00010000) == 0) {
  }
}


x86 assembly (clang, -O0):
<SysTick_Wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
mov    $0xe000e014,%eax
mov    %rcx,(%rax)
mov    $0xe000e018,%eax
movq   $0x0,(%rax)
mov    $0xe000e010,%eax
mov    (%rax),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
jne    1141 <SysTick_Wait+0x41>
jmp    1124 <SysTick_Wait+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTick_Wait>:
mov    $0xe000e010,%eax
add    $0xffffffffffffffff,%rdi
mov    %rdi,0x4(%rax)
movq   $0x0,0x8(%rax)
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x10000,(%rax)
je     1120 <SysTick_Wait+0x20>
ret

LLVM IR (-O0):
define void @SysTick_Wait(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 3758153748 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758153752 to i64*)
br label %5
5: ; preds = %9, %1
%6 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%7 = and i64 %6, 65536
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @SysTick_Wait(i64 %0) {
%2 = add i64 %0, -1
store volatile i64 %2, i64* inttoptr (i64 3758153748 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758153752 to i64*)
br label %3
3: ; preds = %3, %1
%4 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%5 = and i64 %4, 65536
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
testInc() {
  int a, b;
  a = 3;
  b = a++;
  printf("3++ = %d %d\n", b, a);
}


x86 assembly (clang, -O0):
<testInc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInc>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"3++ = %d %d\0A\00"
define i32 @testInc() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
store i32 %4, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"3++ = %d %d\0A\00"
define i32 @testInc() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3, i32 4)
ret i32 undef
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void delay(int mS) {
  int microsecs;
  struct timeval tv;
  microsecs = mS * 1000;
  tv.tv_sec = microsecs / 1000000;
  tv.tv_usec = microsecs % 1000000;
  select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rax
imul   $0x3e8,%edi,%eax
movslq %edi,%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
cltq
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = srem i32 %10, 1000000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i32 %11, i32* %12
%13 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @delay(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = mul nsw i32 %0, 1000
%5 = sdiv i32 %0, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = srem i32 %4, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
int test_imm_DCint8_mem(signed char *val) {
  return ((*val) & (-0xDC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DCint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff24,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -220
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long ilongminus(long x, long y) {
  x -= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<ilongminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x18,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <ilongminus+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilongminus>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffe8,%rbx
jne    1121 <ilongminus+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ilongminus(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 = sub nsw i64 %5, 24
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @foo(i8* null)
br label %11
11: ; preds = %9, %2
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @ilongminus(i64 %0, i64 %1) {
%3 = add nsw i64 %0, -24
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ drv_Pertelian_send(char *, int);
void drv_Pertelian_clear(void) {
  char cmd[2];
  cmd[0] = 0xfe;
  cmd[1] = 0x01;
  drv_Pertelian_send(cmd, 2);
}


x86 assembly (clang, -O0):
<drv_Pertelian_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xfe,-0x2(%rbp)
movb   $0x1,-0x1(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <drv_Pertelian_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Pertelian_clear>:
push   %rax
movw   $0x1fe,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <drv_Pertelian_send@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @drv_Pertelian_clear() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 -2, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 1, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @drv_Pertelian_send(i8* %4, i32 2)
ret void
}

LLVM IR (-O2):
define void @drv_Pertelian_clear() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 -2, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 1, i8* %3
%4 = call i32 @drv_Pertelian_send(i8* %2, i32 2)
ret void
}
int ipow(int base, int exp) {
  int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <ipow+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <ipow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <ipow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113a <ipow+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
sar    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = ashr i32 %6, 1
%13 = mul nsw i32 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
void main() {
  void average(float *p, int n);
  void search(float(*p)[4], int n);
  float score[3][4] = {{65, 67, 70, 60}, {80, 87, 90, 81}, {90, 99, 100, 98}};
  average(*score, 12);
  search(score, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xc,%esi
call   1050 <average@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1030 <search@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <average@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <search@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.score = [3 x [4 x float]] [[4 x float] [float 6.500000e+01, float 6.700000e+01, float 7.000000e+01, float 6.000000e+01], [4 x float] [float 8.000000e+01, float 8.700000e+01, float 9.000000e+01, float 8.100000e+01], [4 x float] [float 9.000000e+01, float 9.900000e+01, float 1.000000e+02, float 9.800000e+01]]
define void @main() {
%1 = alloca [3 x [4 x float]]
%2 = bitcast [3 x [4 x float]]* %1 to i8*
%3 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%5 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0
ret void
}

LLVM IR (-O2):
@__const.main.score = [3 x [4 x float]] [[4 x float] [float 6.500000e+01, float 6.700000e+01, float 7.000000e+01, float 6.000000e+01], [4 x float] [float 8.000000e+01, float 8.700000e+01, float 9.000000e+01, float 8.100000e+01], [4 x float] [float 9.000000e+01, float 9.900000e+01, float 1.000000e+02, float 9.800000e+01]]
define void @main() {
%1 = alloca [3 x [4 x float]]
%2 = bitcast [3 x [4 x float]]* %1 to i8*
%3 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x [4 x float]], [3 x [4 x float]]* %1, i64 0, i64 0, i64 0
ret void
}
void store_sf(float *p, float f) {
  __asm__("# reg %x0" : "+v"(f));
  *p = f;
}


x86 assembly (clang, -O0):
<store_sf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_sf>:
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @store_sf(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(float %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = load float*, float** %3
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @store_sf(float* nocapture writeonly %0, float %1) {
%3 = tail call float asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(float %1)
store float %3, float* %0
ret void
}
int track_bbox_bottom(int ch, int i) {}


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

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

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

LLVM IR (-O2):
define i32 @track_bbox_bottom(i32 %0, i32 %1) {
ret i32 undef
}
int jam_binary_constant_is_ok(char *string) {
  int ok = 1;
  while (ok && (*string != '\0')) {
    if ((*string != '0') && (*string != '1'))
      ok = 0;
    ++string;
  }
  return (ok);
}


x86 assembly (clang, -O0):
<jam_binary_constant_is_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     112e <jam_binary_constant_is_ok+0x2e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113e <jam_binary_constant_is_ok+0x3e>
jmp    1176 <jam_binary_constant_is_ok+0x76>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
je     1165 <jam_binary_constant_is_ok+0x65>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
je     1165 <jam_binary_constant_is_ok+0x65>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <jam_binary_constant_is_ok+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_binary_constant_is_ok>:
movzbl (%rdi),%eax
lea    -0x30(%rax),%ecx
cmp    $0x2,%cl
jae    1111 <jam_binary_constant_is_ok+0x11>
add    $0x1,%rdi
jmp    1100 <jam_binary_constant_is_ok>
test   %al,%al
jne    111b <jam_binary_constant_is_ok+0x1b>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jam_binary_constant_is_ok(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %7
i8 48, label %5
i8 49, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
int test_imm_BAuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xba,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_BAuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 186
%6 = icmp ne i64 %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_BAuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12189696
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}