xunge/DecIR huggingface dataset:
int digit_count(int v) {
  unsigned int i, x;
  for (i = 1, x = 64; (unsigned int)v >= x; i++, x <<= 6) {
  }
  return i;
}


x86 assembly (clang, -O0):
<digit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x40,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     113d <digit_count+0x3d>
jmp    1126 <digit_count+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <digit_count+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_count>:
mov    $0x1,%eax
cmp    $0x40,%edi
jb     112a <digit_count+0x2a>
mov    $0x1,%eax
mov    $0x40,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
shl    $0x6,%ecx
cmp    %edi,%ecx
jbe    1120 <digit_count+0x20>
ret

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

LLVM IR (-O2):
define i32 @digit_count(i32 %0) {
%2 = icmp ult i32 %0, 64
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 64, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = add i32 %5, 1
%7 = shl i32 %4, 6
%8 = icmp ugt i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
const char *fpp_config_get_default_plugin_descr(void) {
  return "Display PDF documents in-place";
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Display PDF documents in-place\00"
define i8* @fpp_config_get_default_plugin_descr() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"Display PDF documents in-place\00"
define i8* @fpp_config_get_default_plugin_descr() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
int drv_PICGraphic_contrast(int contrast) {
  char __attribute__((unused)) cmd[2];
  if (contrast < 0)
    contrast = 0;
  if (contrast > 15)
    contrast = 15;
  cmd[0] = 'c';
  cmd[1] = contrast;
  return contrast;
}


x86 assembly (clang, -O0):
<drv_PICGraphic_contrast>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <drv_PICGraphic_contrast+0x18>
movl   $0x0,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jle    1129 <drv_PICGraphic_contrast+0x29>
movl   $0xf,-0x4(%rbp)
movb   $0x63,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_PICGraphic_contrast>:
xor    %ecx,%ecx
test   %edi,%edi
cmovns %edi,%ecx
cmp    $0xf,%ecx
mov    $0xf,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @drv_PICGraphic_contrast(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 15
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 15, i32* %2
br label %11
11: ; preds = %10, %7
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 99, i8* %12
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %14, i8* %15
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @drv_PICGraphic_contrast(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 15
%5 = select i1 %4, i32 %3, i32 15
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void a_sizeof(char s[]) {
  printf("sizeof(s[]) = [%ld]\n", sizeof(s));
  printf("s[] = [%s]\n\n", s);
}


x86 assembly (clang, -O0):
<a_sizeof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_sizeof>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"sizeof(s[]) = [%ld]\0A\00"
@.str.1 = [13 x i8] c"s[] = [%s]\0A\0A\00"
define void @a_sizeof(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 8)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
unsigned char f1(int x) { return x; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @f1(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int a;
  int b;
  a = 7;
  b = 3;
  __print_int(a + b);
  __print_int(a - b);
  __print_int(a * b);
  __print_int(a / b);
  __print_int(a % b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%edi
imul   -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <__print_int@plt>
mov    $0x4,%edi
call   1030 <__print_int@plt>
mov    $0x15,%edi
call   1030 <__print_int@plt>
mov    $0x2,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = call i32 @__print_int(i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = call i32 @__print_int(i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
%15 = call i32 @__print_int(i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = sdiv i32 %16, %17
%19 = call i32 @__print_int(i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = srem i32 %20, %21
%23 = call i32 @__print_int(i32 %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 10)
%2 = tail call i32 @__print_int(i32 4)
%3 = tail call i32 @__print_int(i32 21)
%4 = tail call i32 @__print_int(i32 2)
%5 = tail call i32 @__print_int(i32 1)
ret i32 0
}
void fn_p0_1(void) {}


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

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

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

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

/* Variables and functions */
struct NODE *newTreeNode(int /*<<< orphan*/ *, int, char *);
struct NODE *newTerminalNode(int newID) {
  return newTreeNode(NULL, newID, "leaf");
}


x86 assembly (clang, -O0):
<newTerminalNode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
lea    0xed7(%rip),%rdx
call   1030 <newTreeNode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newTerminalNode>:
mov    %edi,%esi
lea    0xee7(%rip),%rdx
xor    %edi,%edi
jmp    1030 <newTreeNode@plt>

LLVM IR (-O0):
%struct.NODE = type { i32 }
@.str = [5 x i8] c"leaf\00"
define %struct.NODE* @newTerminalNode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.NODE* @newTreeNode(i32* null, i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret %struct.NODE* %4
}

LLVM IR (-O2):
%struct.NODE = type { i32 }
@.str = [5 x i8] c"leaf\00"
define %struct.NODE* @newTerminalNode(i32 %0) {
%2 = tail call %struct.NODE* @newTreeNode(i32* null, i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret %struct.NODE* %2
}
int test_imm_9Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x9F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Fint64_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, 159
%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_9Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 682899800064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int cCreateEdgeFace(int, char **);
int main(int argc, char *argv[]) { return cCreateEdgeFace(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cCreateEdgeFace@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @cCreateEdgeFace(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cCreateEdgeFace(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ daily_shutdown_begin();
int daily_shutdown_finish(unsigned int);
int daily_shutdown(unsigned int seconds) {
  daily_shutdown_begin();
  return (daily_shutdown_finish(seconds));
}


x86 assembly (clang, -O0):
<daily_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <daily_shutdown_begin@plt>
mov    -0x4(%rbp),%edi
call   1030 <daily_shutdown_finish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daily_shutdown>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <daily_shutdown_begin@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <daily_shutdown_finish@plt>

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

LLVM IR (-O2):
define i32 @daily_shutdown(i32 %0) {
%2 = tail call i32 (...) @daily_shutdown_begin()
%3 = tail call i32 @daily_shutdown_finish(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void skel_free(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @skel_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int COLS;
int /*<<< orphan*/ addch(char);
int getcurx(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
void filltoeol(void) {
  int x;
  for (x = getcurx(stdscr); x < COLS; x++) {
    addch(' ');
  }
}


x86 assembly (clang, -O0):
<filltoeol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <getcurx@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
jge    1163 <filltoeol+0x43>
mov    $0x20,%edi
call   1040 <addch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <filltoeol+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filltoeol>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <getcurx@plt>
mov    0x2ea7(%rip),%r14
cmp    (%r14),%eax
jge    1152 <filltoeol+0x32>
mov    %eax,%ebx
mov    $0x20,%edi
call   1040 <addch@plt>
add    $0x1,%ebx
cmp    (%r14),%ebx
jl     1140 <filltoeol+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@COLS = global i32 0
define void @filltoeol() {
%1 = alloca i32
%2 = load i32, i32* @stdscr
%3 = call i32 @getcurx(i32 %2)
store i32 %3, i32* %1
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %1
%6 = load i32, i32* @COLS
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @addch(i8 signext 32)
br label %10
10: ; preds = %8
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@COLS = global i32 0
define void @filltoeol() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getcurx(i32 %1)
%3 = load i32, i32* @COLS
%4 = icmp slt i32 %2, %3
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %2, %0 ]
%7 = tail call i32 @addch(i8 signext 32)
%8 = add nsw i32 %6, 1
%9 = load i32, i32* @COLS
%10 = icmp slt i32 %8, %9
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret void
}
void swap2(long int v[], long int v2[], long int i, long int j) {
  long int tmp;
  tmp = v[i];
  v[i] = v[j];
  v[j] = tmp;
  tmp = v2[i];
  v2[i] = v2[j];
  v2[j] = tmp;
}


x86 assembly (clang, -O0):
<swap2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap2>:
mov    (%rdi,%rdx,8),%r8
mov    (%rdi,%rcx,8),%rax
mov    %rax,(%rdi,%rdx,8)
mov    %r8,(%rdi,%rcx,8)
mov    (%rsi,%rdx,8),%rax
mov    (%rsi,%rcx,8),%rdi
mov    %rdi,(%rsi,%rdx,8)
mov    %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @swap2(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64*, i64** %5
%11 = load i64, i64* %7
%12 = getelementptr inbounds i64, i64* %10, i64 %11
%13 = load i64, i64* %12
store i64 %13, i64* %9
%14 = load i64*, i64** %5
%15 = load i64, i64* %8
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = load i64, i64* %16
%18 = load i64*, i64** %5
%19 = load i64, i64* %7
%20 = getelementptr inbounds i64, i64* %18, i64 %19
store i64 %17, i64* %20
%21 = load i64, i64* %9
%22 = load i64*, i64** %5
%23 = load i64, i64* %8
%24 = getelementptr inbounds i64, i64* %22, i64 %23
store i64 %21, i64* %24
%25 = load i64*, i64** %6
%26 = load i64, i64* %7
%27 = getelementptr inbounds i64, i64* %25, i64 %26
%28 = load i64, i64* %27
store i64 %28, i64* %9
%29 = load i64*, i64** %6
%30 = load i64, i64* %8
%31 = getelementptr inbounds i64, i64* %29, i64 %30
%32 = load i64, i64* %31
%33 = load i64*, i64** %6
%34 = load i64, i64* %7
%35 = getelementptr inbounds i64, i64* %33, i64 %34
store i64 %32, i64* %35
%36 = load i64, i64* %9
%37 = load i64*, i64** %6
%38 = load i64, i64* %8
%39 = getelementptr inbounds i64, i64* %37, i64 %38
store i64 %36, i64* %39
ret void
}

LLVM IR (-O2):
define void @swap2(i64* nocapture %0, i64* nocapture %1, i64 %2, i64 %3) {
%5 = getelementptr inbounds i64, i64* %0, i64 %2
%6 = load i64, i64* %5
%7 = getelementptr inbounds i64, i64* %0, i64 %3
%8 = load i64, i64* %7
store i64 %8, i64* %5
store i64 %6, i64* %7
%9 = getelementptr inbounds i64, i64* %1, i64 %2
%10 = load i64, i64* %9
%11 = getelementptr inbounds i64, i64* %1, i64 %3
%12 = load i64, i64* %11
store i64 %12, i64* %9
store i64 %10, i64* %11
ret void
}
/* Variables and functions */
int B(int);
int /*<<< orphan*/ printf(char *);
int A(int depth) {
  int b;
  ;
  depth++;
  printf("A ");
  ;
  if (depth == 100) {
    return 1;
  } else {
    b = B(depth);
  };
  return b + 1;
}


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x64,-0x8(%rbp)
jne    1156 <A+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116a <A+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <B@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
push   %rbx
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
cmp    $0x64,%ebx
je     1146 <A+0x26>
mov    %ebx,%edi
call   1030 <B@plt>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"A \00"
define i32 @A(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %2, 100
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @B(i32 %2)
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void set_stage_in_tweak(uint8_t *tweak, const uint8_t value) {
  tweak[0] = (tweak[0] & 0xf) ^ value;
}


x86 assembly (clang, -O0):
<set_stage_in_tweak>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xf,%ecx
xor    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_stage_in_tweak>:
mov    (%rdi),%eax
and    $0xf,%eax
xor    %esi,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @set_stage_in_tweak(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, 15
%9 = load i32, i32* %4
%10 = xor i32 %8, %9
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @set_stage_in_tweak(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 15
%5 = xor i32 %4, %1
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_read_dobldobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(330, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_read_dobldobl_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x14a,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_read_dobldobl_system>:
mov    $0x14a,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_read_dobldobl_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 330, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_read_dobldobl_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 330, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _enable_sse();
void setup_sse(void) { _enable_sse(); }


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

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

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

LLVM IR (-O2):
define void @setup_sse() {
%1 = tail call i32 (...) @_enable_sse()
ret void
}
void foo766() {}


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

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

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

LLVM IR (-O2):
define void @foo766() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int str_get_rowNumber(char *, char);
int main(void) {
  char array[] = "10,20,30,a";
  printf("%d", str_get_rowNumber(array, ','));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xf(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <str_get_rowNumber@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x30332c30322c3031,%rax
2c 33 30
mov    %rax,0x8(%rsp)
movl   $0x612c30,0xf(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x2c,%esi
call   1040 <str_get_rowNumber@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.main.array = [11 x i8] c"10,20,30,a\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = bitcast [11 x i8]* %2 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @str_get_rowNumber(i8* %4, i8 signext 44)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.array = [11 x i8] c"10,20,30,a\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @str_get_rowNumber(i8* %2, i8 signext 44)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}
unsigned char gf256_mul_0x2(unsigned char a) {
  unsigned char bit0 = a & 0x55;
  unsigned char bit1 = a & 0xaa;
  return (bit0 << 1) ^ bit1 ^ (bit1 >> 1);
}


x86 assembly (clang, -O0):
<gf256_mul_0x2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x55,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xaa,%eax
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
movzbl -0x3(%rbp),%ecx
xor    %ecx,%eax
movzbl -0x3(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf256_mul_0x2>:
lea    (%rdi,%rdi,1),%ecx
mov    %edi,%eax
and    $0xaa,%al
and    $0xaa,%cl
xor    %al,%cl
shr    %al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @gf256_mul_0x2(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 85
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 170
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 1
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = xor i32 %15, %17
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = ashr i32 %20, 1
%22 = xor i32 %18, %21
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @gf256_mul_0x2(i8 zeroext %0) {
%2 = and i8 %0, -86
%3 = shl i8 %0, 1
%4 = and i8 %3, -86
%5 = xor i8 %4, %2
%6 = lshr exact i8 %2, 1
%7 = or i8 %5, %6
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ lv;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int read_be_uint16(FILE *fp, uint16_t *ptr) {
  uint16_t lv;
  if (fread(&lv, sizeof(lv), 1, fp) != 1) {
    return 1;
  }
  *ptr = ntohs(lv);
  return 0;
}


x86 assembly (clang, -O0):
<read_be_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     115c <read_be_uint16+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <read_be_uint16+0x53>
mov    -0x1c(%rbp),%edi
call   1040 <ntohs@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be_uint16>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1154 <read_be_uint16+0x34>
mov    0x4(%rsp),%edi
call   1040 <ntohs@plt>
mov    %eax,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_be_uint16(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @ntohs(i32 %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %11
}
unsigned int zig_zag_fix(int inp) {
  return ((((unsigned int)(inp) >> ((sizeof(unsigned int) << 3) - 1))
               ? ((~(unsigned int)(inp)) << 1)
               : ((unsigned int)(inp) << 1)) ^
          ((unsigned int)(inp) >> ((sizeof(unsigned int) << 3) - 1)));
}


x86 assembly (clang, -O0):
<zig_zag_fix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
cmp    $0x0,%eax
je     1127 <zig_zag_fix+0x27>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <zig_zag_fix+0x30>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_zag_fix>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
shld   $0x1,%edi,%eax
ret

LLVM IR (-O0):
define i32 @zig_zag_fix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 31
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = xor i32 %7, -1
%9 = shl i32 %8, 1
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = shl i32 %11, 1
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %9, %6 ], [ %12, %10 ]
%15 = load i32, i32* %2
%16 = lshr i32 %15, 31
%17 = xor i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @zig_zag_fix(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
%4 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %0, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mipsim_config_fini();
scalar_t__ mipsim_config_init(int, char **);
int /*<<< orphan*/ mipsim_shell(int, char **);
int /*<<< orphan*/ version();
int main(int argc, char **argv) {
  if (mipsim_config_init(argc, argv)) {
    version();
    return 0;
  }
  mipsim_shell(argc, argv);
  mipsim_config_fini();
  return 0;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mipsim_config_init@plt>
cmp    $0x0,%rax
je     117f <main+0x3f>
mov    $0x0,%al
call   1040 <version@plt>
movl   $0x0,-0x4(%rbp)
jmp    1199 <main+0x59>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <mipsim_shell@plt>
mov    $0x0,%al
call   1050 <mipsim_config_fini@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <mipsim_config_init@plt>
test   %rax,%rax
je     115b <main+0x1b>
xor    %eax,%eax
call   1040 <version@plt>
jmp    116c <main+0x2c>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <mipsim_shell@plt>
xor    %eax,%eax
call   1050 <mipsim_config_fini@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i64 @mipsim_config_init(i32 %6, i8** %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @version()
store i32 0, i32* %3
br label %17
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @mipsim_shell(i32 %13, i8** %14)
%16 = call i32 (...) @mipsim_config_fini()
store i32 0, i32* %3
br label %17
17: ; preds = %12, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @mipsim_config_init(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @version()
br label %10
7: ; preds = %2
%8 = tail call i32 @mipsim_shell(i32 %0, i8** %1)
%9 = tail call i32 (...) @mipsim_config_fini()
br label %10
10: ; preds = %7, %5
ret i32 0
}
void swscale_version() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Method1(struct DEV *self) {
  printf("I'm method1 in %s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Furzoom/demo-C/refs/heads/master/src/"
         "module_c/inheritance/dev.c");
}


x86 assembly (clang, -O0):
<Method1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.DEV = type { i32 }
@.str = [19 x i8] c"I'm method1 in %s\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Furzoom/demo-C/refs/heads/master/src/module_c/inheritance/dev.c\00"
define void @Method1(%struct.DEV* %0) {
%2 = alloca %struct.DEV*
store %struct.DEV* %0, %struct.DEV** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.DEV = type { i32 }
@.str = [19 x i8] c"I'm method1 in %s\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Furzoom/demo-C/refs/heads/master/src/module_c/inheritance/dev.c\00"
define void @Method1(%struct.DEV* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bar(int);
int foobar() { return bar(5) + 6; }


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <bar@plt>
add    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foobar>:
push   %rax
mov    $0x5,%edi
call   1030 <bar@plt>
add    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foobar() {
%1 = call i32 @bar(i32 5)
%2 = add nsw i32 %1, 6
ret i32 %2
}

LLVM IR (-O2):
define i32 @foobar() {
%1 = tail call i32 @bar(i32 5)
%2 = add nsw i32 %1, 6
ret i32 %2
}
int get_sign(int value) {
  if (value < 0)
    return -1;
  else if (value > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<get_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <get_sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <get_sign+0x3f>
cmpl   $0x0,-0x8(%rbp)
jle    1133 <get_sign+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113f <get_sign+0x3f>
jmp    1138 <get_sign+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
void ignore_others(FILE *fp) {
  char buf[1024];
  fgets(buf, 1024, fp);
  while (strcmp(buf, "\r\n"))
    fgets(buf, 1024, fp);
  return;
}


x86 assembly (clang, -O0):
<ignore_others>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets@plt>
lea    -0x410(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     117b <ignore_others+0x5b>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets@plt>
jmp    1144 <ignore_others+0x24>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_others>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1180 <ignore_others+0x60>
mov    %rsp,%rbx
lea    0xea0(%rip),%r15
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1160 <ignore_others+0x40>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @ignore_others(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fgets(i8* %4, i32 1024, i32* %5)
br label %7
7: ; preds = %11, %1
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%13 = load i32*, i32** %2
%14 = call i32 @fgets(i8* %12, i32 1024, i32* %13)
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @ignore_others(i32* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @fgets(i8* %3, i32 1024, i32* %0)
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1, %7
%8 = call i32 @fgets(i8* %3, i32 1024, i32* %0)
%9 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void didFail() { printf("There was an unexpected error.\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"There was an unexpected error.\0A\00"
define void @didFail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"There was an unexpected error.\00"
define void @didFail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRB0_set(void) { return U_WMRCORENONE_set("U_WMRB0"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB0\00"
define i8* @U_WMRB0_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB0\00"
define i8* @U_WMRB0_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("shutdown -h now");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"shutdown -h now\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"shutdown -h now\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__7__IO__set();
void Msp430GpioC__14__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__7__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__14__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__7__IO__set()
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double nexttoward(double x, long double y) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<nexttoward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @nexttoward(double %0, x86_fp80 %1) {
%3 = alloca double
%4 = alloca x86_fp80
store double %0, double* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @nexttoward(double %0, x86_fp80 %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *redhttp_strndup(const char *str1, size_t str1_len) {
  char *str2 = NULL;
  if (str1) {
    str2 = malloc(str1_len + 1);
    if (str2) {
      strncpy(str2, str1, str1_len);
      str2[str1_len] = '\0';
    }
  }
  return str2;
}


x86 assembly (clang, -O0):
<redhttp_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1181 <redhttp_strndup+0x61>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <redhttp_strndup+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1181 <redhttp_strndup+0x61>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redhttp_strndup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1156 <redhttp_strndup+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1156 <redhttp_strndup+0x36>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
jmp    1158 <redhttp_strndup+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @redhttp_strndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = add i64 %1, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %1)
%10 = getelementptr inbounds i8, i8* %6, i64 %1
store i8 0, i8* %10
br label %11
11: ; preds = %4, %8, %2
%12 = phi i8* [ %6, %8 ], [ null, %4 ], [ null, %2 ]
ret i8* %12
}
adr0indreg1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*((char *)10000000)) = (*p1); }


x86 assembly (clang, -O0):
<adr0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    $0x989680,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0indreg1_set>:
mov    (%r9),%al
mov    %al,0x989680
ret

LLVM IR (-O0):
define i32 @adr0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %13
%17 = load i8, i8* %16
store i8 %17, i8* inttoptr (i64 10000000 to i8*)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @adr0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = load i8, i8* %5
store i8 %7, i8* inttoptr (i64 10000000 to i8*)
ret i32 undef
}
void btrfs_init_lockdep(void) {}


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

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

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

LLVM IR (-O2):
define void @btrfs_init_lockdep() {
ret void
}
int f(x)
unsigned char x;
{ return x; }


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

x86 assembly (clang, -O2):
<f>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}