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

/* Variables and functions */
int /*<<< orphan*/ free(struct ListHistoryItem *);
void ListHistoryItem_helper_function_free(struct ListHistoryItem *list) {
  free(list);
}


x86 assembly (clang, -O0):
<ListHistoryItem_helper_function_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):
<ListHistoryItem_helper_function_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ListHistoryItem = type { i32 }
define void @ListHistoryItem_helper_function_free(%struct.ListHistoryItem* %0) {
%2 = alloca %struct.ListHistoryItem*
store %struct.ListHistoryItem* %0, %struct.ListHistoryItem** %2
%3 = load %struct.ListHistoryItem*, %struct.ListHistoryItem** %2
%4 = call i32 @free(%struct.ListHistoryItem* %3)
ret void
}

LLVM IR (-O2):
%struct.ListHistoryItem = type { i32 }
define void @ListHistoryItem_helper_function_free(%struct.ListHistoryItem* nocapture %0) {
%2 = tail call i32 @free(%struct.ListHistoryItem* %0)
ret void
}
int comparator_ascending(const void *elem1, const void *elem2) {
  int f = *((int *)elem1);
  int s = *((int *)elem2);
  return (f > s) - (f < s);
}


x86 assembly (clang, -O0):
<comparator_ascending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator_ascending>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @comparator_ascending(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @comparator_ascending(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abc();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xyz();
void func2(int x) {
  printf("Called func2\n");
  xyz();
  abc();
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <xyz@plt>
mov    $0x0,%al
call   1040 <abc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <xyz@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <abc@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c"Called func2\00"
define void @func2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @xyz()
%4 = tail call i32 (...) @abc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sounder(int /*<<< orphan*/, int);
void tapGap(int units) { sounder(0, (1200 * units / 8)); }


x86 assembly (clang, -O0):
<tapGap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x4b0,-0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
xor    %edi,%edi
call   1030 <sounder@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tapGap>:
imul   $0x96,%edi,%esi
xor    %edi,%edi
jmp    1030 <sounder@plt>

LLVM IR (-O0):
define void @tapGap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1200, %3
%5 = sdiv i32 %4, 8
%6 = call i32 @sounder(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @tapGap(i32 %0) {
%2 = mul nsw i32 %0, 150
%3 = tail call i32 @sounder(i32 0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t fnv1a_string(const uint8_t *s, uint32_t len, uint32_t hash) {
  const uint8_t *e = s + len;
  while (s < e) {
    hash = (*s++ ^ hash) * 0x01000193;
  }
  return hash;
}


x86 assembly (clang, -O0):
<fnv1a_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1151 <fnv1a_string+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
xor    -0x10(%rbp),%eax
imul   $0x1000193,%eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1121 <fnv1a_string+0x21>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv1a_string>:
mov    %edx,%eax
test   %esi,%esi
jle    1121 <fnv1a_string+0x21>
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
nopl   (%rax)
xor    (%rdi),%eax
add    $0x4,%rdi
imul   $0x1000193,%eax,%eax
cmp    %rcx,%rdi
jb     1110 <fnv1a_string+0x10>
ret

LLVM IR (-O0):
define i32 @fnv1a_string(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 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32* %11, i32** %7
br label %12
12: ; preds = %16, %3
%13 = load i32*, i32** %4
%14 = load i32*, i32** %7
%15 = icmp ult i32* %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %4
%19 = load i32, i32* %17
%20 = load i32, i32* %6
%21 = xor i32 %19, %20
%22 = mul nsw i32 %21, 16777619
store i32 %22, i32* %6
br label %12
23: ; preds = %12
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
define i32 @fnv1a_string(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %15
7: ; preds = %3, %7
%8 = phi i32* [ %10, %7 ], [ %0, %3 ]
%9 = phi i32 [ %13, %7 ], [ %2, %3 ]
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %8
%12 = xor i32 %11, %9
%13 = mul nsw i32 %12, 16777619
%14 = icmp ult i32* %10, %5
br i1 %14, label %7, label %15
15: ; preds = %7, %3
%16 = phi i32 [ %2, %3 ], [ %13, %7 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ exception_handling(int /*<<< orphan*/);
int setjmp(int /*<<< orphan*/);
int main(void) {
  int retval;
  jmp_buf env;
  retval = setjmp(env);
  if (retval < 3) {
    exception_handling(env);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <setjmp@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
mov    -0xc(%rbp),%edi
call   1040 <exception_handling@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <setjmp@plt>
cmp    $0x2,%eax
jg     1130 <main+0x10>
call   1040 <exception_handling@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
%4 = load i32, i32* %3
%5 = call i32 @setjmp(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %3
%10 = call i32 @exception_handling(i32 %9)
br label %11
11: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
%2 = icmp slt i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exception_handling(i32 undef)
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
#define GLUT_KEY_DOWN 132
#define GLUT_KEY_HOME 131
#define GLUT_KEY_LEFT 130
#define GLUT_KEY_RIGHT 129
#define GLUT_KEY_UP 128
void specialKeyReleased(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    break;
  case GLUT_KEY_DOWN:
    break;
  case GLUT_KEY_LEFT:
    break;
  case GLUT_KEY_RIGHT:
    break;
  case GLUT_KEY_HOME:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<specialKeyReleased>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     114f <specialKeyReleased+0x4f>
mov    -0x18(%rbp),%rax
lea    0xed3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1154 <specialKeyReleased+0x54>
jmp    1154 <specialKeyReleased+0x54>
jmp    1154 <specialKeyReleased+0x54>
jmp    1154 <specialKeyReleased+0x54>
jmp    1154 <specialKeyReleased+0x54>
jmp    1154 <specialKeyReleased+0x54>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @specialKeyReleased(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %13 [
i32 128, label %8
i32 132, label %9
i32 130, label %10
i32 129, label %11
i32 131, label %12
]
8: ; preds = %3
br label %14
9: ; preds = %3
br label %14
10: ; preds = %3
br label %14
11: ; preds = %3
br label %14
12: ; preds = %3
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8
ret void
}

LLVM IR (-O2):
define void @specialKeyReleased(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clock_init_uart();
void uart0_init(void) {
  clock_init_uart();
  (*((volatile unsigned long *)((0x01C28000 + 0xc))) = (unsigned long)(0x80));
  (*((volatile unsigned long *)((0x01C28000 + 0x4))) = (unsigned long)(0));
  (*((volatile unsigned long *)((0x01C28000 + 0x0))) = (unsigned long)((0xD)));
  (*((volatile unsigned long *)((0x01C28000 + 0xc))) =
       (unsigned long)(((0) << 3 | (0) << 2 | (3))));
}


x86 assembly (clang, -O0):
<uart0_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock_init_uart@plt>
mov    $0x1c2800c,%eax
movq   $0x80,(%rax)
mov    $0x1c28004,%eax
movq   $0x0,(%rax)
mov    $0x1c28000,%eax
movq   $0xd,(%rax)
mov    $0x1c2800c,%eax
movq   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0_init>:
push   %rax
xor    %eax,%eax
call   1030 <clock_init_uart@plt>
movq   $0x80,0x1c2800c
movq   $0x0,0x1c28004
movq   $0xd,0x1c28000
movq   $0x3,0x1c2800c
pop    %rax
ret

LLVM IR (-O0):
define void @uart0_init() {
%1 = call i32 (...) @clock_init_uart()
store volatile i64 128, i64* inttoptr (i64 29523980 to i64*)
store volatile i64 0, i64* inttoptr (i64 29523972 to i64*)
store volatile i64 13, i64* inttoptr (i64 29523968 to i64*)
store volatile i64 3, i64* inttoptr (i64 29523980 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart0_init() {
%1 = tail call i32 (...) @clock_init_uart()
store volatile i64 128, i64* inttoptr (i64 29523980 to i64*)
store volatile i64 0, i64* inttoptr (i64 29523972 to i64*)
store volatile i64 13, i64* inttoptr (i64 29523968 to i64*)
store volatile i64 3, i64* inttoptr (i64 29523980 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ creat(char const *, int /*<<< orphan*/);
int util_safeio_get_fd(int /*<<< orphan*/);
int util_safeio_creat(const char *pathname, mode_t mode) {
  return util_safeio_get_fd(creat(pathname, mode));
}


x86 assembly (clang, -O0):
<util_safeio_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <creat@plt>
mov    %eax,%edi
call   1040 <util_safeio_get_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @util_safeio_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @creat(i8* %5, i32 %6)
%8 = call i32 @util_safeio_get_fd(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @util_safeio_creat(i8* %0, i32 %1) {
%3 = tail call i32 @creat(i8* %0, i32 %1)
%4 = tail call i32 @util_safeio_get_fd(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Exit();
char Get(int);
int /*<<< orphan*/ Send(int, char *, int, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ console_xy(int, int);
int /*<<< orphan*/ cprintf(char *, char);
main() {
  char ch;
  while (1) {
    ch = Get(1);
    console_xy(20, 9);
    cprintf(": %c", ch);
    Send(4, &ch, sizeof(char), 0, 0);
  }
  Exit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <Get@plt>
mov    %al,-0x5(%rbp)
mov    $0x14,%edi
mov    $0x9,%esi
call   1050 <console_xy@plt>
lea    0xe8e(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <cprintf@plt>
mov    $0x4,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1060 <Send@plt>
jmp    114f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    $0x1,%edi
call   1040 <Get@plt>
mov    %al,0x7(%rsp)
mov    $0x14,%edi
mov    $0x9,%esi
call   1050 <console_xy@plt>
movsbl 0x7(%rsp),%esi
mov    %r14,%rdi
call   1030 <cprintf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <Send@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c": %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call signext i8 @Get(i32 1)
store i8 %4, i8* %2
%5 = call i32 @console_xy(i32 20, i32 9)
%6 = load i8, i8* %2
%7 = call i32 @cprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = call i32 @Send(i32 4, i8* %2, i32 1, i32 0, i32 0)
br label %3
}

LLVM IR (-O2):
@.str = [5 x i8] c": %c\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call signext i8 @Get(i32 1)
store i8 %3, i8* %1
%4 = call i32 @console_xy(i32 20, i32 9)
%5 = load i8, i8* %1
%6 = call i32 @cprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = call i32 @Send(i32 4, i8* %1, i32 1, i32 0, i32 0)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(int, char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int confSaveString(char *value, short handling, void *result) {
  char *dest = (char *)result;
  strncpy(dest, value, 128 - 1);
  dest[128 - 1] = 0;
  debug(3, "set string: %s", dest);
  return 0;
}


x86 assembly (clang, -O0):
<confSaveString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x7f,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movb   $0x0,0x7f(%rax)
mov    -0x20(%rbp),%rdx
mov    $0x3,%edi
lea    0xe97(%rip),%rsi
call   1040 <debug@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confSaveString>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    $0x7f,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x7f(%rbx)
lea    0xec1(%rip),%rsi
mov    $0x3,%edi
mov    %rbx,%rdx
call   1040 <debug@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"set string: %s\00"
define i32 @confSaveString(i8* %0, i16 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i8*, i8** %4
%11 = call i32 @strncpy(i8* %9, i8* %10, i32 127)
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 127
store i8 0, i8* %13
%14 = load i8*, i8** %7
%15 = call i32 @debug(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"set string: %s\00"
define i32 @confSaveString(i8* %0, i16 signext %1, i8* %2) {
%4 = tail call i32 @strncpy(i8* %2, i8* %0, i32 127)
%5 = getelementptr inbounds i8, i8* %2, i64 127
store i8 0, i8* %5
%6 = tail call i32 @debug(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int fn6(int z) { return ~(z & 3) & z; }


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
mov    %edi,%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @fn6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn6(i32 %0) {
%2 = and i32 %0, -4
ret i32 %2
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *skip_space(const char *line) {
  while (*line && isspace(*line))
    line++;
  return line;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_space+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_space+0x47>
jmp    1168 <skip_space+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_space+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_space+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strdump(char *);
int main(void) {
  puts("汉字");
  strdump("汉字");
  putchar('\n');
  puts("12中国话AB");
  strdump("12中国话AB");
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
lea    0xeae(%rip),%rdi
call   1050 <strdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe93(%rip),%rdi
call   1050 <strdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <strdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <strdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\E6\B1\89\E5\AD\97\00"
@.str.1 = [14 x i8] c"12\E4\B8\AD\E5\9B\BD\E8\AF\9DAB\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @strdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @putchar(i8 signext 10)
%5 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @strdump(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"\E6\B1\89\E5\AD\97\00"
@.str.1 = [14 x i8] c"12\E4\B8\AD\E5\9B\BD\E8\AF\9DAB\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @putchar(i8 signext 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @strdump(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fillroom(int, int);
void fillmroom(int n, int what, int arg) {
  int i;
  for (i = 0; i < n; i++) {
    fillroom(what, arg);
  }
}


x86 assembly (clang, -O0):
<fillmroom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114d <fillmroom+0x3d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fillroom@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <fillmroom+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillmroom>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    112f <fillmroom+0x1f>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <fillroom@plt>
add    $0xffffffff,%ebx
jne    1120 <fillmroom+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fillmroom(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
store i32 0, i32* %7
br label %8
8: ; preds = %16, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @fillroom(i32 %13, i32 %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @fillmroom(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @fillroom(i32 %1, i32 %2)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createGtExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x0008, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createGtExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x8,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createGtExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 8, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createGtExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 8, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
unsigned long GetPixel148(unsigned long, unsigned long);
unsigned long getpixel(unsigned long x, unsigned long y) {
  return GetPixel148(x, y);
}


x86 assembly (clang, -O0):
<getpixel>:
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 <GetPixel148@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @getpixel(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 = call i64 @GetPixel148(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @getpixel(i64 %0, i64 %1) {
%3 = tail call i64 @GetPixel148(i64 %0, i64 %1)
ret i64 %3
}
void alarm_interrupt(void) {
  extern void timer_interrupt(void);
  timer_interrupt();
}


x86 assembly (clang, -O0):
<alarm_interrupt>:
push   %rbp
mov    %rsp,%rbp
call   1030 <timer_interrupt@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @alarm_interrupt() {
tail call void @timer_interrupt()
ret void
}
unsigned ShrTest6(int X, unsigned C) {
  int AndRHS = (unsigned)0xFFFFFFFF >> C;
  return (X >> C) & AndRHS;
}


x86 assembly (clang, -O0):
<ShrTest6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest6>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
shl    %cl,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = lshr i32 -1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
%11 = load i32, i32* %5
%12 = and i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ShrTest6(i32 %0, i32 %1) {
%3 = lshr i32 -1, %1
%4 = ashr i32 %0, %1
%5 = and i32 %4, %3
ret i32 %5
}
const char *htscodecs_version() { return "1.1.1"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.1.1\00"
define i8* @htscodecs_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.1.1\00"
define i8* @htscodecs_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int mg_val(int val) {
  union {
    unsigned short u;
    short s;
  } mg = {(unsigned short)((unsigned)(val))};
  return mg.s;
}


x86 assembly (clang, -O0):
<mg_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_val>:
movswl %di,%eax
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define i32 @mg_val(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i16*
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i16
store i16 %6, i16* %4
%7 = bitcast %union.anon* %3 to i16*
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mg_val(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr exact i32 %2, 16
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int server_read(void *client_data, int idx, char *data, int len) {
  printf("server: [%s]\n", data);
  return (0);
}


x86 assembly (clang, -O0):
<server_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"server: [%s]\0A\00"
define i32 @server_read(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"server: [%s]\0A\00"
define i32 @server_read(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int f227(int *);
int f228(int *p) { return f227(p); }


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

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

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

LLVM IR (-O2):
define i32 @f228(i32* %0) {
%2 = tail call i32 @f227(i32* %0)
ret i32 %2
}
int brancos(char senha[5]) {
  int i = 0, cont = 0;
  for (; i < 5 - 1; i++)
    if (senha[i] == 'B')
      cont++;
  return cont;
}


x86 assembly (clang, -O0):
<brancos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1151 <brancos+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x42,%eax
jne    113e <brancos+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <brancos+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <brancos+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brancos>:
movd   (%rdi),%xmm0
pcmpeqb 0xef4(%rip),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%eax
mov    %eax,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @brancos(i8* nocapture %0) {
%2 = bitcast i8* %0 to <4 x i8>*
%3 = load <4 x i8>, <4 x i8>* %2
%4 = icmp eq <4 x i8> %3, <i8 66, i8 66, i8 66, i8 66>
%5 = bitcast <4 x i1> %4 to i4
%6 = call i4 @llvm.ctpop.i4(i4 %5)
%7 = zext i4 %6 to i32
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int clear_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(154, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<clear_homotopy>:
mov    $0x9a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_homotopy() {
%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 154, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 154, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
unsigned long fib(unsigned long num) {
  if (num == 1) {
    return 1;
  }
  if (num == 2) {
    return 1;
  } else {
    return fib(num - 1) + fib(num - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1134 <fib+0x24>
movq   $0x1,-0x8(%rbp)
jmp    1178 <fib+0x68>
cmpq   $0x2,-0x10(%rbp)
jne    114c <fib+0x3c>
movq   $0x1,-0x8(%rbp)
jmp    1178 <fib+0x68>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
mov    $0x1,%r14d
cmp    $0x2,%rbx
jb     1149 <fib+0x39>
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffffffffffe,%rbx
cmp    $0x1,%rbx
ja     1130 <fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fib(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %19
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 1, i64* %2
br label %19
11: ; preds = %7
%12 = load i64, i64* %3
%13 = sub i64 %12, 1
%14 = call i64 @fib(i64 %13)
%15 = load i64, i64* %3
%16 = sub i64 %15, 2
%17 = call i64 @fib(i64 %16)
%18 = add i64 %14, %17
store i64 %18, i64* %2
br label %19
19: ; preds = %11, %10, %6
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = add i64 %0, -1
%3 = icmp ult i64 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i64 @fib(i64 %5)
%9 = add i64 %6, -2
%10 = add i64 %8, %7
%11 = add i64 %6, -3
%12 = icmp ult i64 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i64 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ 1, %1 ], [ %14, %13 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void GP_add_vertex_f(void *arg, int v, double label) {
  printf("v %d %f\n", v, label);
}


x86 assembly (clang, -O0):
<GP_add_vertex_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"v %d %f\0A\00"
define void @GP_add_vertex_f(i8* nocapture readnone %0, i32 %1, double %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_tle();
void vm_op_tle(void) {
  op_tle();
  return;
}


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

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

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

LLVM IR (-O2):
define void @vm_op_tle() {
%1 = tail call i32 (...) @op_tle()
ret void
}
const char *f_name_in(long long int i) {
  switch (i) {
  case 0:
    return "x";
  case 1:
    return "s";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
test   %rax,%rax
je     1131 <f_name_in+0x31>
jmp    111e <f_name_in+0x1e>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
je     1141 <f_name_in+0x41>
jmp    1151 <f_name_in+0x51>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <f_name_in+0x59>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <f_name_in+0x59>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%rdi
lea    0xef5(%rip),%rax
cmove  %rax,%rcx
test   %rdi,%rdi
lea    0xee5(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
@.str.1 = [2 x i8] c"s\00"
define i8* @f_name_in(i64 %0) {
%2 = icmp eq i64 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i64 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ terminal_match_hitory(int);
void terminal_action_find_history_backward(int c,
                                           void (*process_line)(char *line)) {
  terminal_match_hitory(true);
}


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

x86 assembly (clang, -O2):
<terminal_action_find_history_backward>:
mov    $0x1,%edi
jmp    1030 <terminal_match_hitory@plt>

LLVM IR (-O0):
define void @terminal_action_find_history_backward(i32 %0, void (i8*)* %1) {
%3 = alloca i32
%4 = alloca void (i8*)*
store i32 %0, i32* %3
store void (i8*)* %1, void (i8*)** %4
%5 = call i32 @terminal_match_hitory(i32 1)
ret void
}

LLVM IR (-O2):
define void @terminal_action_find_history_backward(i32 %0, void (i8*)* nocapture readnone %1) {
%3 = tail call i32 @terminal_match_hitory(i32 1)
ret void
}
/* Variables and functions */
float sqrt(int);
int exact_square(int number) {
  float square_check = sqrt(number);
  if (square_check / 1 == (int)square_check) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xecb(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jne    115d <exact_square+0x4d>
jp     115d <exact_square+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <exact_square+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
push   %rax
call   1030 <sqrt@plt>
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call float @sqrt(i32 %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = fdiv float %7, 1.000000e+00
%9 = load float, float* %4
%10 = fptosi float %9 to i32
%11 = sitofp i32 %10 to float
%12 = fcmp oeq float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = tail call float @sqrt(i32 %0)
%3 = fptosi float %2 to i32
%4 = sitofp i32 %3 to float
%5 = fcmp oeq float %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ hashlittle(char const *, size_t, int /*<<< orphan*/);
uint32_t SuperFastHash(const char *data, int32_t len, uint32_t init) {
  return hashlittle(data, (size_t)len, init);
}


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

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

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

LLVM IR (-O2):
define i32 @SuperFastHash(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @hashlittle(i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int);
void cbm_iec_set(int f, int line) { ioctl(f, _IO(0xcb, 13), line); }


x86 assembly (clang, -O0):
<cbm_iec_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xcb,%edi
mov    $0xd,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_iec_set>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xcb,%edi
mov    $0xd,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define void @cbm_iec_set(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 = call i32 @_IO(i32 203, i32 13)
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @cbm_iec_set(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 203, i32 13)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret void
}