xunge/DecIR huggingface dataset:
int test_imm_A5uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 91
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int int_order(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @int_order(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @int_order(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 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int irc_send(int socketfd, char *out) {
  printf(">> %s", out);
  return send(socketfd, out, strlen(out), 0);
}


x86 assembly (clang, -O0):
<irc_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_send>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
@.str = [6 x i8] c">> %s\00"
define i32 @irc_send(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @send(i32 %7, i8* %8, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c">> %s\00"
define i32 @irc_send(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ OpenScript(char *, int);
void SC_OpenFile(char *name) { OpenScript(name, 2); }


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

x86 assembly (clang, -O2):
<SC_OpenFile>:
mov    $0x2,%esi
jmp    1030 <OpenScript@plt>

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

LLVM IR (-O2):
define void @SC_OpenFile(i8* %0) {
%2 = tail call i32 @OpenScript(i8* %0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __print_error_message() {
  printf("\n Shut your fucking face, uncle fucka! \n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"\0A Shut your fucking face, uncle fucka! \0A\00"
define void @__print_error_message() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"\0A Shut your fucking face, uncle fucka! \00"
define void @__print_error_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XWindowChanges;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XWindowChanges(void *_p) {
  if (_p == NULL)
    abort();
  free((XWindowChanges *)_p);
}


x86 assembly (clang, -O0):
<free_XWindowChanges>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XWindowChanges+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XWindowChanges>:
test   %rdi,%rdi
je     112a <free_XWindowChanges+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XWindowChanges(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XWindowChanges(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
int isodigit(const unsigned char c) { return ((c & ~7) == '0'); }


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

x86 assembly (clang, -O2):
<isodigit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isodigit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -8
%6 = icmp eq i32 %5, 48
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isodigit(i8 zeroext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *calloc(size_t, int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *domts_strndup(const char *s, size_t len) {
  size_t retlen = ((strlen(s)) < (len) ? (strlen(s)) : (len));
  char *ret = calloc(retlen + 1, 1);
  memcpy(ret, s, retlen);
  return ret;
}


x86 assembly (clang, -O0):
<domts_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0x10(%rbp),%rax
jae    1165 <domts_strndup+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
jmp    116d <domts_strndup+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domts_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    %rbx,%rax
cmovb  %rax,%rbx
lea    0x1(%rbx),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @domts_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
br label %16
14: ; preds = %2
%15 = load i64, i64* %4
br label %16
16: ; preds = %14, %11
%17 = phi i64 [ %13, %11 ], [ %15, %14 ]
store i64 %17, i64* %5
%18 = load i64, i64* %5
%19 = add i64 %18, 1
%20 = call i8* @calloc(i64 %19, i32 1)
store i8* %20, i8** %6
%21 = load i8*, i8** %6
%22 = load i8*, i8** %3
%23 = load i64, i64* %5
%24 = call i32 @memcpy(i8* %21, i8* %22, i64 %23)
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @domts_strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp ult i64 %3, %1
%5 = select i1 %4, i64 %3, i64 %1
%6 = add i64 %5, 1
%7 = tail call i8* @calloc(i64 %6, i32 1)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %5)
ret i8* %7
}
unsigned long TimerPrescaleMatchGet(unsigned long ulBase,
                                    unsigned long ulTimer) {
  ;

  ;
  return ((ulTimer == 0x000000ff)
              ? (*((volatile unsigned long *)(ulBase + 0x00000040)))
              : (*((volatile unsigned long *)(ulBase + 0x00000044))));
}


x86 assembly (clang, -O0):
<TimerPrescaleMatchGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xff,-0x10(%rbp)
jne    112b <TimerPrescaleMatchGet+0x2b>
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <TimerPrescaleMatchGet+0x37>
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleMatchGet>:
xor    %eax,%eax
cmp    $0xff,%rsi
setne  %al
mov    0x40(%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @TimerPrescaleMatchGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 255
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add i64 %8, 64
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
br label %17
12: ; preds = %2
%13 = load i64, i64* %3
%14 = add i64 %13, 68
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
br label %17
17: ; preds = %12, %7
%18 = phi i64 [ %11, %7 ], [ %16, %12 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @TimerPrescaleMatchGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 255
%4 = select i1 %3, i64 64, i64 68
%5 = add i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeSysFiles(int fdStat, int fdMem, int fdLoad, int fdDisk) {
  close(fdStat);
  close(fdMem);
  close(fdLoad);
  close(fdDisk);
  return;
}


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

x86 assembly (clang, -O2):
<closeSysFiles>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
call   1030 <close@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeSysFiles(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @close(i32 %0)
%6 = tail call i32 @close(i32 %1)
%7 = tail call i32 @close(i32 %2)
%8 = tail call i32 @close(i32 %3)
ret void
}
int _ht_hash(int cap, int key) { return key % cap; }


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

x86 assembly (clang, -O2):
<_ht_hash>:
mov    %esi,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_ht_hash(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* %3
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @_ht_hash(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _databus_sem_op(int);
void _databus_lock() { _databus_sem_op(-1); }


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

x86 assembly (clang, -O2):
<_databus_lock>:
mov    $0xffffffff,%edi
jmp    1030 <_databus_sem_op@plt>

LLVM IR (-O0):
define void @_databus_lock() {
%1 = call i32 @_databus_sem_op(i32 -1)
ret void
}

LLVM IR (-O2):
define void @_databus_lock() {
%1 = tail call i32 @_databus_sem_op(i32 -1)
ret void
}
int get_lci(const unsigned char *packet) {
  return (packet[0] & 0x0F) * 256 + packet[1];
}


x86 assembly (clang, -O0):
<get_lci>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xf,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lci>:
movzbl (%rdi),%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
movzbl 0x1(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_lci(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
%8 = mul nsw i32 %7, 256
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_lci(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 15
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world cmake\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 = [19 x i8] c"hello world cmake\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"hello world cmake\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void MathLib_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @MathLib_Init() {
ret void
}
int main() {
  int counter = 0;
again:
  for (;;) {
  outerloop:
    if (counter == 1000) {
      counter = 50;
      break;
    }
    for (;;) {
      counter += 1;
      if (counter == 1000) {
        goto outerloop;
      }
    }
  }
  return counter - 50;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    1117 <main+0x17>
jmp    111c <main+0x1c>
cmpl   $0x3e8,-0x8(%rbp)
jne    1135 <main+0x35>
movl   $0x32,-0x8(%rbp)
jmp    115a <main+0x5a>
jmp    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jne    1155 <main+0x55>
jmp    111c <main+0x1c>
jmp    113a <main+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x32,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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 = %0
br label %4
4: ; preds = %3
br label %5
5: ; preds = %15, %4
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 50, i32* %2
br label %17
9: ; preds = %5
br label %10
10: ; preds = %16, %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1000
br i1 %14, label %15, label %16
15: ; preds = %10
br label %5
16: ; preds = %10
br label %10
17: ; preds = %8
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 50
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ date_name_to_value(char *, char *);
char *date_get_environment(char *variable_name) {
  static char datum[1024];
  if (date_name_to_value(datum, variable_name))
    return datum;
  else
    return (char *)0;
}


x86 assembly (clang, -O0):
<date_get_environment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2f19(%rip),%rdi
call   1030 <date_name_to_value@plt>
cmp    $0x0,%rax
je     1146 <date_get_environment+0x36>
lea    0x2f03(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <date_get_environment+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_environment>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f25(%rip),%rbx
mov    %rbx,%rdi
call   1030 <date_name_to_value@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@date_get_environment.datum = internal global [1024 x i8] zeroinitializer
define i8* @date_get_environment(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @date_name_to_value(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @date_get_environment.datum, i64 0, i64 0), i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @date_get_environment.datum, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@date_get_environment.datum = internal global [1024 x i8] zeroinitializer
define i8* @date_get_environment(i8* %0) {
%2 = tail call i64 @date_name_to_value(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @date_get_environment.datum, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @date_get_environment.datum, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("ls -l");
  system("bash -c 'echo $(uname -a)'");
  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 <system@plt>
lea    0xed4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ls -l\00"
@.str.1 = [27 x i8] c"bash -c 'echo $(uname -a)'\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"ls -l\00"
@.str.1 = [27 x i8] c"bash -c 'echo $(uname -a)'\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ huffman_code(char *, int *, int);
int main() {
  char arr[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
  int freq[] = {2, 3, 6, 7, 10, 19, 21, 32};
  int size = sizeof(arr) / sizeof(arr[0]);
  huffman_code(arr, freq, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1030 <huffman_code@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,0x8(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <huffman_code@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i8] c"abcdefgh"
@__const.main.freq = [8 x i32] [i32 2, i32 3, i32 6, i32 7, i32 10, i32 19, i32 21, i32 32]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [8 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [8 x i8]* %2 to i8*
%6 = bitcast [8 x i32]* %3 to i8*
store i32 8, i32* %4
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @huffman_code(i8* %7, i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.freq = [8 x i32] [i32 2, i32 3, i32 6, i32 7, i32 10, i32 19, i32 21, i32 32]
define i32 @main() {
%1 = alloca i64
%2 = alloca [8 x i32]
%3 = bitcast i64* %1 to i8*
store i64 7523094288207667809, i64* %1
%4 = bitcast [8 x i32]* %2 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = call i32 @huffman_code(i8* %3, i32* %5, i32 8)
ret i32 0
}
int do_004() { return 4; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @do_004() {
ret i32 4
}

LLVM IR (-O2):
define i32 @do_004() {
ret i32 4
}
long long llabs(long long __n) { return (__n < 0LL) ? -__n : __n; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ putwchar(int);
void locale_letter(struct termp *p, int c) { putwchar(c); }


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

x86 assembly (clang, -O2):
<locale_letter>:
mov    %esi,%edi
jmp    1030 <putwchar@plt>

LLVM IR (-O0):
%struct.termp = type { i32 }
define void @locale_letter(%struct.termp* %0, i32 %1) {
%3 = alloca %struct.termp*
%4 = alloca i32
store %struct.termp* %0, %struct.termp** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @putwchar(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define void @locale_letter(%struct.termp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @putwchar(i32 %1)
ret void
}
/* Variables and functions */
int strnlen(char const *, int);
int /*<<< orphan*/ yaffsfs_SetError(int);
int yaffsfs_CheckNameLength(const char *name) {
  int retVal = 0;
  int nameLength = strnlen(name, 255 + 1);
  if (nameLength == 0) {
    yaffsfs_SetError(-2);
    retVal = -1;
  } else if (nameLength > 255) {
    yaffsfs_SetError(-36);
    retVal = -1;
  }
  return retVal;
}


x86 assembly (clang, -O0):
<yaffsfs_CheckNameLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x100,%esi
call   1030 <strnlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1164 <yaffsfs_CheckNameLength+0x44>
mov    $0xfffffffe,%edi
call   1040 <yaffsfs_SetError@plt>
movl   $0xffffffff,-0xc(%rbp)
jmp    1187 <yaffsfs_CheckNameLength+0x67>
cmpl   $0xff,-0x10(%rbp)
jle    1182 <yaffsfs_CheckNameLength+0x62>
mov    $0xffffffdc,%edi
call   1040 <yaffsfs_SetError@plt>
movl   $0xffffffff,-0xc(%rbp)
jmp    1187 <yaffsfs_CheckNameLength+0x67>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffsfs_CheckNameLength>:
push   %rax
mov    $0x100,%esi
call   1030 <strnlen@plt>
test   %eax,%eax
je     1142 <yaffsfs_CheckNameLength+0x22>
mov    %eax,%ecx
xor    %eax,%eax
mov    $0xffffffdc,%edi
cmp    $0x100,%ecx
jge    1147 <yaffsfs_CheckNameLength+0x27>
pop    %rcx
ret
mov    $0xfffffffe,%edi
call   1040 <yaffsfs_SetError@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yaffsfs_CheckNameLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @strnlen(i8* %5, i32 256)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @yaffsfs_SetError(i32 -2)
store i32 -1, i32* %3
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 255
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @yaffsfs_SetError(i32 -36)
store i32 -1, i32* %3
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @yaffsfs_CheckNameLength(i8* %0) {
%2 = tail call i32 @strnlen(i8* %0, i32 256)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = icmp sgt i32 %2, 255
br i1 %5, label %6, label %9
6: ; preds = %4, %1
%7 = phi i32 [ -2, %1 ], [ -36, %4 ]
%8 = tail call i32 @yaffsfs_SetError(i32 %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ -1, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_write_20(unsigned int data) {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 4;
  exynos_5410_gpio_write_mask(bank_offset, ((data & 1U) << bit_index),
                              (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_write_20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xc40,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0x1,%esi
mov    -0xc(%rbp),%ecx
shl    %cl,%esi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_write_20>:
mov    %edi,%esi
shl    $0x4,%esi
and    $0x10,%esi
mov    $0xc40,%edi
mov    $0x10,%edx
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_write_20(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 3136, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = call i32 @exynos_5410_gpio_write_mask(i32 %5, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_write_20(i32 %0) {
%2 = shl i32 %0, 4
%3 = and i32 %2, 16
%4 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %3, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_can(int);
void CAN3_TX_IRQ_Handler(void) { process_can(2); }


x86 assembly (clang, -O0):
<CAN3_TX_IRQ_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <process_can@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAN3_TX_IRQ_Handler>:
mov    $0x2,%edi
jmp    1030 <process_can@plt>

LLVM IR (-O0):
define void @CAN3_TX_IRQ_Handler() {
%1 = call i32 @process_can(i32 2)
ret void
}

LLVM IR (-O2):
define void @CAN3_TX_IRQ_Handler() {
%1 = tail call i32 @process_can(i32 2)
ret void
}
/* Variables and functions */
scalar_t__ timlib_exists_character(char *, char);
char get_primary_key_data_delimiter(char *primary_key_data_buffer) {
  if (timlib_exists_character(primary_key_data_buffer, '^'))
    return '^';
  else
    return ',';
}


x86 assembly (clang, -O0):
<get_primary_key_data_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5e,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     113d <get_primary_key_data_delimiter+0x2d>
movb   $0x5e,-0x1(%rbp)
jmp    1141 <get_primary_key_data_delimiter+0x31>
movb   $0x2c,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_primary_key_data_delimiter>:
push   %rbx
mov    $0x5e,%ebx
mov    $0x5e,%esi
call   1030 <timlib_exists_character@plt>
test   %rax,%rax
mov    $0x2c,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @get_primary_key_data_delimiter(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @timlib_exists_character(i8* %4, i8 signext 94)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 94, i8* %2
br label %9
8: ; preds = %1
store i8 44, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @get_primary_key_data_delimiter(i8* %0) {
%2 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 94)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8 44, i8 94
ret i8 %4
}
/* Variables and functions */
char *mu_badv_if_hwaddr(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *mac_addr = mu_badv_if_hwaddr(NULL, NULL);
  if (mac_addr) {
    printf("%s", mac_addr);
  } else {
    printf("ERROR");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1040 <mu_badv_if_hwaddr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <main+0x41>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116f <main+0x4f>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mu_badv_if_hwaddr@plt>
test   %rax,%rax
je     1142 <main+0x22>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1150 <main+0x30>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = tail call i8* @mu_badv_if_hwaddr(i32* null, i32* null)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i <= 255; i++)
    printf("ASCII value of character %c: %d\n", i, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"ASCII value of character %c: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"ASCII value of character %c: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int fun836() { return 836; }


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

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

LLVM IR (-O0):
define i32 @fun836() {
ret i32 836
}

LLVM IR (-O2):
define i32 @fun836() {
ret i32 836
}
extern void extern_extern_predeclared(void) {}


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

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

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

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

/* Variables and functions */
struct expData *expDataLoadTable(struct sqlConnection *, char *);
struct sqlConnection *sqlConnect(char *);
int /*<<< orphan*/ sqlDisconnect(struct sqlConnection **);
struct expData *expDataConnectAndLoadTable(char *database, char *table) {
  struct sqlConnection *conn = sqlConnect(database);
  struct expData *exps = expDataLoadTable(conn, table);
  sqlDisconnect(&conn);
  return exps;
}


x86 assembly (clang, -O0):
<expDataConnectAndLoadTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sqlConnect@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <expDataLoadTable@plt>
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <sqlDisconnect@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expDataConnectAndLoadTable>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1040 <sqlConnect@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <expDataLoadTable@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1050 <sqlDisconnect@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.expData = type { i32 }
%struct.sqlConnection = type { i32 }
define %struct.expData* @expDataConnectAndLoadTable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.sqlConnection*
%6 = alloca %struct.expData*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call %struct.sqlConnection* @sqlConnect(i8* %7)
store %struct.sqlConnection* %8, %struct.sqlConnection** %5
%9 = load %struct.sqlConnection*, %struct.sqlConnection** %5
%10 = load i8*, i8** %4
%11 = call %struct.expData* @expDataLoadTable(%struct.sqlConnection* %9, i8* %10)
store %struct.expData* %11, %struct.expData** %6
%12 = call i32 @sqlDisconnect(%struct.sqlConnection** %5)
%13 = load %struct.expData*, %struct.expData** %6
ret %struct.expData* %13
}

LLVM IR (-O2):
%struct.expData = type { i32 }
%struct.sqlConnection = type { i32 }
define %struct.expData* @expDataConnectAndLoadTable(i8* %0, i8* %1) {
%3 = alloca %struct.sqlConnection*
%4 = bitcast %struct.sqlConnection** %3 to i8*
%5 = tail call %struct.sqlConnection* @sqlConnect(i8* %0)
store %struct.sqlConnection* %5, %struct.sqlConnection** %3
%6 = tail call %struct.expData* @expDataLoadTable(%struct.sqlConnection* %5, i8* %1)
%7 = call i32 @sqlDisconnect(%struct.sqlConnection** %3)
ret %struct.expData* %6
}
/* Variables and functions */
int /*<<< orphan*/ crack_pass();
int /*<<< orphan*/ parse_cmd(int, char **);
main(int argc, char **argv) {
  parse_cmd(argc, argv);
  crack_pass();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_cmd(i32 %0, i8** %1)
%4 = tail call i32 (...) @crack_pass()
ret i32 0
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCGIFADDR;
int wapi_get_addr(int, char const *, int /*<<< orphan*/, struct in_addr *);
int wapi_get_ip(int sock, const char *ifname, struct in_addr *addr) {
  return wapi_get_addr(sock, ifname, SIOCGIFADDR, addr);
}


x86 assembly (clang, -O0):
<wapi_get_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
call   1030 <wapi_get_addr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wapi_get_ip>:
mov    %rdx,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
jmp    1030 <wapi_get_addr@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@SIOCGIFADDR = global i32 0
define i32 @wapi_get_ip(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.in_addr*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.in_addr* %2, %struct.in_addr** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* @SIOCGIFADDR
%10 = load %struct.in_addr*, %struct.in_addr** %6
%11 = call i32 @wapi_get_addr(i32 %7, i8* %8, i32 %9, %struct.in_addr* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@SIOCGIFADDR = global i32 0
define i32 @wapi_get_ip(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = load i32, i32* @SIOCGIFADDR
%5 = tail call i32 @wapi_get_addr(i32 %0, i8* %1, i32 %4, %struct.in_addr* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_constant_and_var_0() {
  char *x = "abc";
  clang_analyzer_eval(strcasecmp(x, "Abc") == 0);
}


x86 assembly (clang, -O0):
<strcasecmp_constant_and_var_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_constant_and_var_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_constant_and_var_0() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @clang_analyzer_eval(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_constant_and_var_0() {
%1 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
float Float__PLUS_(float x, float y) { return x + y; }


x86 assembly (clang, -O0):
<Float__PLUS_>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float__PLUS_>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @Float__PLUS_(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo1(void) { printf("MAIN1\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"MAIN1\0A\00"
define void @foo1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"MAIN1\00"
define void @foo1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265nal_get_type(const uint8_t *p_h265nal) {
  return (p_h265nal[3] & 0x7e) >> 1;
}


x86 assembly (clang, -O0):
<h265nal_get_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x7e,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265nal_get_type>:
mov    0xc(%rdi),%eax
shr    %eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @h265nal_get_type(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 126
%7 = ashr i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @h265nal_get_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 63
ret i32 %5
}
void seti18npackage(void) {}


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

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

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

LLVM IR (-O2):
define void @seti18npackage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CPROVER_EIGEN_charpoly();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ check_safety();
int /*<<< orphan*/ check_stability();
int /*<<< orphan*/ closed_loop();
void safety_stability(void) {
  closed_loop();
  __CPROVER_EIGEN_charpoly();
  assert(check_stability());
  assert(check_safety());
}


x86 assembly (clang, -O0):
<safety_stability>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <closed_loop@plt>
mov    $0x0,%al
call   1030 <__CPROVER_EIGEN_charpoly@plt>
mov    $0x0,%al
call   1060 <check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <check_safety@plt>
mov    %eax,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<safety_stability>:
push   %rax
xor    %eax,%eax
call   1070 <closed_loop@plt>
xor    %eax,%eax
call   1030 <__CPROVER_EIGEN_charpoly@plt>
xor    %eax,%eax
call   1060 <check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <check_safety@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @safety_stability() {
%1 = call i32 (...) @closed_loop()
%2 = call i32 (...) @__CPROVER_EIGEN_charpoly()
%3 = call i32 (...) @check_stability()
%4 = call i32 @assert(i32 %3)
%5 = call i32 (...) @check_safety()
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @safety_stability() {
%1 = tail call i32 (...) @closed_loop()
%2 = tail call i32 (...) @__CPROVER_EIGEN_charpoly()
%3 = tail call i32 (...) @check_stability()
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @check_safety()
%6 = tail call i32 @assert(i32 %5)
ret void
}
void handle_QUIT(int sig) {}


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

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

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

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