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


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_backward_to_tag_toggle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ diskInit();
void cmdDiskPrintFtime(char *path) {
  if (!diskInit()) {
    return;
  }
}


x86 assembly (clang, -O0):
<cmdDiskPrintFtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <diskInit@plt>
cmp    $0x0,%eax
jne    1131 <cmdDiskPrintFtime+0x21>
jmp    1131 <cmdDiskPrintFtime+0x21>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmdDiskPrintFtime(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @diskInit()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @cmdDiskPrintFtime(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @diskInit()
ret void
}
char TestP() {
  char r, res = 1;
  __asm__("addb $2, %1" : "=@ccp"(r), "+r"(res));
  if (r) {
    __asm__("addb $1, %1" : "=@ccnp"(r), "+r"(res));
    if (r)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestP>:
push   %rbp
mov    %rsp,%rbp
movb   $0x1,-0x3(%rbp)
mov    -0x3(%rbp),%al
add    $0x2,%al
setp   %cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1146 <TestP+0x46>
mov    -0x3(%rbp),%al
add    $0x1,%al
setnp  %cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1141 <TestP+0x41>
movb   $0x1,-0x1(%rbp)
jmp    114a <TestP+0x4a>
jmp    1146 <TestP+0x46>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestP>:
mov    $0x1,%al
mov    $0x1,%cl
add    $0x2,%cl
jnp    110f <TestP+0xf>
add    $0x1,%cl
jp     110f <TestP+0xf>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestP() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 1, i8* %3
%4 = load i8, i8* %3
%5 = call { i8, i8 } asm "addb $$2, $1", "={@ccp},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 %4)
%6 = extractvalue { i8, i8 } %5, 0
%7 = extractvalue { i8, i8 } %5, 1
store i8 %6, i8* %2
store i8 %7, i8* %3
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %0
%11 = load i8, i8* %3
%12 = call { i8, i8 } asm "addb $$1, $1", "={@ccnp},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 %11)
%13 = extractvalue { i8, i8 } %12, 0
%14 = extractvalue { i8, i8 } %12, 1
store i8 %13, i8* %2
store i8 %14, i8* %3
%15 = load i8, i8* %2
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
store i8 1, i8* %1
br label %20
18: ; preds = %10
br label %19
19: ; preds = %18, %0
store i8 0, i8* %1
br label %20
20: ; preds = %19, %17
%21 = load i8, i8* %1
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @TestP() {
%1 = tail call { i8, i8 } asm "addb $$2, $1", "={@ccp},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 1)
%2 = extractvalue { i8, i8 } %1, 0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = extractvalue { i8, i8 } %1, 1
%6 = tail call { i8, i8 } asm "addb $$1, $1", "={@ccnp},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 %5)
%7 = extractvalue { i8, i8 } %6, 0
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4, %0
br label %10
10: ; preds = %4, %9
%11 = phi i8 [ 0, %9 ], [ 1, %4 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int parseeseq(const char *s) {
  char tmp[4];
  memcpy(tmp, s + 2, 3);
  tmp[3] = '\0';
  return (int)strtol(tmp, NULL, 8);
}


x86 assembly (clang, -O0):
<parseeseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
mov    $0x3,%edx
call   1040 <memcpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseeseq>:
push   %rbx
sub    $0x10,%rsp
lea    0x2(%rdi),%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <memcpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parseeseq(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = call i32 @memcpy(i8* %4, i8* %6, i32 3)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = call i64 @strtol(i8* %9, i32* null, i32 8)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @parseeseq(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 3)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 0, i8* %6
%7 = call i64 @strtol(i8* nocapture %3, i32* null, i32 8)
%8 = trunc i64 %7 to i32
ret i32 %8
}
void rop3_208_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_208_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_208_0_0>:
mov    (%rdi),%al
not    %al
or     %sil,%al
and    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_208_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_208_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = and i8 %6, %2
store i8 %7, i8* %0
ret void
}
__attribute__((no, noclone)) signed __int128 t110_3mul(unsigned __int128 y) {
  signed __int128 r;
  if (__builtin_mul_overflow((signed __int128)(-1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t110_3mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %rdx,%rcx
neg    %rcx
mov    %eax,%ecx
sbb    %rsi,%rcx
neg    %rdx
movabs $0x8000000000000000,%rax
sbb    %rsi,%rax
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    116d <t110_3mul+0x5d>
jmp    1174 <t110_3mul+0x64>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t110_3mul>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    %rdi,%rbx
neg    %rbx
sbb    %rsi,%r14
cmp    $0x1,%rdi
movabs $0x8000000000000000,%rax
sbb    %rax,%rsi
jb     113a <t110_3mul+0x2a>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t110_3mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 1, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ugt i128 %14, -170141183460469231731687303715884105728
%16 = or i1 %13, %15
%17 = sub i128 0, %14
%18 = select i1 true, i128 %17, i128 %14
store i128 %18, i128* %6
br i1 %16, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @bar()
br label %21
21: ; preds = %19, %2
%22 = load i128, i128* %6
store i128 %22, i128* %3
%23 = bitcast i128* %3 to { i64, i64 }*
%24 = load { i64, i64 }, { i64, i64 }* %23
ret { i64, i64 } %24
}

LLVM IR (-O2):
define { i64, i64 } @t110_3mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = icmp ugt i128 %6, -170141183460469231731687303715884105728
%8 = sub i128 0, %6
br i1 %7, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (...) @bar()
br label %11
11: ; preds = %9, %2
%12 = trunc i128 %8 to i64
%13 = lshr i128 %8, 64
%14 = trunc i128 %13 to i64
%15 = insertvalue { i64, i64 } poison, i64 %12, 0
%16 = insertvalue { i64, i64 } %15, i64 %14, 1
ret { i64, i64 } %16
}
int utoupper(int c) {
  if (c >= 'a' && c <= 'z')
    c += 'A' - 'a';
  return c;
}


x86 assembly (clang, -O0):
<utoupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <utoupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <utoupper+0x24>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @utoupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @utoupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void TELEMETRY_SetUpdated(int telem) { (void)telem; }


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

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

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

LLVM IR (-O2):
define void @TELEMETRY_SetUpdated(i32 %0) {
ret void
}
/* Type definitions */
typedef void FILE;

/* Variables and functions */
int errno;
void *fopen(char const *, char const *);
void *img_stdio_fopen(const char *path, const char *mode, int *error) {
  FILE *file = fopen(path, mode);
  if (!file)
    *error = errno;
  return file;
}


x86 assembly (clang, -O0):
<img_stdio_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114f <img_stdio_fopen+0x3f>
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_stdio_fopen>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1120 <img_stdio_fopen+0x10>
pop    %rbx
ret
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define noalias i8* @img_stdio_fopen(i8* nocapture %0, i8* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @fopen(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = load i32, i32* @errno
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %3
ret i8* %4
}
void Update_video() {}


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

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

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

LLVM IR (-O2):
define void @Update_video() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MSG_log_mfilter_remove(char const *);
void MSG_log_mfilter_remove_entry(const char **mentry) {
  if (mentry) {
    do {
      MSG_log_mfilter_remove(*mentry);
    } while (*(++mentry));
  }
}


x86 assembly (clang, -O0):
<MSG_log_mfilter_remove_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <MSG_log_mfilter_remove_entry+0x47>
jmp    112c <MSG_log_mfilter_remove_entry+0x1c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <MSG_log_mfilter_remove@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,0x8(%rax)
jne    112c <MSG_log_mfilter_remove_entry+0x1c>
jmp    1157 <MSG_log_mfilter_remove_entry+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSG_log_mfilter_remove_entry>:
push   %rbx
test   %rdi,%rdi
je     1131 <MSG_log_mfilter_remove_entry+0x21>
mov    %rdi,%rbx
mov    (%rdi),%rdi
add    $0x8,%rbx
call   1030 <MSG_log_mfilter_remove@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <MSG_log_mfilter_remove_entry+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @MSG_log_mfilter_remove_entry(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
br label %5
5: ; preds = %3, %5
%6 = phi i8* [ %10, %5 ], [ %4, %3 ]
%7 = phi i8** [ %9, %5 ], [ %0, %3 ]
%8 = tail call i32 @MSG_log_mfilter_remove(i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret void
}
void Sched_Init(void) {
  (*(volatile unsigned long *)(0xE0004000 + 0x70)) = 0;
  (*(volatile unsigned long *)(0xE0004000 + 0x0C)) = (7) - 1;
  (*(volatile unsigned long *)(0xE0004000 + 0x04)) = 0x01;
  (*(volatile unsigned long *)(0xE0004000 + 0x14)) = 0x01;
}


x86 assembly (clang, -O0):
<Sched_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0004070,%eax
movq   $0x0,(%rax)
mov    $0xe000400c,%eax
movq   $0x6,(%rax)
mov    $0xe0004004,%eax
movq   $0x1,(%rax)
mov    $0xe0004014,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sched_Init>:
mov    $0xe0004004,%eax
movq   $0x0,0x6c(%rax)
movq   $0x6,0x8(%rax)
movq   $0x1,(%rax)
movq   $0x1,0x10(%rax)
ret

LLVM IR (-O0):
define void @Sched_Init() {
store volatile i64 0, i64* inttoptr (i64 3758112880 to i64*)
store volatile i64 6, i64* inttoptr (i64 3758112780 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112788 to i64*)
ret void
}

LLVM IR (-O2):
define void @Sched_Init() {
store volatile i64 0, i64* inttoptr (i64 3758112880 to i64*)
store volatile i64 6, i64* inttoptr (i64 3758112780 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112788 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Z80_BuildParityTable();
void Z80_Init() { Z80_BuildParityTable(); }


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

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

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

LLVM IR (-O2):
define void @Z80_Init() {
%1 = tail call i32 (...) @Z80_BuildParityTable()
ret void
}
void _Jv_NewMultiArray() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_NewMultiArray() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t tripledes_get_preferred_block_size(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @tripledes_get_preferred_block_size() {
ret i32 8
}

LLVM IR (-O2):
define i32 @tripledes_get_preferred_block_size() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sum(int, double, double, double);
main() { printf("%f\n", sum(1, 2.3, 5.1, 0.0)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
movsd  0xecf(%rip),%xmm0
movsd  0xecf(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <sum@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
xorps  %xmm2,%xmm2
mov    $0x1,%edi
call   1040 <sum@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = call double @sum(i32 1, double 2.300000e+00, double 5.100000e+00, double 0.000000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double @sum(i32 1, double 2.300000e+00, double 5.100000e+00, double 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ A();
int /*<<< orphan*/ printf(char *, int);
void B() {
  int x;
  x = 1;
  printf("%d\n", x);
  A();
  printf("%d\n", x);
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <A@plt>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <A@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ *PEM_read_PrivateKey(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ *pkey_get_dsa(int /*<<< orphan*/ *, int /*<<< orphan*/ **);
DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb, void *u) {
  EVP_PKEY *pktmp;
  pktmp = PEM_read_PrivateKey(fp, NULL, cb, u);
  return pkey_get_dsa(pktmp, dsa);
}


x86 assembly (clang, -O0):
<PEM_read_DSAPrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <PEM_read_PrivateKey@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pkey_get_dsa@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_DSAPrivateKey>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1040 <PEM_read_PrivateKey@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pkey_get_dsa@plt>

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

LLVM IR (-O2):
define i32* @PEM_read_DSAPrivateKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = tail call i32* @PEM_read_PrivateKey(i32* %0, i32* null, i32* %2, i8* %3)
%6 = tail call i32* @pkey_get_dsa(i32* %5, i32** %1)
ret i32* %6
}
void nls_array_free(void *ptr) {
  _nls_free(
      (ptr),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/shi-mo/nameless-lang/refs/heads/master/mm.c",
      183, __FUNCTION__);
}


x86 assembly (clang, -O0):
<nls_array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0xb7,%edx
lea    0xf53(%rip),%rcx
mov    $0x0,%al
call   1030 <_nls_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nls_array_free>:
lea    0xee9(%rip),%rsi
lea    0xf68(%rip),%rcx
mov    $0xb7,%edx
xor    %eax,%eax
jmp    1030 <_nls_free@plt>

LLVM IR (-O0):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/shi-mo/nameless-lang/refs/heads/master/mm.c\00"
@__FUNCTION__.nls_array_free = [15 x i8] c"nls_array_free\00"
define void @nls_array_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_nls_free to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %3, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 183, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.nls_array_free, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/shi-mo/nameless-lang/refs/heads/master/mm.c\00"
@__FUNCTION__.nls_array_free = [15 x i8] c"nls_array_free\00"
define void @nls_array_free(i8* %0) {
%2 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_nls_free to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 183, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.nls_array_free, i64 0, i64 0))
ret void
}
void f(int t) { sizeof(t); }


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
int name_needs_quotes(name) const char *name;
{
  int c;
  while ((c = *name++) != '\0')
    if (!isalnum(c) && c != '_')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<name_needs_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1166 <name_needs_quotes+0x56>
mov    -0x14(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    1161 <name_needs_quotes+0x51>
cmpl   $0x5f,-0x14(%rbp)
je     1161 <name_needs_quotes+0x51>
movl   $0x1,-0x4(%rbp)
jmp    116d <name_needs_quotes+0x5d>
jmp    111c <name_needs_quotes+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_needs_quotes>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rbx),%ebp
test   %ebp,%ebp
je     1143 <name_needs_quotes+0x33>
add    $0x1,%rbx
mov    %ebp,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
jne    1120 <name_needs_quotes+0x10>
cmp    $0x5f,%bpl
je     1120 <name_needs_quotes+0x10>
mov    $0x1,%eax
jmp    1145 <name_needs_quotes+0x35>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @name_needs_quotes(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @isalnum(i32 %7)
%10 = icmp eq i32 %9, 0
%11 = icmp ne i8 %4, 95
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %13, label %2
13: ; preds = %2, %6
%14 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int get_end_l2(int);
int get_size_ip_header(int);
int get_end_ip_header(int port) {
  return get_end_l2(port) + get_size_ip_header(port);
}


x86 assembly (clang, -O0):
<get_end_ip_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_end_l2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_size_ip_header@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_end_ip_header>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <get_end_l2@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <get_size_ip_header@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_end_ip_header(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_end_l2(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @get_size_ip_header(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_end_ip_header(i32 %0) {
%2 = tail call i32 @get_end_l2(i32 %0)
%3 = tail call i32 @get_size_ip_header(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SU_Make_Uppercase(char *);
char *SU_Uppercase(char *The_String) {
  SU_Make_Uppercase(The_String);
  return The_String;
}


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

x86 assembly (clang, -O2):
<SU_Uppercase>:
push   %rbx
mov    %rdi,%rbx
call   1030 <SU_Make_Uppercase@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SU_Uppercase(i8* returned %0) {
%2 = tail call i32 @SU_Make_Uppercase(i8* %0)
ret i8* %0
}
void ptrace_sandbox_permit_mprotect(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_mprotect(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x10_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x10_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x10_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x10_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x10_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
int test_imm_62int32_mem(int *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 98
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, long);
int /*<<< orphan*/ stderr;
void ltoa(long val, char *string, int base) {
  if (base != 10) {
    fprintf(stderr, "itoa hack can only use base 10!\n");
    return;
  }
  sprintf(string, "%ld", val);
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
je     1157 <ltoa+0x37>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116b <ltoa+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
cmp    $0xa,%edx
jne    113d <ltoa+0x1d>
mov    %rdi,%rax
lea    0xef2(%rip),%rcx
mov    %rsi,%rdi
mov    %rcx,%rsi
mov    %rax,%rdx
jmp    1040 <sprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"itoa hack can only use base 10!\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
define void @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %16
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"itoa hack can only use base 10!\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
define void @ltoa(i64 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %2, 10
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %3
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %10
10: ; preds = %8, %5
ret void
}
void shutdownConsoleInterface() {}


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

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

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

LLVM IR (-O2):
define void @shutdownConsoleInterface() {
ret void
}
int roundup(int dividend, int divisor) {
  return (dividend / divisor + ((dividend % divisor) ? 1 : 0));
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @roundup(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = add nsw i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @roundup(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int atoi(char *);
char *getenv(char *);
int getDebugIndex() {
  char *indexString;
  int index;
  if ((indexString = getenv("GSQINDEX")) != NULL) {
    index = atoi(indexString);
    return index;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<getDebugIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1159 <getDebugIndex+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <getDebugIndex+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDebugIndex>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113b <getDebugIndex+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"GSQINDEX\00"
define i32 @getDebugIndex() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
int iswhite(char c) {
  if (c == ' ' || c == '\t')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1124 <iswhite+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1130 <iswhite+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <iswhite+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @iswhite(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int close(int const);
int drvFPGA_CloseDev(const int fd) { return close(fd); }


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

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

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

LLVM IR (-O2):
define i32 @drvFPGA_CloseDev(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("About to abort...\n");
  abort();
  puts(" i reckon it worked.\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"About to abort...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"About to abort...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @abort()
unreachable
}
int memcmp(s1, s2, n)
register char *s1, *s2;
register unsigned n;
{
  register int diff;
  while (n--) {
    diff = *s1++ - *s2++;
    if (diff)
      return diff;
  }
  return 0;
}


x86 assembly (clang, -O0):
<memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1166 <memcmp+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1161 <memcmp+0x61>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <memcmp+0x6d>
jmp    110f <memcmp+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp>:
mov    %edx,%r8d
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %edx,%r8d
je     1126 <memcmp+0x26>
movsbl (%rdi,%rdx,1),%eax
movsbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
sub    %ecx,%eax
je     1110 <memcmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @memcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %14, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %4
%10 = add i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %13, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %4, label %19
19: ; preds = %4, %9
%20 = phi i32 [ %17, %9 ], [ 0, %4 ]
ret i32 %20
}
void foo530(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo530(i32 %0) {
ret void
}
int __get_MSP(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__get_MSP() {
ret i32 0
}

LLVM IR (-O2):
define i32 @__get_MSP() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deleteFunc(void *toBeDeleted) { free(toBeDeleted); }


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

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

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

LLVM IR (-O2):
define void @deleteFunc(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}