xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(FILE *stream) {
  (void)stream;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fflush(i32* nocapture readnone %0) {
ret i32 0
}
void bgr888_to_rgb888(void *dst, const void *src, int bytes) {}


x86 assembly (clang, -O0):
<bgr888_to_rgb888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bgr888_to_rgb888(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int lengthOfLastWord(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", lengthOfLastWord("hello world"));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @lengthOfLastWord(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
const char *errtostr(int err) {
  static const char *errstr[] = {
      "Success",
      "Socket error",
      "Not enough memory",
  };
  return errstr[err];
}


x86 assembly (clang, -O0):
<errtostr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errtostr>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@errtostr.errstr = internal global [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i32 0, i32 0)]
@.str = [8 x i8] c"Success\00"
@.str.1 = [13 x i8] c"Socket error\00"
@.str.2 = [18 x i8] c"Not enough memory\00"
define i8* @errtostr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* @errtostr.errstr, i64 0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@reltable.errtostr = internal unnamed_addr constant [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.errtostr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.errtostr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.errtostr to i64)) to i32)]
@.str = [8 x i8] c"Success\00"
@.str.1 = [13 x i8] c"Socket error\00"
@.str.2 = [18 x i8] c"Not enough memory\00"
define i8* @errtostr(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.errtostr to i8*), i64 %3)
ret i8* %4
}
void gtk_tree_view_expand_to_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_expand_to_path() {
ret void
}
/* Variables and functions */
unsigned char *medusaReceiveDataInternal(int, int *, int, int, int);
unsigned char *medusaReceiveLineDelay(int socket, int *nBufferSize,
                                      int nReceiveDelay1, int nReceiveDelay2) {
  return medusaReceiveDataInternal(socket, nBufferSize, 1, nReceiveDelay1,
                                   nReceiveDelay2);
}


x86 assembly (clang, -O0):
<medusaReceiveLineDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x1,%edx
call   1030 <medusaReceiveDataInternal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceiveLineDelay>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <medusaReceiveDataInternal@plt>

