xunge/DecIR huggingface dataset:
void HalfFloatRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @HalfFloatRow_Any_NEON() {
ret void
}
int test(int a, int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @test(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ do_pthread_cond_wait(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *, int);
int pthread_cond_wait_check(pthread_cond_t *cond, pthread_mutex_t *mutex) {
  do_pthread_cond_wait(cond, mutex, 1);
  return 0;
}


x86 assembly (clang, -O0):
<pthread_cond_wait_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <do_pthread_cond_wait@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cond_wait_check>:
push   %rax
mov    $0x1,%edx
call   1030 <do_pthread_cond_wait@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pthread_cond_wait_check(i32* %0, i32* %1) {
%3 = tail call i32 @do_pthread_cond_wait(i32* %0, i32* %1, i32 1)
ret i32 0
}
void wifi_evt_flash_ps_key(const struct wifi_msg_flash_ps_key_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_flash_ps_key_evt_t = type opaque
define void @wifi_evt_flash_ps_key(%struct.wifi_msg_flash_ps_key_evt_t* nocapture %0) {
ret void
}
int test_imm_20int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 32
%7 = icmp ne i64 %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_20int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2097152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ByteSwap32(int /*<<< orphan*/);
uint32_t ToBE32(uint32_t value) { return ByteSwap32(value); }


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

x86 assembly (clang, -O2):
<ToBE32>:
jmp    1030 <ByteSwap32@plt>

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

LLVM IR (-O2):
define i32 @ToBE32(i32 %0) {
%2 = tail call i32 @ByteSwap32(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int oct_le(const char *pat, const char *text) {
  return (strcmp(text, pat) <= 0);
}


x86 assembly (clang, -O0):
<oct_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oct_le>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @oct_le(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp sle i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @oct_le(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* %0)
%4 = icmp slt i64 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
void unw_is_fpreg() {}


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

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

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

LLVM IR (-O2):
define void @unw_is_fpreg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void key_cleanup(void *str) { free(str); }


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

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

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

LLVM IR (-O2):
define void @key_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int foo(int, int *);
int main(void) {
  int a[6] = {};
  int ret = foo(3, a);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rsi
mov    $0x3,%edi
call   1040 <foo@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edi
call   1030 <foo@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call i32 @foo(i32 3, i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32 3, i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getStringArray(char *, char **, char *);
char **malloc(int);
int strCount(char *, char);
char **getLines(char *string) {
  int nLines = strCount(string, '\n') + 1;
  char **lines = malloc(sizeof(char *) * (nLines + 1));
  getStringArray(string, lines, "\n\r");
  lines[nLines] = NULL;
  return lines;
}


x86 assembly (clang, -O0):
<getLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strCount@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdx
call   1050 <getStringArray@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLines>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xa,%esi
call   1030 <strCount@plt>
mov    %eax,%r15d
lea    0x10(,%r15,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xea4(%rip),%rdx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <getStringArray@plt>
movslq %r15d,%rax
movq   $0x0,0x8(%rbx,%rax,8)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0D\00"
define i8** @getLines(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8**
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strCount(i8* %5, i8 signext 10)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i8** @malloc(i32 %12)
store i8** %13, i8*** %4
%14 = load i8*, i8** %2
%15 = load i8**, i8*** %4
%16 = call i32 @getStringArray(i8* %14, i8** %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = load i8**, i8*** %4
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
store i8* null, i8** %20
%21 = load i8**, i8*** %4
ret i8** %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0D\00"
define i8** @getLines(i8* %0) {
%2 = tail call i32 @strCount(i8* %0, i8 signext 10)
%3 = add nsw i32 %2, 1
%4 = shl i32 %2, 3
%5 = add i32 %4, 16
%6 = tail call i8** @malloc(i32 %5)
%7 = tail call i32 @getStringArray(i8* %0, i8** %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
store i8* null, i8** %9
ret i8** %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((constructor)) init(void) { write(1, "3", 1); }


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

x86 assembly (clang, -O2):
<init>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"3\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"3\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
double cosh(double);
int /*<<< orphan*/ getNumber(double *);
double cosenoh(double a) {
  getNumber(&a);
  return cosh(a);
}


x86 assembly (clang, -O0):
<cosenoh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <cosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosenoh>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <getNumber@plt>
movsd  (%rsp),%xmm0
call   1030 <cosh@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @cosenoh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @cosh(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cosenoh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @cosh(double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ INT64_MAX;
int /*<<< orphan*/ INT64_MIN;
int /*<<< orphan*/ xsd_integer_value(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int64_t xsd_int64_value(const char *literal) {
  return (int64_t)xsd_integer_value(literal, INT64_MIN, INT64_MAX);
}


x86 assembly (clang, -O0):
<xsd_int64_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <xsd_integer_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_int64_value>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <xsd_integer_value@plt>

LLVM IR (-O0):
@INT64_MIN = global i32 0
@INT64_MAX = global i32 0
define i32 @xsd_int64_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @INT64_MIN
%5 = load i32, i32* @INT64_MAX
%6 = call i32 @xsd_integer_value(i8* %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@INT64_MIN = global i32 0
@INT64_MAX = global i32 0
define i32 @xsd_int64_value(i8* %0) {
%2 = load i32, i32* @INT64_MIN
%3 = load i32, i32* @INT64_MAX
%4 = tail call i32 @xsd_integer_value(i8* %0, i32 %2, i32 %3)
ret i32 %4
}
int isws(char c) { return c == ' ' || c == '\t' || c == '\n'; }


x86 assembly (clang, -O0):
<isws>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <isws+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <isws+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isws>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <isws+0x11>
cmp    $0x20,%dil
jne    1112 <isws+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isws(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, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isws(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ unreachable();
int flt22(int a) {
  unsigned i = a / 4;
  unsigned j = i - 2;
  if (j == 7)
    return -1;
  if (i <= 2)
    return 0;
  if (i < j)
    unreachable();
  return 1;
}


x86 assembly (clang, -O0):
<flt22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jne    1148 <flt22+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <flt22+0x68>
cmpl   $0x2,-0xc(%rbp)
ja     115e <flt22+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1178 <flt22+0x68>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1171 <flt22+0x61>
mov    $0x0,%al
call   1030 <unreachable@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt22>:
mov    %edi,%ecx
and    $0xfffffffc,%ecx
mov    $0xffffffff,%eax
cmp    $0x24,%ecx
je     1122 <flt22+0x22>
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @flt22(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 4
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = sub i32 %8, 2
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 7
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %24
13: ; preds = %1
%14 = load i32, i32* %4
%15 = icmp ule i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %2
br label %24
17: ; preds = %13
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp ult i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @unreachable()
br label %23
23: ; preds = %21, %17
store i32 1, i32* %2
br label %24
24: ; preds = %23, %16, %12
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @flt22(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 36
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 4
%6 = icmp ugt i32 %5, 2
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_SINGLERESP;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_SINGLERESP_it;
OCSP_SINGLERESP *d2i_OCSP_SINGLERESP(OCSP_SINGLERESP **a,
                                     const unsigned char **in, long len) {
  return (OCSP_SINGLERESP *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                          &OCSP_SINGLERESP_it);
}


x86 assembly (clang, -O0):
<d2i_OCSP_SINGLERESP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_OCSP_SINGLERESP>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_SINGLERESP_it = global i32 0
define i32* @d2i_OCSP_SINGLERESP(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
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_SINGLERESP_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_SINGLERESP_it = global i32 0
define i32* @d2i_OCSP_SINGLERESP(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_SINGLERESP_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
long long enstrtonum(int, char const *, long long, long long);
long long estrtonum(const char *numstr, long long minval, long long maxval) {
  return enstrtonum(1, numstr, minval, maxval);
}


x86 assembly (clang, -O0):
<estrtonum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <enstrtonum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrtonum>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <enstrtonum@plt>

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

LLVM IR (-O2):
define i64 @estrtonum(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @enstrtonum(i32 1, i8* %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int sum(int *, int);
int find_one(int array[], int n) { return n * (n + 1) / 2 - sum(array, n); }


x86 assembly (clang, -O0):
<find_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_one>:
push   %rbx
lea    0x1(%rsi),%eax
imul   %esi,%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
call   1030 <sum@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @find_one(i32* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = mul nsw i32 %3, %1
%5 = sdiv i32 %4, 2
%6 = tail call i32 @sum(i32* %0, i32 %1)
%7 = sub nsw i32 %5, %6
ret i32 %7
}
int product(int num1, int num2, int num3) { return num1 * num2 * num3; }


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

x86 assembly (clang, -O2):
<product>:
mov    %edi,%eax
imul   %esi,%eax
imul   %edx,%eax
ret

LLVM IR (-O0):
define i32 @product(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* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @product(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = mul nsw i32 %4, %2
ret i32 %5
}
int nvg__ptEquals(float x1, float y1, float x2, float y2, float tol) {
  float dx = x2 - x1;
  float dy = y2 - y1;
  return dx * dx + dy * dy < tol * tol;
}


x86 assembly (clang, -O0):
<nvg__ptEquals>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvg__ptEquals>:
subss  %xmm0,%xmm2
subss  %xmm1,%xmm3
mulss  %xmm3,%xmm3
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm4,%xmm4
xor    %eax,%eax
ucomiss %xmm2,%xmm4
seta   %al
ret

LLVM IR (-O0):
define i32 @nvg__ptEquals(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%13 = load float, float* %8
%14 = load float, float* %6
%15 = fsub float %13, %14
store float %15, float* %11
%16 = load float, float* %9
%17 = load float, float* %7
%18 = fsub float %16, %17
store float %18, float* %12
%19 = load float, float* %11
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %12
%23 = fmul float %21, %22
%24 = call float @llvm.fmuladd.f32(float %19, float %20, float %23)
%25 = load float, float* %10
%26 = load float, float* %10
%27 = fmul float %25, %26
%28 = fcmp olt float %24, %27
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @nvg__ptEquals(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %2, %0
%7 = fsub float %3, %1
%8 = fmul float %7, %7
%9 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %8)
%10 = fmul float %4, %4
%11 = fcmp olt float %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void send_id(char id) {
  unsigned long *__mspsim_debug_mem = (unsigned long *)0x82000;
  *__mspsim_debug_mem = id;
}


x86 assembly (clang, -O0):
<send_id>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x82000,%eax
mov    %rax,-0x10(%rbp)
movsbq -0x1(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_id>:
movslq %edi,%rax
mov    %rax,0x82000
ret

LLVM IR (-O0):
define void @send_id(i8 signext %0) {
%2 = alloca i8
%3 = alloca i64*
store i8 %0, i8* %2
store i64* inttoptr (i64 532480 to i64*), i64** %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i64
%6 = load i64*, i64** %3
store i64 %5, i64* %6
ret void
}

LLVM IR (-O2):
define void @send_id(i8 signext %0) {
%2 = sext i8 %0 to i64
store i64 %2, i64* inttoptr (i64 532480 to i64*)
ret void
}
int char_isspace(unsigned char c) {
  if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<char_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <char_isspace+0x3e>
movzbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     113e <char_isspace+0x3e>
movzbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     113e <char_isspace+0x3e>
movzbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    114a <char_isspace+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <char_isspace+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_isspace>:
cmp    $0x20,%dil
ja     111e <char_isspace+0x1e>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111e <char_isspace+0x1e>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @char_isspace(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
unsigned char mksym_u8() { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @mksym_u8() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @mksym_u8() {
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ timeout;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t inv_fifo_protocol_helper_decode_timeout(const void *in, uint16_t len) {
  uint32_t timeout;
  FifoProtocol_memcpy((&timeout), (in), (sizeof(timeout)));
  (void)len;
  return timeout;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_timeout>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @inv_fifo_protocol_helper_decode_timeout(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FifoProtocol_memcpy(i32* %3, i8* %0, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
void *sbrk(unsigned int);
void *my_malloc(unsigned n) { return sbrk(n); }


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

x86 assembly (clang, -O2):
<my_malloc>:
jmp    1030 <sbrk@plt>

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

LLVM IR (-O2):
define i8* @my_malloc(i32 %0) {
%2 = tail call i8* @sbrk(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_, const)) uint16_t BE32ToBE16(uint32_t be32) {
  return be32 >> 16;
}


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

x86 assembly (clang, -O2):
<BE32ToBE16>:
mov    %edi,%eax
sar    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @BE32ToBE16(i32 %0) {
%2 = ashr i32 %0, 16
ret i32 %2
}
void *cast_to_void_ptr(void *p) { return p; }


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

x86 assembly (clang, -O2):
<cast_to_void_ptr>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @cast_to_void_ptr(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void __attribute__((noreturn)) usage(void) {
  fprintf(stdout, "Usage: ./usage -[h]    \n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [25 x i8] c"Usage: ./usage -[h] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [25 x i8] c"Usage: ./usage -[h] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mat_element_print2(void *, int /*<<< orphan*/);
void mat_element_print(void *self) { mat_element_print2(self, 0); }


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

x86 assembly (clang, -O2):
<mat_element_print>:
xor    %esi,%esi
jmp    1030 <mat_element_print2@plt>

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

LLVM IR (-O2):
define void @mat_element_print(i8* %0) {
%2 = tail call i32 @mat_element_print2(i8* %0, i32 0)
ret void
}
/* Variables and functions */
char *ultostr(long, int);
char *ltostr(long val, int radix) {
  char *p;
  int flg = 0;
  if (val < 0) {
    flg++;
    val = -val;
  }
  p = ultostr(val, radix);
  if (p && flg)
    *--p = '-';
  return p;
}


x86 assembly (clang, -O0):
<ltostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1144 <ltostr+0x34>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ultostr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <ltostr+0x6c>
cmpl   $0x0,-0x1c(%rbp)
je     117c <ltostr+0x6c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2d,-0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltostr>:
push   %rbx
mov    %rdi,%rbx
neg    %rdi
cmovs  %rbx,%rdi
call   1030 <ultostr@plt>
test   %rbx,%rbx
jns    1132 <ltostr+0x22>
test   %rax,%rax
je     1132 <ltostr+0x22>
movb   $0x2d,-0x1(%rax)
add    $0xffffffffffffffff,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ltostr(i64 %0, i32 %1) {
%3 = icmp slt i64 %0, 0
%4 = sub nsw i64 0, %0
%5 = select i1 %3, i64 %4, i64 %0
%6 = tail call i8* @ultostr(i64 %5, i32 %1)
%7 = icmp ne i8* %6, null
%8 = and i1 %3, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 45, i8* %10
br label %11
11: ; preds = %9, %2
%12 = phi i8* [ %10, %9 ], [ %6, %2 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ write_tracing_on(int /*<<< orphan*/);
void disable_tracing(void) { write_tracing_on(0); }


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

x86 assembly (clang, -O2):
<disable_tracing>:
xor    %edi,%edi
jmp    1030 <write_tracing_on@plt>

LLVM IR (-O0):
define void @disable_tracing() {
%1 = call i32 @write_tracing_on(i32 0)
ret void
}

LLVM IR (-O2):
define void @disable_tracing() {
%1 = tail call i32 @write_tracing_on(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x23() {
  Assert_real((isodigit(35) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              180, ("isodigit should be 0 for #"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x23>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xb4,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x23>:
push   %rax
mov    $0x23,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xb4,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for #\00"
define void @t_isodigit_0x23() {
%1 = call i64 @isodigit(i32 35)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for #\00"
define void @t_isodigit_0x23() {
%1 = tail call i64 @isodigit(i32 35)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_srand_time();
void nlosrt(void) { nlopt_srand_time(); }


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

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

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

LLVM IR (-O2):
define void @nlosrt() {
%1 = tail call i32 (...) @nlopt_srand_time()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse(int num) {
  int rev;
  rev = rev * 10 + num % 10;
  num = num / 10;
  printf("the reversed number is%d", rev);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
lea    0xecb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"the reversed number is%d\00"
define i32 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 10
%7 = load i32, i32* %3
%8 = srem i32 %7, 10
%9 = add nsw i32 %6, %8
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = sdiv i32 %10, 10
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"the reversed number is%d\00"
define i32 @reverse(i32 %0) {
%2 = srem i32 %0, 10
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Variables and functions */
int a_cas(int volatile *, int, int);
void a_or(volatile int *p, int v) {
  int old;
  do
    old = *p;
  while (a_cas(p, old, old | v) != old);
}


x86 assembly (clang, -O0):
<a_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
or     -0xc(%rbp),%edx
call   1030 <a_cas@plt>
cmp    -0x10(%rbp),%eax
jne    111f <a_or+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%ebp
mov    %ebp,%edx
or     %r14d,%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <a_cas@plt>
cmp    %ebp,%eax
jne    1120 <a_or+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @a_or(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** %3
%8 = load volatile i32, i32* %7
store i32 %8, i32* %5
br label %9
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = or i32 %12, %13
%15 = call i32 @a_cas(i32* %10, i32 %11, i32 %14)
%16 = load i32, i32* %5
%17 = icmp ne i32 %15, %16
br i1 %17, label %6, label %18
18: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @a_or(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = or i32 %4, %1
%6 = tail call i32 @a_cas(i32* %0, i32 %4, i32 %5)
%7 = icmp eq i32 %6, %4
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ SQLITE_OK;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ file_getlocaldatabasepath(char *, int);
scalar_t__ sqlite3_open(char *, int /*<<< orphan*/ **);
void opendatabase(sqlite3 **db) {
  char datapath[128];
  file_getlocaldatabasepath(datapath, 128);
  if (sqlite3_open(datapath, db) != SQLITE_OK)
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<opendatabase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
call   1040 <file_getlocaldatabasepath@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <sqlite3_open@plt>
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
je     117e <opendatabase+0x4e>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendatabase>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%esi
call   1040 <file_getlocaldatabasepath@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <sqlite3_open@plt>
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <opendatabase+0x3f>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SQLITE_OK = global i64 0
@EXIT_FAILURE = global i32 0
define void @opendatabase(i32** %0) {
%2 = alloca i32**
%3 = alloca [128 x i8]
store i32** %0, i32*** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @file_getlocaldatabasepath(i8* %4, i32 128)
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = load i32**, i32*** %2
%8 = call i64 @sqlite3_open(i8* %6, i32** %7)
%9 = load i64, i64* @SQLITE_OK
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@SQLITE_OK = global i64 0
@EXIT_FAILURE = global i32 0
define void @opendatabase(i32** %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @file_getlocaldatabasepath(i8* %3, i32 128)
%5 = call i64 @sqlite3_open(i8* %3, i32** %0)
%6 = load i64, i64* @SQLITE_OK
%7 = icmp eq i64 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int);
int /*<<< orphan*/ t16_data_rdn3_op();
void t16_adc_rdn3() { arm_arith_add(t16_data_rdn3_op(), 1); }


x86 assembly (clang, -O0):
<t16_adc_rdn3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t16_data_rdn3_op@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_adc_rdn3>:
push   %rax
xor    %eax,%eax
call   1040 <t16_data_rdn3_op@plt>
mov    %eax,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <arm_arith_add@plt>

LLVM IR (-O0):
define void @t16_adc_rdn3() {
%1 = call i32 (...) @t16_data_rdn3_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @t16_adc_rdn3() {
%1 = tail call i32 (...) @t16_data_rdn3_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("To C, or not to C: that is the question.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"To C, or not to C: that is the question.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"To C, or not to C: that is the question.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 0
}