xunge/DecIR huggingface dataset:
/* Type definitions */
struct _RuntimeStack {
  int dummy;
};

/* Variables and functions */
struct _RuntimeStack *get_current_frame();
struct _RuntimeStack *_top_frame() {
  return get_current_frame();
}


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

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

LLVM IR (-O0):
%struct._RuntimeStack = type { i32 }
define %struct._RuntimeStack* @_top_frame() {
%1 = call %struct._RuntimeStack* (...) @get_current_frame()
ret %struct._RuntimeStack* %1
}

LLVM IR (-O2):
%struct._RuntimeStack = type { i32 }
define %struct._RuntimeStack* @_top_frame() {
%1 = tail call %struct._RuntimeStack* (...) @get_current_frame()
ret %struct._RuntimeStack* %1
}
void common_level_init() {}


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

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

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

LLVM IR (-O2):
define void @common_level_init() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memclr(void *, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *ptr;
  ptr = malloc(size * nmemb);
  if (!ptr) {
    return NULL;
  }
  memclr(ptr, size * nmemb);
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115a <calloc+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1174 <calloc+0x54>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x10(%rbp),%rsi
call   1030 <memclr@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1146 <calloc+0x26>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <memclr@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memclr(i8* %4, i64 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
signed int signed_char_to_signed_int(signed char src) { return src; }


x86 assembly (clang, -O0):
<signed_char_to_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_to_signed_int>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @signed_char_to_signed_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @signed_char_to_signed_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strlen(char *);
void print_message(char *message) {
  printf("The message was: %s\n", message);
  printf("The length of the message is %lu\n", strlen(message));
}


x86 assembly (clang, -O0):
<print_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_message>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"The message was: %s\0A\00"
@.str.1 = [34 x i8] c"The length of the message is %lu\0A\00"
define void @print_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i8* @strlen(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"The message was: %s\0A\00"
@.str.1 = [34 x i8] c"The length of the message is %lu\0A\00"
define void @print_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @strlen(i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
scalar_t__ my_realloc(int /*<<< orphan*/ *, size_t);
uint *uint_realloc(uint *old, size_t size) {
  return (uint *)my_realloc(old, size * sizeof(int));
}


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

x86 assembly (clang, -O2):
<uint_realloc>:
shl    $0x2,%rsi
jmp    1030 <my_realloc@plt>

LLVM IR (-O0):
define i32* @uint_realloc(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = mul i64 %6, 4
%8 = call i64 @my_realloc(i32* %5, i64 %7)
%9 = inttoptr i64 %8 to i32*
ret i32* %9
}

LLVM IR (-O2):
define i32* @uint_realloc(i32* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i64 @my_realloc(i32* %0, i64 %3)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int do_769() { return 769; }


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

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

LLVM IR (-O0):
define i32 @do_769() {
ret i32 769
}

LLVM IR (-O2):
define i32 @do_769() {
ret i32 769
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int mknod(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
int lock_mtab(void) {
  int rc;
  rc = mknod("/etc/mtab~", 0600, 0);
  if (rc == -1)
    printf("\ngetting lock file %s failed with %s\n", "/etc/mtab~",
           strerror(errno));
  return rc;
}


x86 assembly (clang, -O0):
<lock_mtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x180,%esi
xor    %edx,%edx
call   1040 <mknod@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    117c <lock_mtab+0x4c>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rdx
lea    0xe9b(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_mtab>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x180,%esi
xor    %edx,%edx
call   1040 <mknod@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    116f <lock_mtab+0x3f>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdi
lea    0xe99(%rip),%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/etc/mtab~\00"
@.str.1 = [38 x i8] c"\0Agetting lock file %s failed with %s\0A\00"
@errno = global i32 0
define i32 @lock_mtab() {
%1 = alloca i32
%2 = call i32 @mknod(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 384, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"/etc/mtab~\00"
@.str.1 = [38 x i8] c"\0Agetting lock file %s failed with %s\0A\00"
@errno = global i32 0
define i32 @lock_mtab() {
%1 = tail call i32 @mknod(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 384, i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %3, %0
ret i32 %1
}
unsigned int *get_frac(float f) {
  unsigned int *fi = &f;
  unsigned int frac = (*fi & 0x007FFFFF);
  return frac;
}


x86 assembly (clang, -O0):
<get_frac>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x7fffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_frac>:
movd   %xmm0,%eax
and    $0x7fffff,%eax
ret

LLVM IR (-O0):
define i32* @get_frac(float %0) {
%2 = alloca float
%3 = alloca i32*
%4 = alloca i32
store float %0, float* %2
%5 = bitcast float* %2 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = and i32 %7, 8388607
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define i32* @get_frac(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 8388607
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int fileGetc();
int nextChar(void) {
  int c = fileGetc();
  if (c == '\\') {
    c = fileGetc();
    if (c == '\n')
      c = fileGetc();
  }
  return c;
}


x86 assembly (clang, -O0):
<nextChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fileGetc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x5c,-0x4(%rbp)
jne    114f <nextChar+0x3f>
mov    $0x0,%al
call   1030 <fileGetc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    114a <nextChar+0x3a>
mov    $0x0,%al
call   1030 <fileGetc@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <nextChar+0x3f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextChar>:
push   %rax
xor    %eax,%eax
call   1030 <fileGetc@plt>
cmp    $0x5c,%eax
jne    1131 <nextChar+0x21>
xor    %eax,%eax
call   1030 <fileGetc@plt>
cmp    $0xa,%eax
jne    1131 <nextChar+0x21>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fileGetc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @nextChar() {
%1 = tail call i32 (...) @fileGetc()
%2 = icmp eq i32 %1, 92
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @fileGetc()
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @fileGetc()
br label %8
8: ; preds = %3, %6, %0
%9 = phi i32 [ %7, %6 ], [ %4, %3 ], [ %1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void m(int x) { fprintf(stderr, "%c%d\n", 'm', x); }


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x6d,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x6d,%edx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @m(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 109, i32 %0)
ret void
}
/* Variables and functions */
int syscall(int, char const *);
int mkfifo(const char *path) { return syscall(132, path); }


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

x86 assembly (clang, -O2):
<mkfifo>:
mov    %rdi,%rsi
mov    $0x84,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mkfifo(i8* %0) {
%2 = tail call i32 @syscall(i32 132, i8* %0)
ret i32 %2
}
char *get_aux_buffer(double t) {
  static char buffers[10][256];
  static int count = -1;
  count = count + 1;
  if (count == 10)
    count = 0;
  return buffers[count];
}


x86 assembly (clang, -O0):
<get_aux_buffer>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2f11(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f08(%rip)
cmpl   $0xa,0x2f01(%rip)
jne    112f <get_aux_buffer+0x2f>
movl   $0x0,0x2ef1(%rip)
movslq 0x2eea(%rip),%rcx
lea    0x2f03(%rip),%rax
shl    $0x8,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_aux_buffer>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xa,%eax
cmovne %eax,%ecx
mov    %ecx,0x2f09(%rip)
movslq %ecx,%rcx
shl    $0x8,%rcx
lea    0x2f1b(%rip),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@get_aux_buffer.buffers = internal global [10 x [256 x i8]] zeroinitializer
@get_aux_buffer.count = internal global i32 -1
define i8* @get_aux_buffer(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @get_aux_buffer.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @get_aux_buffer.count
%5 = load i32, i32* @get_aux_buffer.count
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* @get_aux_buffer.count
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* @get_aux_buffer.count
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x [256 x i8]], [10 x [256 x i8]]* @get_aux_buffer.buffers, i64 0, i64 %10
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
ret i8* %12
}

LLVM IR (-O2):
@get_aux_buffer.buffers = internal global [10 x [256 x i8]] zeroinitializer
@get_aux_buffer.count = internal unnamed_addr global i32 -1
define i8* @get_aux_buffer(double %0) {
%2 = load i32, i32* @get_aux_buffer.count
%3 = add nsw i32 %2, 1
%4 = icmp eq i32 %3, 10
%5 = select i1 %4, i32 0, i32 %3
store i32 %5, i32* @get_aux_buffer.count
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x [256 x i8]], [10 x [256 x i8]]* @get_aux_buffer.buffers, i64 0, i64 %6, i64 0
ret i8* %7
}
int code(int buf[4]) {
  int i, num = 0;
  for (i = 0; i < 4; i++)
    num = (num << 8) | (buf[i] & 255);
  return num;
}


x86 assembly (clang, -O0):
<code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    114a <code+0x4a>
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <code+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<code>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x18,%eax
movzbl %cl,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
shl    $0x8,%edx
movzwl %dx,%edx
or     %ecx,%edx
movzbl 0xc(%rdi),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @code(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %4
%10 = shl i32 %9, 8
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = or i32 %10, %16
store i32 %17, i32* %4
br label %18
18: ; preds = %8
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @code(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %2, 24
%8 = shl i32 %4, 16
%9 = and i32 %8, 16711680
%10 = or i32 %7, %9
%11 = shl i32 %6, 8
%12 = and i32 %11, 65280
%13 = or i32 %10, %12
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = or i32 %16, %13
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_printf() { printf("Hello %s!\n", "printf"); }


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

x86 assembly (clang, -O2):
<test_printf>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello %s!\0A\00"
@.str.1 = [7 x i8] c"printf\00"
define void @test_printf() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fun1190() { return 1190; }


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

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

LLVM IR (-O0):
define i32 @fun1190() {
ret i32 1190
}

LLVM IR (-O2):
define i32 @fun1190() {
ret i32 1190
}
void fn(int i) {
  switch (i)
  case 10 << (sizeof(int) * 8 - 2):
    break;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80000000,%eax
jne    111f <fn+0x1f>
jmp    111a <fn+0x1a>
jmp    111f <fn+0x1f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 -2147483648, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
define void @fn(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x4c() {
  Assert_real((isupper(76)),
              "/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_isupper.c",
              385, ("isupper should be 1 for L"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x4c>:
push   %rax
mov    $0x4c,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x181,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for L\00"
define void @t_isupper_0x4c() {
%1 = call i32 @isupper(i32 76)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for L\00"
define void @t_isupper_0x4c() {
%1 = tail call i32 @isupper(i32 76)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pollfd {
  int fd;
  int events;
  scalar_t__ revents;
};

/* Variables and functions */
int POLLERR;
int POLLIN;
int poll(struct pollfd *, int, unsigned int);
int qrtr_poll(int sock, unsigned int ms) {
  struct pollfd fds;
  fds.fd = sock;
  fds.revents = 0;
  fds.events = POLLIN | POLLERR;
  return poll(&fds, 1, ms);
}


x86 assembly (clang, -O0):
<qrtr_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    0x2eac(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edx
lea    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <poll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qrtr_poll>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %edi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2eb6(%rip),%rax
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %ecx,0xc(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1030 <poll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32, i64 }
@POLLIN = global i32 0
@POLLERR = global i32 0
define i32 @qrtr_poll(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.pollfd
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %5, i32 0, i32 2
store i64 0, i64* %8
%9 = load i32, i32* @POLLIN
%10 = load i32, i32* @POLLERR
%11 = or i32 %9, %10
%12 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %5, i32 0, i32 1
store i32 %11, i32* %12
%13 = load i32, i32* %4
%14 = call i32 @poll(%struct.pollfd* %5, i32 1, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32, i64 }
@POLLIN = global i32 0
@POLLERR = global i32 0
define i32 @qrtr_poll(i32 %0, i32 %1) {
%3 = alloca %struct.pollfd
%4 = bitcast %struct.pollfd* %3 to i8*
%5 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i64 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* @POLLIN
%8 = load i32, i32* @POLLERR
%9 = or i32 %8, %7
%10 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i64 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @poll(%struct.pollfd* %3, i32 1, i32 %1)
ret i32 %11
}
extern double shmem_double_g(double *addr, int pe) { return *addr; }


x86 assembly (clang, -O0):
<shmem_double_g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_double_g>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @shmem_double_g(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ f(int, int, int);
int main() {
  if (f(1, 1, 2) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%esi
mov    $0x2,%edx
mov    %esi,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <f@plt>
test   %rax,%rax
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 1, i32 1, i32 2)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 1, i32 1, i32 2)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NoPinC__0__GeneralIO__makeOutput();
void LedsP__Led1__makeOutput(void) { NoPinC__0__GeneralIO__makeOutput(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__makeOutput() {
%1 = tail call i32 (...) @NoPinC__0__GeneralIO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_set_message(char *);
void gui_clear_message() { gui_set_message(" "); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @gui_clear_message() {
%1 = tail call i32 @gui_set_message(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_wrctl(int, int);
void _Nios2_Set_ctlreg_config(uint32_t value) {
  __builtin_wrctl(13, (int)value);
}


x86 assembly (clang, -O0):
<_Nios2_Set_ctlreg_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0xd,%edi
call   1030 <__builtin_wrctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_Set_ctlreg_config>:
mov    %rdi,%rsi
mov    $0xd,%edi
jmp    1030 <__builtin_wrctl@plt>

LLVM IR (-O0):
define void @_Nios2_Set_ctlreg_config(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @__builtin_wrctl(i32 13, i32 %4)
ret void
}

LLVM IR (-O2):
define void @_Nios2_Set_ctlreg_config(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__builtin_wrctl(i32 13, i32 %2)
ret void
}
unsigned short rotateL_fun_ushort(unsigned short x, int i) {
  if ((i %= 16) == 0)
    return x;
  return (x << i) | (x >> (16 - i));
}


x86 assembly (clang, -O0):
<rotateL_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    1132 <rotateL_fun_ushort+0x32>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1151 <rotateL_fun_ushort+0x51>
movzwl -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_ushort>:
mov    %esi,%ecx
lea    0xf(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xfffffff0,%eax
sub    %eax,%ecx
mov    %edi,%eax
rol    %cl,%ax
test   %ecx,%ecx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @rotateL_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 16
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i16, i16* %4
store i16 %10, i16* %3
br label %23
11: ; preds = %2
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = load i32, i32* %5
%15 = shl i32 %13, %14
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = load i32, i32* %5
%19 = sub nsw i32 16, %18
%20 = ashr i32 %17, %19
%21 = or i32 %15, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
br label %23
23: ; preds = %11, %9
%24 = load i16, i16* %3
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @rotateL_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = srem i32 %1, 16
%4 = icmp eq i32 %3, 0
%5 = trunc i32 %3 to i16
%6 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %5)
%7 = select i1 %4, i16 %0, i16 %6
ret i16 %7
}
/* Type definitions */
struct predicate {
  int dummy;
};
struct parser_table {
  int dummy;
};

/* Variables and functions */
struct predicate *insert_primary(struct parser_table const *);
bool parse_exit(const struct parser_table *entry, char **argv, int *arg_ptr) {
  struct predicate *pred = insert_primary(entry);
  return true;
}


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

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

LLVM IR (-O0):
%struct.parser_table = type { i32 }
%struct.predicate = type { i32 }
define i32 @parse_exit(%struct.parser_table* %0, i8** %1, i32* %2) {
%4 = alloca %struct.parser_table*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.predicate*
store %struct.parser_table* %0, %struct.parser_table** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load %struct.parser_table*, %struct.parser_table** %4
%9 = call %struct.predicate* @insert_primary(%struct.parser_table* %8)
store %struct.predicate* %9, %struct.predicate** %7
ret i32 1
}

LLVM IR (-O2):
%struct.parser_table = type { i32 }
%struct.predicate = type { i32 }
define i32 @parse_exit(%struct.parser_table* %0, i8** nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call %struct.predicate* @insert_primary(%struct.parser_table* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ al_sun(double);
double cos(int /*<<< orphan*/);
double cos_al(double t) { return cos(al_sun(t)); }


x86 assembly (clang, -O0):
<cos_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <al_sun@plt>
mov    %eax,%edi
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_al>:
push   %rax
call   1040 <al_sun@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @cos_al(double %0) {
%2 = tail call i32 @al_sun(double %0)
%3 = tail call double @cos(i32 %2)
ret double %3
}
void SmartMac_Send(void) {}


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

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

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

LLVM IR (-O2):
define void @SmartMac_Send() {
ret void
}
/* Variables and functions */
char *baseFilename(char const *const);
char *strrchr(char const *const, char);
extern const char *fileExtension(const char *const fileName) {
  const char *extension;
  const char *pDelimiter;
  const char *const base = baseFilename(fileName);
  pDelimiter = strrchr(base, '.');
  if (pDelimiter == NULL)
    extension = "";
  else
    extension = pDelimiter + 1;
  return extension;
}


x86 assembly (clang, -O0):
<fileExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <baseFilename@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1166 <fileExtension+0x46>
lea    0xea3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1172 <fileExtension+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExtension>:
push   %rax
call   1030 <baseFilename@plt>
mov    %rax,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xebf(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @fileExtension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @baseFilename(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i8* @strrchr(i8* %8, i8 signext 46)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %16
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %3
br label %16
16: ; preds = %13, %12
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @fileExtension(i8* %0) {
%2 = tail call i8* @baseFilename(i8* %0)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 46)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %5
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadByte(int /*<<< orphan*/, int);
uint8_t wiznetGetSocketRXBufferSize(uint8_t socket) {
  return wiznetRegReadByte(socket, (0x0000 + 0x001E));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketRXBufferSize>:
mov    $0x1e,%esi
jmp    1030 <wiznetRegReadByte@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketRXBufferSize(i32 %0) {
%2 = tail call i32 @wiznetRegReadByte(i32 %0, i32 30)
ret i32 %2
}
void bigadd(int *sn, int *n) {
  int i, tmp, c = 0;
  for (i = 0; i < 500; i++) {
    tmp = sn[i] + n[i] + c;
    sn[i] = tmp % 10;
    c = tmp / 10;
  }
}


x86 assembly (clang, -O0):
<bigadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1f4,-0x14(%rbp)
jge    1175 <bigadd+0x75>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <bigadd+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigadd>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    (%rdi,%rax,4),%ecx
add    (%rsi,%rax,4),%ecx
movslq %ecx,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%r8d
mov    %r8d,(%rdi,%rax,4)
add    $0x1,%rax
cmp    $0x1f4,%rax
jne    1110 <bigadd+0x10>
ret

LLVM IR (-O0):
define void @bigadd(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %7
store i32 0, i32* %5
br label %8
8: ; preds = %33, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 500
br i1 %10, label %11, label %36
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %16, %21
%23 = load i32, i32* %7
%24 = add nsw i32 %22, %23
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = srem i32 %25, 10
%27 = load i32*, i32** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 %26, i32* %30
%31 = load i32, i32* %6
%32 = sdiv i32 %31, 10
store i32 %32, i32* %7
br label %33
33: ; preds = %11
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %8
36: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @bigadd(i32* nocapture %0, i32* nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %14, %3 ]
%5 = phi i32 [ 0, %2 ], [ %13, %3 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %4
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 %4
%9 = load i32, i32* %8
%10 = add i32 %7, %5
%11 = add i32 %10, %9
%12 = srem i32 %11, 10
store i32 %12, i32* %6
%13 = sdiv i32 %11, 10
%14 = add nuw nsw i64 %4, 1
%15 = icmp eq i64 %14, 500
br i1 %15, label %16, label %3
16: ; preds = %3
ret void
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int match(char *string, char *pattern) {
  return strstr(string, pattern) ? 1 : 0;
}


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

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

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

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int pthread_equal(pthread_t a, pthread_t b) { return a == b; }


x86 assembly (clang, -O0):
<pthread_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pthread_equal(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ towlower(scalar_t__);
wchar_t *_wcslwr_s(wchar_t *str) {
  for (wchar_t *p = str; *p; p++)
    towlower(*p);
  return str;
}


x86 assembly (clang, -O0):
<_wcslwr_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <_wcslwr_s+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <towlower@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <_wcslwr_s+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wcslwr_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <_wcslwr_s+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <towlower@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <_wcslwr_s+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64* @_wcslwr_s(i64* returned %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret i64* %0
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ %2, %1 ]
%7 = phi i64* [ %9, %5 ], [ %0, %1 ]
%8 = tail call i32 @towlower(i64 %6)
%9 = getelementptr inbounds i64, i64* %7, i64 1
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %4, label %5
}
/* Variables and functions */
unsigned int getCurrentProcessPid();
int /*<<< orphan*/ setParameter(unsigned int, int /*<<< orphan*/, unsigned int);
unsigned int wrapper_getCurrentProcessPid(unsigned int pc, unsigned int sp,
                                          unsigned int spsr) {
  unsigned int pid = getCurrentProcessPid();
  setParameter(sp, 0, pid);
  return sp;
}


x86 assembly (clang, -O0):
<wrapper_getCurrentProcessPid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getCurrentProcessPid@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1040 <setParameter@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_getCurrentProcessPid>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <getCurrentProcessPid@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %eax,%edx
call   1040 <setParameter@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wrapper_getCurrentProcessPid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @getCurrentProcessPid()
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = call i32 @setParameter(i32 %9, i32 0, i32 %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @wrapper_getCurrentProcessPid(i32 %0, i32 returned %1, i32 %2) {
%4 = tail call i32 (...) @getCurrentProcessPid()
%5 = tail call i32 @setParameter(i32 %1, i32 0, i32 %4)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ bind_shell(char **);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  while (1) {
    bind_shell(argv);
    sleep(1);
  }
}


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)
mov    -0x10(%rbp),%rdi
call   1030 <bind_shell@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <bind_shell@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
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
br label %6
6: ; preds = %2, %6
%7 = load i8**, i8*** %5
%8 = call i32 @bind_shell(i8** %7)
%9 = call i32 @sleep(i32 1)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @bind_shell(i8** %1)
%5 = tail call i32 @sleep(i32 1)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void checkAllocation(const void *pointer) {
  if (!pointer) {
    perror("Error allocating memory");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkAllocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <checkAllocation+0x31>
lea    0xec2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkAllocation>:
test   %rdi,%rdi
je     1126 <checkAllocation+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Error allocating memory\00"
@EXIT_FAILURE = global i32 0
define void @checkAllocation(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 %9, label %5
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Error allocating memory\00"
@EXIT_FAILURE = global i32 0
define void @checkAllocation(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}