LLVM IR (-O0):
define i8* @medusaReceiveLineDelay(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** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i8* @medusaReceiveDataInternal(i32 %9, i32* %10, i32 1, i32 %11, i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @medusaReceiveLineDelay(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i8* @medusaReceiveDataInternal(i32 %0, i32* %1, i32 1, i32 %2, i32 %3)
ret i8* %5
}
/* Type definitions */
struct stat {
  unsigned int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ stat(char const *, struct stat *);
unsigned int vn_get_filesize(const char *filepath) {
  struct stat sb;
  if (stat(filepath, &sb) < 0) {
    err_sys("[vn_get_filesize] stat error");
  }
  return sb.st_size;
}


x86 assembly (clang, -O0):
<vn_get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    114f <vn_get_filesize+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_get_filesize>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
jns    113a <vn_get_filesize+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <err_sys@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [29 x i8] c"[vn_get_filesize] stat error\00"
define i32 @vn_get_filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err_sys(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [29 x i8] c"[vn_get_filesize] stat error\00"
define i32 @vn_get_filesize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @err_sys(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ COND_HI();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_shi_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_HI() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_shi_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_HI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_shi_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_HI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_shi_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_HI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_shi_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_HI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void g_DUMMY_popup_enable_item(int cont_id, int item_id, int enable) {
  cont_id = cont_id;
  item_id = item_id;
  enable = enable;
}


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_popup_enable_item(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int get_PWM_real_range(int pi, unsigned user_gpio) {
  return pigpio_command(pi, 24, user_gpio, 0, 1);
}


x86 assembly (clang, -O0):
<get_PWM_real_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x18,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_PWM_real_range>:
mov    %esi,%edx
mov    $0x18,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @get_PWM_real_range(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 24, i32 %1, i32 0, i32 1)
ret i32 %3
}
short xsvfGetAsNumBytes(long lNumBits) {
  return ((short)((lNumBits + 7L) / 8L));
}


x86 assembly (clang, -O0):
<xsvfGetAsNumBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsvfGetAsNumBytes>:
lea    0x7(%rdi),%rcx
lea    0x7(%rcx),%eax
test   %rcx,%rcx
cmovns %rcx,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define signext i16 @xsvfGetAsNumBytes(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 7
%5 = sdiv i64 %4, 8
%6 = trunc i64 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @xsvfGetAsNumBytes(i64 %0) {
%2 = add nsw i64 %0, 7
%3 = sdiv i64 %2, 8
%4 = trunc i64 %3 to i16
ret i16 %4
}
int foo(int x) { return x == x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 1
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long get_current_time_ms(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  long long result = tv.tv_sec * 1000LL;
  result += (tv.tv_usec + 500LL) / 1000LL;
  return result;
}


x86 assembly (clang, -O0):
<get_current_time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1f4,%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_time_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
mov    $0x1f4,%eax
add    0x10(%rsp),%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_current_time_ms() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
store i64 %6, i64* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %8, 500
%10 = sdiv i64 %9, 1000
%11 = load i64, i64* %2
%12 = add nsw i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_current_time_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %8, 500
%10 = sdiv i64 %9, 1000
%11 = add nsw i64 %10, %6
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int64_t copy_int(int64_t x) {
  int64_t y;
  memcpy(&y, &x, sizeof(int64_t));
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @copy_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, i32* %2, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
unsigned long gettid();
unsigned long get_tid(void) { return gettid(); }


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

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

LLVM IR (-O0):
define i64 @get_tid() {
%1 = call i64 (...) @gettid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_tid() {
%1 = tail call i64 (...) @gettid()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *, char *);
int /*<<< orphan*/ refresh();
void ledOn(int i, int y) {
  mvprintw(i, y, "%s", "X");
  refresh();
}


x86 assembly (clang, -O0):
<ledOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdx
lea    0xec1(%rip),%rcx
call   1040 <mvprintw@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledOn>:
push   %rax
lea    0xed8(%rip),%rdx
lea    0xed4(%rip),%rcx
call   1040 <mvprintw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"X\00"
define void @ledOn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @mvprintw(i32 %5, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"X\00"
define void @ledOn(i32 %0, i32 %1) {
%3 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x9f() {
  Assert_real((islower(159) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              800, ("islower should be 0 for 0x9f"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x9f>:
push   %rax
mov    $0x9f,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x320,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x9f\00"
define void @t_islower_0x9f() {
%1 = call i64 @islower(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([29 x i8], [29 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x9f\00"
define void @t_islower_0x9f() {
%1 = tail call i64 @islower(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int vcmpges2(unsigned int, unsigned int);
unsigned int vsub2(unsigned int, unsigned int);
unsigned int vabsdiffs2(unsigned int a, unsigned int b) {
  unsigned int r, s;
  s = vcmpges2(a, b);
  r = a ^ b;
  s = (r & s) ^ b;
  r = s ^ r;
  r = vsub2(s, r);
  return r;
}


x86 assembly (clang, -O0):
<vabsdiffs2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <vcmpges2@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <vsub2@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vabsdiffs2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <vcmpges2@plt>
mov    %ebx,%esi
xor    %ebp,%esi
and    %eax,%esi
xor    %esi,%ebx
xor    %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <vsub2@plt>

LLVM IR (-O0):
define i32 @vabsdiffs2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @vcmpges2(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = and i32 %13, %14
%16 = load i32, i32* %4
%17 = xor i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = xor i32 %18, %19
store i32 %20, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = call i32 @vsub2(i32 %21, i32 %22)
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @vabsdiffs2(i32 %0, i32 %1) {
%3 = tail call i32 @vcmpges2(i32 %0, i32 %1)
%4 = xor i32 %1, %0
%5 = and i32 %3, %4
%6 = xor i32 %5, %1
%7 = xor i32 %5, %0
%8 = tail call i32 @vsub2(i32 %6, i32 %7)
ret i32 %8
}
/* Variables and functions */
int socketcall(int (*)(int, int, int), int, int, int, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int domain, int type, int protocol) {
  return socketcall(socket, domain, type, protocol, 0, 0, 0);
}


x86 assembly (clang, -O0):
<socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    0x2eb7(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2ec3(%rip),%rdi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socketcall(i32 (i32, i32, i32)* @socket, i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
scalar_t__ ftfl_busy();
void ftfl_busy_wait() {
  while (ftfl_busy())
    ;
}


x86 assembly (clang, -O0):
<ftfl_busy_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <ftfl_busy_wait+0x9>
mov    $0x0,%al
call   1030 <ftfl_busy@plt>
cmp    $0x0,%rax
je     112f <ftfl_busy_wait+0x1f>
jmp    1119 <ftfl_busy_wait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftfl_busy_wait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ftfl_busy@plt>
test   %rax,%rax
jne    1120 <ftfl_busy_wait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @ftfl_busy_wait() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @ftfl_busy()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @ftfl_busy_wait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @ftfl_busy()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Type definitions */
struct stat {
  unsigned long long st_size;
};

/* Variables and functions */
int stat(unsigned char const *, struct stat *);
int filesize(const unsigned char *fname, unsigned long long *len) {
  struct stat buf;
  int ret;
  ret = stat(fname, &buf);
  if (ret) {
    return 0x80001103;
  } else {
    *len = buf.st_size;
    return 0;
  }
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1146 <filesize+0x36>
movl   $0x80001103,-0x4(%rbp)
jmp    1158 <filesize+0x48>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0x80001103,%eax
test   %ecx,%ecx
jne    1137 <filesize+0x27>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @filesize(i8* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca %struct.stat
%7 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
%8 = load i8*, i8** %4
%9 = call i32 @stat(i8* %8, %struct.stat* %6)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -2147479293, i32* %3
br label %17
13: ; preds = %2
%14 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%15 = load i64, i64* %14
%16 = load i64*, i64** %5
store i64 %15, i64* %16
store i32 0, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @filesize(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i64, i64* %8
store i64 %9, i64* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -2147479293, %2 ]
ret i32 %11
}
int test_imm_A1int64_highword_reg(long long val) {
  return ((val >> 32) & (0xA1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A1int64_highword_reg>:
movabs $0xa100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A1int64_highword_reg(i64 %0) {
%2 = and i64 %0, 691489734656
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ w5100_writeSIPR(int /*<<< orphan*/ *);
void w5100_setIPAddress(uint8_t *addr) { w5100_writeSIPR(addr); }


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

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

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

LLVM IR (-O2):
define void @w5100_setIPAddress(i32* %0) {
%2 = tail call i32 @w5100_writeSIPR(i32* %0)
ret void
}
int test_imm_3Cint16_mem(short *val) {
  return ((*val) & (-0x3C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Cint16_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, -60
%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_3Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -60
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rop3_83_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_83_1_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
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_83_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
and    %dl,%cl
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_83_1_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 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_83_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = and i8 %5, %2
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
%9 = and i8 %4, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_filename(long, char *, char *);
long umfpack_dl_load_numeric(void **, char *);
void umf4lnum_(void **Numeric, long *filenum, long *status) {
  char filename[200];
  make_filename(*filenum, "n", filename);
  *status = umfpack_dl_load_numeric(Numeric, filename);
}


x86 assembly (clang, -O0):
<umf4lnum_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1040 <make_filename@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <umfpack_dl_load_numeric@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4lnum_>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rsi),%rdi
lea    0xec4(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdx
call   1040 <make_filename@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <umfpack_dl_load_numeric@plt>
mov    %rax,(%r14)
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
define void @umf4lnum_(i8** %0, i64* %1, i64* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca [200 x i8]
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%11 = call i32 @make_filename(i64 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%14 = call i64 @umfpack_dl_load_numeric(i8** %12, i8* %13)
%15 = load i64*, i64** %6
store i64 %14, i64* %15
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
define void @umf4lnum_(i8** %0, i64* nocapture %1, i64* nocapture writeonly %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = load i64, i64* %1
%7 = call i32 @make_filename(i64 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i64 @umfpack_dl_load_numeric(i8** %0, i8* %5)
store i64 %8, i64* %2
ret void
}
long us() { return 0x7fffffffL; }


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

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

LLVM IR (-O0):
define i64 @us() {
ret i64 2147483647
}

LLVM IR (-O2):
define i64 @us() {
ret i64 2147483647
}
int FEND() { return (100); }


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

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

LLVM IR (-O0):
define i32 @FEND() {
ret i32 100
}

LLVM IR (-O2):
define i32 @FEND() {
ret i32 100
}
int foo(int a) {
  if (a > 1)
    if (a == 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    112c <foo+0x2c>
cmpl   $0x0,-0x8(%rbp)
jne    1127 <foo+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1133 <foo+0x33>
jmp    112c <foo+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int, char *);
char *strerror(int);
void memory_error(int status, unsigned memaddr, FILE *stream) {
  fprintf(stream, "Error reading memory at 0x%08x: %s", memaddr,
          strerror(status));
}


x86 assembly (clang, -O0):
<memory_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    %rax,%rcx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <strerror@plt>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Error reading memory at 0x%08x: %s\00"
define void @memory_error(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Error reading memory at 0x%08x: %s\00"
define void @memory_error(i32 %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @strerror(i32 %0)
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %4)
ret void
}
/* Variables and functions */
int act2000_isa_reset(unsigned short);
int /*<<< orphan*/ check_region(unsigned short, int);
int act2000_isa_detect(unsigned short portbase) {
  int ret = 0;
  if (!check_region(portbase, 8))
    ret = act2000_isa_reset(portbase);
  return ret;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x8,%esi
movzwl -0x2(%rbp),%edi
call   1030 <check_region@plt>
cmp    $0x0,%eax
jne    1159 <act2000_isa_detect+0x39>
movzwl -0x2(%rbp),%edi
call   1040 <act2000_isa_reset@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
mov    $0x8,%esi
call   1030 <check_region@plt>
test   %eax,%eax
je     1135 <act2000_isa_detect+0x15>
xor    %eax,%eax
pop    %rbx
ret
movzwl %bx,%edi
pop    %rbx
jmp    1040 <act2000_isa_reset@plt>

LLVM IR (-O0):
define i32 @act2000_isa_detect(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
store i32 0, i32* %3
%4 = load i16, i16* %2
%5 = call i32 @check_region(i16 zeroext %4, i32 8)
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i16, i16* %2
%9 = call i32 @act2000_isa_reset(i16 zeroext %8)
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @act2000_isa_detect(i16 zeroext %0) {
%2 = tail call i32 @check_region(i16 zeroext %0, i32 8)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @act2000_isa_reset(i16 zeroext %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 0, %1 ], [ %5, %4 ]
ret i32 %7
}
int tools_support_core_clibc_anchor() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tools_support_core_clibc_anchor() {
ret i32 0
}
int sharedbuffer_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sharedbuffer_init() {
ret i32 0
}
void plug_nl_numbers_shutdown(void *in_context) {}


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

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

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

LLVM IR (-O2):
define void @plug_nl_numbers_shutdown(i8* nocapture %0) {
ret void
}
int onlinesite_() { return (-1); }


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

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

LLVM IR (-O0):
define i32 @onlinesite_() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @onlinesite_() {
ret i32 -1
}
void FanChannelDutySet(unsigned long ulBase, unsigned long ulChannel,
                       unsigned long ulDuty) {
  ;
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014 + (ulChannel * 0x10)))) =
      (ulDuty << 16) & 0x01FF0000;
}


x86 assembly (clang, -O0):
<FanChannelDutySet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
shl    $0x10,%rcx
and    $0x1ff0000,%rcx
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelDutySet>:
shl    $0x10,%edx
and    $0x1ff0000,%edx
shl    $0x4,%rsi
mov    %rdx,0x14(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @FanChannelDutySet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = shl i64 %7, 16
%9 = and i64 %8, 33488896
%10 = load i64, i64* %4
%11 = add i64 %10, 20
%12 = load i64, i64* %5
%13 = mul i64 %12, 16
%14 = add i64 %11, %13
%15 = inttoptr i64 %14 to i64*
store volatile i64 %9, i64* %15
ret void
}

LLVM IR (-O2):
define void @FanChannelDutySet(i64 %0, i64 %1, i64 %2) {
%4 = shl i64 %2, 16
%5 = and i64 %4, 33488896
%6 = add i64 %0, 20
%7 = shl i64 %1, 4
%8 = add i64 %6, %7
%9 = inttoptr i64 %8 to i64*
store volatile i64 %5, i64* %9
ret void
}
const char *BZ2_bzlibVersion(void) { return "1.0.8, 13-Jul-2019"; }


x86 assembly (clang, -O0):
<BZ2_bzlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BZ2_bzlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"1.0.8, 13-Jul-2019\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"1.0.8, 13-Jul-2019\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void do_setenv(argc, argv) char **argv;
{ setenv(argv[1], argv[2], 1); }


x86 assembly (clang, -O0):
<do_setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_setenv>:
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <setenv@plt>

LLVM IR (-O0):
define void @do_setenv(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 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @setenv to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @do_setenv(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @setenv to i32 (i8*, i8*, i32, ...)*)(i8* %4, i8* %6, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_strip(char *);
int strlen(char *);
void trata_crlf(char *linha) {
  char *ultimo_ch;
  ultimo_ch = linha + strlen(linha) - 1;
  *ultimo_ch-- = '\0';
  if (*ultimo_ch == '\r')
    *ultimo_ch = '\0';
  str_strip(linha);
}


x86 assembly (clang, -O0):
<trata_crlf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    117a <trata_crlf+0x5a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <str_strip@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trata_crlf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
cmpb   $0xd,-0x2(%rbx,%rax,1)
jne    113c <trata_crlf+0x1c>
movb   $0x0,-0x2(%rbx,%rax,1)
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <str_strip@plt>

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

LLVM IR (-O2):
define void @trata_crlf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 0, i8* %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 13
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 0, i8* %6
br label %10
10: ; preds = %9, %1
%11 = tail call i32 @str_strip(i8* %0)
ret void
}