xunge/DecIR huggingface dataset:
void console_line_queue_set(struct os_eventq *evq) {}


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

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

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

LLVM IR (-O2):
%struct.os_eventq = type opaque
define void @console_line_queue_set(%struct.os_eventq* nocapture %0) {
ret void
}
int isdig(char symbol1) { return (symbol1 >= '0' && symbol1 <= '9'); }


x86 assembly (clang, -O0):
<isdig>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdig+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdig>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdig(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *string_fmt(char *, char const *);
char *string_copy(const char *str) { return string_fmt("%s", str); }


x86 assembly (clang, -O0):
<string_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <string_fmt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_copy>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <string_fmt@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i8* @string_copy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @string_fmt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i8* @string_copy(i8* %0) {
%2 = tail call i8* @string_fmt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ qemu_cfg_read(void *, int);
int /*<<< orphan*/ qemu_cfg_select(int);
void qemu_cfg_read_entry(void *buf, int e, int len) {
  qemu_cfg_select(e);
  qemu_cfg_read(buf, len);
}


x86 assembly (clang, -O0):
<qemu_cfg_read_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <qemu_cfg_select@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <qemu_cfg_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_cfg_read_entry>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <qemu_cfg_select@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <qemu_cfg_read@plt>

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

LLVM IR (-O2):
define void @qemu_cfg_read_entry(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @qemu_cfg_select(i32 %1)
%5 = tail call i32 @qemu_cfg_read(i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t getpgid(pid_t pid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getpgid(i32 %0) {
ret i32 0
}
void TPS_ADC_SAR_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @TPS_ADC_SAR_RestoreConfig() {
ret void
}
/* Variables and functions */
char toupper(char);
void strupper(char *s) {
  while (*s) {
    *s = toupper(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strupper+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strupper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strupper+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void y(void) {
  extern char z;
  fprintf(0, "a");
}


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

x86 assembly (clang, -O2):
<y>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @y() {
%1 = tail call i32 @fprintf(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void ble_rsp_attclient_find_by_type_value(
    const struct ble_msg_attclient_find_by_type_value_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_find_by_type_value_rsp_t = type opaque
define void @ble_rsp_attclient_find_by_type_value(%struct.ble_msg_attclient_find_by_type_value_rsp_t* nocapture %0) {
ret void
}
int isCompN(int n) {
  int j;
  for (j = 2; j < n; j++) {
    if (n % j == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isCompN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isCompN+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isCompN+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <isCompN+0x50>
jmp    113b <isCompN+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isCompN+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCompN>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <isCompN+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isCompN+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isCompN+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isCompN(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "error: Usage: %s [-q] [-t timeout_sec] [-u timeout_usec] <host> "
          "<port>\n",
          prog);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"error: Usage: %s [-q] [-t timeout_sec] [-u timeout_usec] <host> <port>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"error: Usage: %s [-q] [-t timeout_sec] [-u timeout_usec] <host> <port>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void close(int handle) { printf("http::close() called!\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"http::close() called!\0A\00"
define void @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"http::close() called!\00"
define void @close(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void bitArraySet(void *array, unsigned bit) {
  (((uint32_t *)array)[(bit) / (sizeof(((uint32_t *)array)[0]) * 8)] |=
   (1 << ((bit) % (sizeof(((uint32_t *)array)[0]) * 8))));
}


x86 assembly (clang, -O0):
<bitArraySet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x5,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitArraySet>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%ecx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @bitArraySet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = urem i64 %6, 32
%8 = trunc i64 %7 to i32
%9 = shl i32 1, %8
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = udiv i64 %13, 32
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = or i32 %16, %9
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @bitArraySet(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = bitcast i8* %0 to i32*
%6 = lshr i32 %1, 5
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %4
store i32 %10, i32* %8
ret void
}
double fn1() {
  double w, s = fn1() - 6.12323399573676603587e17;
  return 1.57079632679489655800e00 - (s + w);
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
call   1030 <fn1@plt>
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fn1() {
%1 = alloca double
%2 = alloca double
%3 = call double @fn1()
%4 = fsub double %3, 0x43A0FED1C67E7F44
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %1
%7 = fadd double %5, %6
%8 = fsub double 0x3FF921FB54442D18, %7
ret double %8
}

LLVM IR (-O2):
define double @fn1() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void LPCIntUnregister(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  IntDisable(124);
  IntUnregister(124);
}


x86 assembly (clang, -O0):
<LPCIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x7c,%edi
call   1030 <IntDisable@plt>
mov    $0x7c,%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIntUnregister>:
push   %rax
xor    %eax,%eax
cmp    $0x40080000,%rdi
sete   %al
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x7c,%edi
call   1030 <IntDisable@plt>
mov    $0x7c,%edi
pop    %rax
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @LPCIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074266112
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = call i32 @IntDisable(i32 124)
%8 = call i32 @IntUnregister(i32 124)
ret void
}

LLVM IR (-O2):
define void @LPCIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1074266112
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = tail call i32 @IntDisable(i32 124)
%6 = tail call i32 @IntUnregister(i32 124)
ret void
}
/* Type definitions */
typedef int u_char;

/* Variables and functions */
int is_gbk(u_char *pstr) {
  if ((pstr[0] >= 0x81) && (pstr[0] <= 0xfe) && (pstr[1] >= 0x40) &&
      (pstr[1] <= 0xfe) && (pstr[1] != 0x7f)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_gbk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x81,(%rax)
jl     1161 <is_gbk+0x61>
mov    -0x10(%rbp),%rax
cmpl   $0xfe,(%rax)
jg     1161 <is_gbk+0x61>
mov    -0x10(%rbp),%rax
cmpl   $0x40,0x4(%rax)
jl     1161 <is_gbk+0x61>
mov    -0x10(%rbp),%rax
cmpl   $0xfe,0x4(%rax)
jg     1161 <is_gbk+0x61>
mov    -0x10(%rbp),%rax
cmpl   $0x7f,0x4(%rax)
je     1161 <is_gbk+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <is_gbk+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_gbk>:
mov    $0xffffff7f,%eax
add    (%rdi),%eax
cmp    $0x7d,%eax
ja     1128 <is_gbk+0x28>
mov    0x4(%rdi),%ecx
cmp    $0x7f,%ecx
je     1128 <is_gbk+0x28>
add    $0xffffff01,%ecx
mov    $0x1,%eax
cmp    $0xffffff40,%ecx
jbe    1128 <is_gbk+0x28>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_gbk(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 129
br i1 %7, label %8, label %29
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp sle i32 %11, 254
br i1 %12, label %13, label %29
13: ; preds = %8
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = icmp sge i32 %16, 64
br i1 %17, label %18, label %29
18: ; preds = %13
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = icmp sle i32 %21, 254
br i1 %22, label %23, label %29
23: ; preds = %18
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load i32, i32* %25
%27 = icmp ne i32 %26, 127
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 1, i32* %2
br label %30
29: ; preds = %23, %18, %13, %8, %1
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_gbk(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, -129
%4 = icmp ult i32 %3, 126
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = add i32 %7, -255
%9 = icmp ult i32 %8, -191
%10 = icmp eq i32 %7, 127
%11 = or i1 %10, %9
br i1 %11, label %12, label %13
12: ; preds = %5, %1
br label %13
13: ; preds = %5, %12
%14 = phi i32 [ 0, %12 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
int pow(int, int);
int distinct(int a, int b, int c) { return pow(b, 2) - 4 * a * c; }


x86 assembly (clang, -O0):
<distinct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distinct>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
imul   %ebx,%ebp
shl    $0x2,%ebp
sub    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @distinct(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = call i32 @pow(i32 %7, i32 2)
%9 = load i32, i32* %4
%10 = mul nsw i32 4, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @distinct(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pow(i32 %1, i32 2)
%5 = mul i32 %0, -4
%6 = mul i32 %5, %2
%7 = add i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
int /*<<< orphan*/ focus_cmd(char *);
void focus_cb(Widget w, void *u, void *c) {
  char *cmd_str = u;
  focus_cmd(cmd_str);
}


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

x86 assembly (clang, -O2):
<focus_cb>:
mov    %rsi,%rdi
jmp    1030 <focus_cmd@plt>

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

LLVM IR (-O2):
define void @focus_cb(i32 %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @focus_cmd(i8* %1)
ret void
}
/* Variables and functions */
char getchar();
int toupper(int);
char lireLettre() {
  int lettre = 0;
  lettre = getchar();
  lettre = toupper(lettre);
  while (getchar() != '\n')
    ;
  return lettre;
}


x86 assembly (clang, -O0):
<lireLettre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     115f <lireLettre+0x3f>
jmp    1147 <lireLettre+0x27>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lireLettre>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <lireLettre+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @lireLettre() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @toupper(i32 %4)
store i32 %5, i32* %1
br label %6
6: ; preds = %10, %0
%7 = call signext i8 (...) @getchar()
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
%12 = load i32, i32* %1
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @lireLettre() {
%1 = tail call signext i8 (...) @getchar()
%2 = sext i8 %1 to i32
%3 = tail call i32 @toupper(i32 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = trunc i32 %3 to i8
ret i8 %8
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ assert(int);
int main() {
  int x = 0;
  while (__VERIFIER_nondet_int()) {
    x = 2;
  }
  assert(x <= 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
movl   $0x2,-0x8(%rbp)
jmp    1136 <main+0x16>
cmpl   $0x2,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1130 <main+0x10>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = call i64 (...) @__VERIFIER_nondet_int()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 2, i32* %2
br label %3
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 2
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: bd [flags] [number]\n");
  printf("\n");
  printf(" flags:\n");
  printf("  -d Converts number from decimal format to visualized binary.\n");
  printf(
      "  -x Converts number from hexadecimal format to visualized binary.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3c(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xedd(%rip),%rdi
call   1040 <puts@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf0c(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"usage: bd [flags] [number]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [9 x i8] c" flags:\0A\00"
@.str.3 = [64 x i8] c" -d Converts number from decimal format to visualized binary.\0A\00"
@.str.4 = [68 x i8] c" -x Converts number from hexadecimal format to visualized binary.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"usage: bd [flags] [number]\00"
@str.5 = [8 x i8] c" flags:\00"
@str.6 = [63 x i8] c" -d Converts number from decimal format to visualized binary.\00"
@str.7 = [67 x i8] c" -x Converts number from hexadecimal format to visualized binary.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.7, i64 0, i64 0))
ret void
}
unsigned int pampd_remote_size(void *pampd) {
  unsigned long fake_pampd = (unsigned long)pampd;
  return (fake_pampd >> (((0 + 1) + 1) + 8)) & ((1UL << (13)) - 1);
}


x86 assembly (clang, -O0):
<pampd_remote_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0xa,%rax
and    $0x1fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pampd_remote_size>:
mov    %rdi,%rax
shr    $0xa,%eax
and    $0x1fff,%eax
ret

LLVM IR (-O0):
define i32 @pampd_remote_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = lshr i64 %6, 10
%8 = and i64 %7, 8191
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @pampd_remote_size(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 10
%5 = and i32 %4, 8191
ret i32 %5
}
/* Variables and functions */
int close(int);
__attribute__((__weak__, __always___)) int softboundmpx_close(int fd) {
  return close(fd);
}


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

x86 assembly (clang, -O2):
<softboundmpx_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define weak i32 @softboundmpx_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int isterminator(char sym) { return (sym == ';'); }


x86 assembly (clang, -O0):
<isterminator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isterminator>:
xor    %eax,%eax
cmp    $0x3b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isterminator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 59
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isterminator(i8 signext %0) {
%2 = icmp eq i8 %0, 59
%3 = zext i1 %2 to i32
ret i32 %3
}
int twice(int i) {
  i = i * 2;
  return i;
}


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

x86 assembly (clang, -O2):
<twice>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @twice(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @twice(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void scroll_forw(void) {}


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

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

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

LLVM IR (-O2):
define void @scroll_forw() {
ret void
}
int test_imm_50uint16_reg(unsigned short val) {
  return ((val) & (-0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffb0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_50uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -80
%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_50uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -80
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int sort_utils_int64_t_cmp(const void *const a, const void *const b) {
  const int64_t *const x = (const int64_t *const)a;
  const int64_t *const y = (const int64_t *const)b;
  return (*x > *y) - (*x < *y);
}


x86 assembly (clang, -O0):
<sort_utils_int64_t_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_utils_int64_t_cmp>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @sort_utils_int64_t_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp sgt i64 %12, %14
%16 = zext i1 %15 to i32
%17 = load i64*, i64** %5
%18 = load i64, i64* %17
%19 = load i64*, i64** %6
%20 = load i64, i64* %19
%21 = icmp slt i64 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_utils_int64_t_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i64 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
double tan(double);
double module_libc_tan(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<module_libc_tan>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @module_libc_tan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() { write(1, "Hello world !\n", 14); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello world !\0A\00"
define i32 @main() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello world !\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ analyze_hand(int *, int *);
int /*<<< orphan*/ print_result();
int /*<<< orphan*/ read_cards(int *, int *);
int main(void) {
  int num_in_rank[13];
  int num_in_suit[4];
  while (1) {
    read_cards(num_in_rank, num_in_suit);
    analyze_hand(num_in_rank, num_in_suit);
    print_result();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <read_cards@plt>
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <analyze_hand@plt>
mov    $0x0,%al
call   1040 <print_result@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0x10(%rsp),%r14
mov    %rsp,%rbx
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <read_cards@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <analyze_hand@plt>
xor    %eax,%eax
call   1040 <print_result@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i32]
%3 = alloca [4 x i32]
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = call i32 @read_cards(i32* %5, i32* %6)
%8 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%10 = call i32 @analyze_hand(i32* %8, i32* %9)
%11 = call i32 (...) @print_result()
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [13 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [13 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
br label %7
7: ; preds = %7, %0
%8 = call i32 @read_cards(i32* %5, i32* %6)
%9 = call i32 @analyze_hand(i32* %5, i32* %6)
%10 = call i32 (...) @print_result()
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_xor_si64(int /*<<< orphan*/, int /*<<< orphan*/);
void XOREQ_BEST_BY(unsigned char *d, unsigned char *s) {
  do {
    *(__m64 *)d = _mm_xor_si64(*(__m64 *)(d), *(__m64 *)(s));
  } while (0);
}


x86 assembly (clang, -O0):
<XOREQ_BEST_BY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <_mm_xor_si64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOREQ_BEST_BY>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <_mm_xor_si64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @XOREQ_BEST_BY(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @_mm_xor_si64(i32 %8, i32 %11)
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
br label %15
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @XOREQ_BEST_BY(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @_mm_xor_si64(i32 %4, i32 %6)
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slow_bitmap_xor(unsigned long *, unsigned long const *,
                                   unsigned long const *, int);
void bitmap_xor(unsigned long *dst, const unsigned long *src1,
                const unsigned long *src2, int nbits) {
  if (((nbits) <= (sizeof(unsigned long) * 8))) {
    *dst = *src1 ^ *src2;
  } else {
    slow_bitmap_xor(dst, src1, src2, nbits);
  }
}


x86 assembly (clang, -O0):
<bitmap_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x40,%rax
ja     114f <bitmap_xor+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
xor    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1163 <bitmap_xor+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <slow_bitmap_xor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_xor>:
cmp    $0x40,%ecx
ja     111f <bitmap_xor+0xf>
mov    (%rdx),%rax
xor    (%rsi),%rax
mov    %rax,(%rdi)
ret
jmp    1030 <slow_bitmap_xor@plt>

LLVM IR (-O0):
define void @bitmap_xor(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = icmp ule i64 %10, 64
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = load i64*, i64** %7
%16 = load i64, i64* %15
%17 = xor i64 %14, %16
%18 = load i64*, i64** %5
store i64 %17, i64* %18
br label %25
19: ; preds = %4
%20 = load i64*, i64** %5
%21 = load i64*, i64** %6
%22 = load i64*, i64** %7
%23 = load i32, i32* %8
%24 = call i32 @slow_bitmap_xor(i64* %20, i64* %21, i64* %22, i32 %23)
br label %25
25: ; preds = %19, %12
ret void
}

LLVM IR (-O2):
define void @bitmap_xor(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = icmp ult i32 %3, 65
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = xor i64 %8, %7
store i64 %9, i64* %0
br label %12
10: ; preds = %4
%11 = tail call i32 @slow_bitmap_xor(i64* %0, i64* %1, i64* %2, i32 %3)
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ out_of_memory(char *, size_t);
void *ppmM_alloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    out_of_memory("malloc", size);
  return p;
}


x86 assembly (clang, -O0):
<ppmM_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <ppmM_alloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <out_of_memory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppmM_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <ppmM_alloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <out_of_memory@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @ppmM_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @out_of_memory(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @ppmM_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @out_of_memory(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ buf_setindex(int /*<<< orphan*/, int /*<<< orphan*/);
void goto_buffer_beg() { buf_setindex(0, 0); }


x86 assembly (clang, -O0):
<goto_buffer_beg>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <buf_setindex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_buffer_beg>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <buf_setindex@plt>

LLVM IR (-O0):
define void @goto_buffer_beg() {
%1 = call i32 @buf_setindex(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @goto_buffer_beg() {
%1 = tail call i32 @buf_setindex(i32 0, i32 0)
ret void
}
int test_imm_A4int64_midword_reg(long long val) {
  return ((val >> 16) & (0xA4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A4int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 164
%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_A4int64_midword_reg(i64 %0) {
%2 = and i64 %0, 10747904
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
void strncasecmp_2() {
  char *x = "abc";
  char *y = "Bcd";
  if (strncasecmp(x, y, 3) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncasecmp_2+0x39>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Bcd\00"
define void @strncasecmp_2() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strncasecmp_2() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *default_allocate(void *user_data, size_t s) { return malloc(s); }


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

x86 assembly (clang, -O2):
<default_allocate>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @default_allocate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @default_allocate(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}