xunge/DecIR huggingface dataset:
void __attribute__((weak)) vApplicationIdleHook() {}


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

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

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

LLVM IR (-O2):
define weak void @vApplicationIdleHook() {
ret void
}
void Host_Throttle(void) {}


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

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

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

LLVM IR (-O2):
define void @Host_Throttle() {
ret void
}
int test_imm_D6uint16_mem(unsigned short *val) {
  return ((*val) & (-0xD6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D6uint16_mem>:
movzwl (%rdi),%eax
test   $0xff2a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D6uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -214
%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_D6uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -214
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void XrmQuarkToString() {}


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

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

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

LLVM IR (-O2):
define void @XrmQuarkToString() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
long long _m_to_int64(int /*<<< orphan*/);
long long test_m_to_int64(__m64 a) { return _m_to_int64(a); }


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

x86 assembly (clang, -O2):
<test_m_to_int64>:
jmp    1030 <_m_to_int64@plt>

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

LLVM IR (-O2):
define i64 @test_m_to_int64(i32 %0) {
%2 = tail call i64 @_m_to_int64(i32 %0)
ret i64 %2
}
/* Variables and functions */
void *malloc(size_t);
void *s_malloc(size_t size) {
  if (size == 0)
    return NULL;
  return malloc(size);
}


x86 assembly (clang, -O0):
<s_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <s_malloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <s_malloc+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_malloc>:
test   %rdi,%rdi
je     111a <s_malloc+0xa>
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @s_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @s_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int cmp(const void *a, const void *b) {
  return (*(unsigned long long *)a - *(unsigned long long *)b);
}


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

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

LLVM IR (-O0):
define i32 @cmp(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 i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ vthconvert(int, char *, int /*<<< orphan*/ const *);
char *Var_To_Hex(int realsize, const uint8_t *TOHEXINPUT) {
  if (TOHEXINPUT != NULL) {
    static char convert_resultz1[800] = "\0";
    bzero(convert_resultz1, 800);
    vthconvert(realsize, convert_resultz1, TOHEXINPUT);
    return convert_resultz1;
  }
}


x86 assembly (clang, -O0):
<Var_To_Hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <Var_To_Hex+0x49>
lea    0x2eff(%rip),%rdi
mov    $0x320,%esi
call   1040 <bzero@plt>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0x2ee7(%rip),%rsi
call   1030 <vthconvert@plt>
lea    0x2edb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Var_To_Hex>:
test   %rsi,%rsi
je     1153 <Var_To_Hex+0x33>
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x2f0b(%rip),%r14
mov    %r14,%rdi
mov    $0x320,%esi
call   1040 <bzero@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <vthconvert@plt>
pop    %rbx
pop    %r14
pop    %rbp
lea    0x2ee6(%rip),%rax
ret

LLVM IR (-O0):
@Var_To_Hex.convert_resultz1 = internal global [800 x i8] zeroinitializer
define i8* @Var_To_Hex(i32 %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 @bzero(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Var_To_Hex.convert_resultz1, i64 0, i64 0), i32 800)
%10 = load i32, i32* %4
%11 = load i32*, i32** %5
%12 = call i32 @vthconvert(i32 %10, i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Var_To_Hex.convert_resultz1, i64 0, i64 0), i32* %11)
store i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Var_To_Hex.convert_resultz1, i64 0, i64 0), i8** %3
br label %13
13: ; preds = %8, %2
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@Var_To_Hex.convert_resultz1 = internal global [800 x i8] zeroinitializer
define i8* @Var_To_Hex(i32 %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @bzero(i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Var_To_Hex.convert_resultz1, i64 0, i64 0), i32 800)
%6 = tail call i32 @vthconvert(i32 %0, i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Var_To_Hex.convert_resultz1, i64 0, i64 0), i32* %1)
br label %7
7: ; preds = %4, %2
ret i8* getelementptr inbounds ([800 x i8], [800 x i8]* @Var_To_Hex.convert_resultz1, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1, j = -2, k;
  k = (i >= 0) && (j >= 00) || (i <= 0) && (j <= 0);
  printf("%d", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xfffffffe,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1146 <main+0x36>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jge    1165 <main+0x55>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jg     115f <main+0x4f>
cmpl   $0x0,-0xc(%rbp)
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 -2, i32* %3
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 0
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %7
%19 = phi i1 [ true, %7 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
void *__attribute__((__unused__))
_hash_pthread_mtx_init_hnode_hh(void *_HU_d __attribute__((__unused__))) {
  pthread_mutex_t *mtx;
  mtx = malloc(sizeof(*mtx));
  if (mtx != NULL)
    pthread_mutex_init(mtx, NULL);
  return (void *)mtx;
}


x86 assembly (clang, -O0):
<_hash_pthread_mtx_init_hnode_hh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <_hash_pthread_mtx_init_hnode_hh+0x32>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_mutex_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_pthread_mtx_init_hnode_hh>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <_hash_pthread_mtx_init_hnode_hh+0x1d>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_hash_pthread_mtx_init_hnode_hh(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i32 @pthread_mutex_init(i32* %8, i32* null)
br label %10
10: ; preds = %7, %1
%11 = load i32*, i32** %3
%12 = bitcast i32* %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @_hash_pthread_mtx_init_hnode_hh(i8* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pthread_mutex_init(i32* %2, i32* null)
br label %6
6: ; preds = %4, %1
%7 = bitcast i32* %2 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void help() {
  setgid(getgid());
  setuid(getuid());
  printf("chown-xterm makes %s suid root\n", "/x11/programs/xterm/xterm");
  printf("This is necessary on Ultrix for /dev/tty operation.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <getgid@plt>
mov    %eax,%edi
call   1060 <setgid@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1080 <setuid@plt>
lea    0xe79(%rip),%rdi
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %eax,%eax
call   1060 <getgid@plt>
mov    %eax,%edi
call   1070 <setgid@plt>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1090 <setuid@plt>
lea    0xe6c(%rip),%rdi
lea    0xe85(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"chown-xterm makes %s suid root\0A\00"
@.str.1 = [26 x i8] c"/x11/programs/xterm/xterm\00"
@.str.2 = [53 x i8] c"This is necessary on Ultrix for /dev/tty operation.\0A\00"
define void @help() {
%1 = call i32 (...) @getgid()
%2 = call i32 @setgid(i32 %1)
%3 = call i32 (...) @getuid()
%4 = call i32 @setuid(i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"chown-xterm makes %s suid root\0A\00"
@.str.1 = [26 x i8] c"/x11/programs/xterm/xterm\00"
@str = [52 x i8] c"This is necessary on Ultrix for /dev/tty operation.\00"
define void @help() {
%1 = tail call i32 (...) @getgid()
%2 = tail call i32 @setgid(i32 %1)
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 @setuid(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar(void *, int /*<<< orphan*/, int *);
void baz(void *dpy, int win, int prop) { bar((void *)0, 0, (int *)0); }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @baz(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @bar(i8* null, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @baz(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @bar(i8* null, i32 0, i32* null)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ nomem();
void *sipMalloc(size_t n) {
  void *h;
  if ((h = malloc(n)) == NULL)
    nomem();
  memset(h, 0, n);
  return h;
}


x86 assembly (clang, -O0):
<sipMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115a <sipMalloc+0x2a>
mov    $0x0,%al
call   1040 <nomem@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sipMalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <sipMalloc+0x1b>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sipMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @nomem()
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
%11 = load i64, i64* %2
%12 = call i32 @memset(i8* %10, i32 0, i64 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @sipMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @nomem()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local2;
  unsigned int local1;
  {
    state[0UL] = input[0UL] ^ 700325083U;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] << 1U) | 396342719U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    $0x29be1cdb,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    $0x1,%rax
jae    1160 <RandomFunc+0x60>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    1151 <RandomFunc+0x51>
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1135 <RandomFunc+0x35>
mov    -0x1c(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x1c(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
or     $0x179fb5bf,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
add    %eax,%eax
or     $0x179fb5bf,%eax
xor    $0x40600800,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = xor i32 %10, 700325083
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %11, i32* %12
store i32 0, i32* %7
br label %13
13: ; preds = %27, %2
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = icmp ult i64 %15, 1
br i1 %16, label %17, label %32
17: ; preds = %13
store i32 0, i32* %6
br label %18
18: ; preds = %22, %17
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = icmp ult i64 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = add i64 %24, 2
%26 = trunc i64 %25 to i32
store i32 %26, i32* %6
br label %18
27: ; preds = %18
%28 = load i32, i32* %7
%29 = zext i32 %28 to i64
%30 = add i64 %29, 2
%31 = trunc i64 %30 to i32
store i32 %31, i32* %7
br label %13
32: ; preds = %13
%33 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%34 = load i32, i32* %33
%35 = shl i32 %34, 1
%36 = or i32 %35, 396342719
%37 = load i32*, i32** %4
%38 = getelementptr inbounds i32, i32* %37, i64 0
store i32 %36, i32* %38
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 1
%5 = or i32 %4, 396342719
%6 = xor i32 %5, 1080035328
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
char *concat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s1[] = "karthik ";
  char s2[] = "jayashree";
  char *s3 = concat("karthik ", "jayashree");
  printf("%s\n", s3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0xf(%rbp)
lea    0xea0(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1040 <concat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <concat@plt>
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"karthik \00"
@.str.1 = [10 x i8] c"jayashree\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @concat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret i32 0
}
int bothNonZero_1(int x, int y) {
  if (x) {
    if (y) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<bothNonZero_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <bothNonZero_1+0x2f>
cmpl   $0x0,-0xc(%rbp)
je     112a <bothNonZero_1+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1136 <bothNonZero_1+0x36>
jmp    112f <bothNonZero_1+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bothNonZero_1>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bothNonZero_1(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void set_process_name(const char *progname) {}


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

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

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

LLVM IR (-O2):
define void @set_process_name(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_array(int *arr, int length) {
  for (int i = 0; i < length; i++)
    printf("%d\n", arr[i]);
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int f1(int a, int b, int c, int d) { return ((a & d) | (b & c)) ^ (b & c); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%eax
and    %ecx,%edi
and    %edx,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = load i32, i32* %8
%11 = and i32 %9, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %12, %13
%15 = or i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = and i32 %16, %17
%19 = xor i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %3, %0
%6 = and i32 %2, %1
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
scalar_t__ mkdir(char *, int);
scalar_t__ mkdir_for_file(char *);
int mkdir_recursive(char *dir) {
  return 0 == mkdir_for_file(dir) && (0 == mkdir(dir, 0700) || errno == EEXIST)
             ? 0
             : -1;
}


x86 assembly (clang, -O0):
<mkdir_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mkdir_for_file@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x9(%rbp)
jne    1189 <mkdir_recursive+0x69>
mov    -0x8(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
mov    %rax,%rdx
mov    $0x1,%al
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0xa(%rbp)
je     1183 <mkdir_recursive+0x63>
mov    0x2e68(%rip),%rax
mov    (%rax),%rax
mov    0x2e66(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0xffffffff,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir_recursive>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mkdir_for_file@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <mkdir_recursive+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
setne  %al
mov    0x2e86(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e84(%rip),%rdx
cmp    (%rdx),%rcx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
neg    %eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @mkdir_recursive(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mkdir_for_file(i8* %3)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @mkdir(i8* %7, i32 448)
%9 = icmp eq i64 0, %8
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i64, i64* @errno
%12 = load i64, i64* @EEXIST
%13 = icmp eq i64 %11, %12
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 0, i32 -1
ret i32 %19
}

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @mkdir_recursive(i8* %0) {
%2 = tail call i64 @mkdir_for_file(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i64 @mkdir(i8* %0, i32 448)
%6 = icmp ne i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EEXIST
%9 = icmp ne i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %4, %1
%13 = phi i32 [ -1, %1 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int bbm_word_read(void *, unsigned short, unsigned short *);
signed int bbm_com_word_read(void *handle, unsigned short addr,
                             unsigned short *data) {
  signed int res;
  res = bbm_word_read(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_word_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_word_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_word_read>:
jmp    1030 <bbm_word_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_word_read(i8* %0, i16 zeroext %1, i16* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16*
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i16* %2, i16** %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i16*, i16** %6
%11 = call i32 @bbm_word_read(i8* %8, i16 zeroext %9, i16* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_word_read(i8* %0, i16 zeroext %1, i16* %2) {
%4 = tail call i32 @bbm_word_read(i8* %0, i16 zeroext %1, i16* %2)
ret i32 %4
}
const char *prussdrv_strversion(int version) {
  switch (version) {
  case 1:
    return "AM18XX";
  case 2:
    return "AM33XX";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<prussdrv_strversion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <prussdrv_strversion+0x2c>
jmp    111b <prussdrv_strversion+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <prussdrv_strversion+0x3c>
jmp    114c <prussdrv_strversion+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <prussdrv_strversion+0x57>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <prussdrv_strversion+0x57>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prussdrv_strversion>:
cmp    $0x2,%edi
lea    0xefd(%rip),%rax
lea    0xefd(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"AM18XX\00"
@.str.1 = [7 x i8] c"AM33XX\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @prussdrv_strversion(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"AM18XX\00"
@.str.1 = [7 x i8] c"AM33XX\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @prussdrv_strversion(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int test_imm_A7int16_mem(short *val) {
  return ((*val) & (-0xA7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A7int16_mem>:
movzwl (%rdi),%eax
test   $0xff59,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A7int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -167
%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_A7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -167
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ abort();
scalar_t__ fputs(char const *, int /*<<< orphan*/ *);
scalar_t__ putc(char, int /*<<< orphan*/ *);
void putstring(FILE *f, const char *s) {
  if (s) {
    if (fputs(s, f) == EOF) {
      abort();
    }
  }
  if (putc('\n', f) == EOF) {
    abort();
  }
}


x86 assembly (clang, -O0):
<putstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1174 <putstring+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <putstring+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1174 <putstring+0x44>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1050 <putc@plt>
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
jne    1199 <putstring+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstring>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1150 <putstring+0x20>
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
je     116b <putstring+0x3b>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <putc@plt>
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
je     116b <putstring+0x3b>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@EOF = global i64 0
define void @putstring(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i32*, i32** %3
%10 = call i64 @fputs(i8* %8, i32* %9)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %7
br label %16
16: ; preds = %15, %2
%17 = load i32*, i32** %3
%18 = call i64 @putc(i8 signext 10, i32* %17)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %16
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
define void @putstring(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i64 @fputs(i8* %1, i32* %0)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %4, %2
%11 = tail call i64 @putc(i8 signext 10, i32* %0)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 (...) @abort()
unreachable
16: ; preds = %10
ret void
}
/* Type definitions */
typedef int uint16_t;
struct p4_field_match_ternary {
  int dummy;
};

/* Variables and functions */
struct p4_field_match_ternary *unpack_p4_field_match_ternary(char *buffer,
                                                             uint16_t offset) {
  return (struct p4_field_match_ternary *)(buffer + offset);
}


x86 assembly (clang, -O0):
<unpack_p4_field_match_ternary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_p4_field_match_ternary>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_field_match_ternary = type { i32 }
define %struct.p4_field_match_ternary* @unpack_p4_field_match_ternary(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.p4_field_match_ternary*
ret %struct.p4_field_match_ternary* %9
}

LLVM IR (-O2):
%struct.p4_field_match_ternary = type { i32 }
define %struct.p4_field_match_ternary* @unpack_p4_field_match_ternary(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_field_match_ternary*
ret %struct.p4_field_match_ternary* %5
}
/* Variables and functions */
size_t strlen(char *);
char *chop_newline(char *s) {
  size_t len;
  len = strlen(s);
  if (len > 0 && s[len - 1] == '\n')
    s[len - 1] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<chop_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    115d <chop_newline+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <chop_newline+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112a <chop_newline+0x1a>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112a <chop_newline+0x1a>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @chop_newline(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %4
store i8 0, i8* %6
br label %10
10: ; preds = %9, %4, %1
ret i8* %0
}
/* Type definitions */
struct dbt {
  int dummy;
};
struct dbn {
  int dummy;
};

/* Variables and functions */
struct dbn *db_search_dbn(struct dbt *, void *);
int db_exists(struct dbt *table, void *key) {
  struct dbn *p = db_search_dbn(table, key);
  return (p == NULL) ? 0 : 1;
}


x86 assembly (clang, -O0):
<db_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <db_search_dbn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_exists>:
push   %rax
call   1030 <db_search_dbn@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dbt = type { i32 }
%struct.dbn = type { i32 }
define i32 @db_exists(%struct.dbt* %0, i8* %1) {
%3 = alloca %struct.dbt*
%4 = alloca i8*
%5 = alloca %struct.dbn*
store %struct.dbt* %0, %struct.dbt** %3
store i8* %1, i8** %4
%6 = load %struct.dbt*, %struct.dbt** %3
%7 = load i8*, i8** %4
%8 = call %struct.dbn* @db_search_dbn(%struct.dbt* %6, i8* %7)
store %struct.dbn* %8, %struct.dbn** %5
%9 = load %struct.dbn*, %struct.dbn** %5
%10 = icmp eq %struct.dbn* %9, null
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
ret i32 %12
}

LLVM IR (-O2):
%struct.dbt = type { i32 }
%struct.dbn = type { i32 }
define i32 @db_exists(%struct.dbt* %0, i8* %1) {
%3 = tail call %struct.dbn* @db_search_dbn(%struct.dbt* %0, i8* %1)
%4 = icmp ne %struct.dbn* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x4b() {
  Assert_real((isalpha(75)),
              "/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_isalpha.c",
              380, ("isalpha should be 1 for K"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x4b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x17c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x4b>:
push   %rax
mov    $0x4b,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x17c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for K\00"
define void @t_isalpha_0x4b() {
%1 = call i32 @isalpha(i32 75)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for K\00"
define void @t_isalpha_0x4b() {
%1 = tail call i32 @isalpha(i32 75)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ fclose(int /*<<< orphan*/);
scalar_t__ ferror(int /*<<< orphan*/);
int /*<<< orphan*/ flipped_double();
int /*<<< orphan*/ header();
int /*<<< orphan*/ main_double();
int /*<<< orphan*/ main_float();
int /*<<< orphan*/ stdout;
int main() {
  header();
  main_float();
  main_double();
  flipped_double();
  if (ferror(stdout) || fclose(stdout))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <header@plt>
mov    $0x0,%al
call   1060 <main_float@plt>
mov    $0x0,%al
call   1070 <main_double@plt>
mov    $0x0,%al
call   1080 <flipped_double@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1040 <ferror@plt>
cmp    $0x0,%rax
jne    11bb <main+0x5b>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     11c7 <main+0x67>
movl   $0x1,-0x4(%rbp)
jmp    11ce <main+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <header@plt>
xor    %eax,%eax
call   1060 <main_float@plt>
xor    %eax,%eax
call   1070 <main_double@plt>
xor    %eax,%eax
call   1080 <flipped_double@plt>
mov    0x2e5c(%rip),%rbx
mov    (%rbx),%edi
call   1040 <ferror@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     119a <main+0x3a>
pop    %rbx
ret
mov    (%rbx),%edi
call   1050 <fclose@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @header()
%3 = call i32 (...) @main_float()
%4 = call i32 (...) @main_double()
%5 = call i32 (...) @flipped_double()
%6 = load i32, i32* @stdout
%7 = call i64 @ferror(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %0
%10 = load i32, i32* @stdout
%11 = call i64 @fclose(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %0
store i32 1, i32* %1
br label %15
14: ; preds = %9
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @header()
%2 = tail call i32 (...) @main_float()
%3 = tail call i32 (...) @main_double()
%4 = tail call i32 (...) @flipped_double()
%5 = load i32, i32* @stdout
%6 = tail call i64 @ferror(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* @stdout
%10 = tail call i64 @fclose(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %0
%14 = phi i32 [ 1, %0 ], [ %12, %8 ]
ret i32 %14
}
int is_comma_char(char c) { return (c == ','); }


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

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

LLVM IR (-O0):
define i32 @is_comma_char(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, 44
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_comma_char(i8 signext %0) {
%2 = icmp eq i8 %0, 44
%3 = zext i1 %2 to i32
ret i32 %3
}