xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str_1[7] = "NETWORK";
  char str_2[11] = "The African Queen";
  printf("%s\n", str_1);
  printf("%s\n", str_2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x16(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0xe(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0xb(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    -0x16(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x4b524f57,0xb(%rsp)
4b
movl   $0x5754454e,0x8(%rsp)
57
movabs $0x6972664120656854,%rax
66 72 69
mov    %rax,0x10(%rsp)
movl   $0x6e616369,0x17(%rsp)
6e
lea    0xecf(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str_1 = [7 x i8] c"NETWORK"
@__const.main.str_2 = [11 x i8] c"The African"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [11 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [11 x i8]* %3 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str_1 = [7 x i8] c"NETWORK"
@__const.main.str_2 = [11 x i8] c"The African"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int x;
  for (x = 0; x < 20; ++x)
    printf("%d + (%d %% 2 > 0) = %d\n", x, x, x + (x % 2 > 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1173 <main+0x63>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
mov    $0x2,%edi
cltd
idiv   %edi
mov    %edx,%eax
mov    -0xc(%rbp),%edx
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%ecx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %ebx,%ecx
and    $0x1,%ecx
add    %ebx,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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

/* Variables and functions */
unsigned int extract_uint(uint8_t *buf) { return *(int *)buf; }


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

x86 assembly (clang, -O2):
<extract_uint>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @extract_uint(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_base32hex(char *, int, int /*<<< orphan*/ *);
int string_val(void *ctx, char *val, int vallen) {
  FILE *fp = ctx;
  fwrite_base32hex(val, vallen, fp);
  return 0;
}


x86 assembly (clang, -O0):
<string_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <fwrite_base32hex@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_val>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <fwrite_base32hex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_val(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite_base32hex(i8* %10, i32 %11, i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @string_val(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite_base32hex(i8* %1, i32 %2, i32* %4)
ret i32 0
}
unsigned long get4l(const char *attr, int p) {
  int i;
  unsigned long v;
  v = 0;
  for (i = 0; i < 4; i++)
    v += ((long)(attr[p + i] & 255)) << (8 * i);
  return (v);
}


x86 assembly (clang, -O0):
<get4l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    115d <get4l+0x5d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xff,%eax
cltq
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
shl    %cl,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <get4l+0x1a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get4l>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define i64 @get4l(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = add nsw i64 %3, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = shl nuw nsw i64 %10, 8
%12 = or i64 %11, %6
%13 = add nsw i64 %3, 2
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 16
%18 = or i64 %17, %12
%19 = add nsw i64 %3, 3
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl nuw nsw i64 %22, 24
%24 = or i64 %23, %18
ret i64 %24
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_pin(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
uint8_t get_pin_pullup(uint8_t address, uint8_t pin) {
  return get_pin(address, pin, 0x0C, 0x0D);
}


x86 assembly (clang, -O0):
<get_pin_pullup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xc,%edx
mov    $0xd,%ecx
call   1030 <get_pin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pin_pullup>:
mov    $0xc,%edx
mov    $0xd,%ecx
jmp    1030 <get_pin@plt>

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

LLVM IR (-O2):
define i32 @get_pin_pullup(i32 %0, i32 %1) {
%3 = tail call i32 @get_pin(i32 %0, i32 %1, i32 12, i32 13)
ret i32 %3
}
void function_urole(char *urole) {}


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

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

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

LLVM IR (-O2):
define void @function_urole(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prepare(void) { printf("prepare\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"prepare\00"
define void @prepare() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_int();
int f(int /*<<< orphan*/, int /*<<< orphan*/);
int main() { return f(__VERIFIER_nondet_int(), __VERIFIER_nondet_int()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__VERIFIER_nondet_int()
%3 = call i32 (...) @__VERIFIER_nondet_int()
%4 = call i32 @f(i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @f(i32 %1, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  pid_t pid = getpid();
  printf("My PID = %d\n", pid);
  printf("My Parent PID = %d\n", getppid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"My PID = %d\0A\00"
@.str.1 = [20 x i8] c"My Parent PID = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void speex_memset_bytes(char *dst, char src, int nbytes) {
  memset(dst, src, nbytes);
}


x86 assembly (clang, -O0):
<speex_memset_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movsbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @speex_memset_bytes(i8* %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvread_open_fromfileskip(char *);
void fgmvread_open_fromfileskip_(char *filnam) {
  int i;
  char charbuffer[200];
  i = 0;
  while (*(filnam + i) != ' ') {
    charbuffer[i] = *(filnam + i);
  }
  charbuffer[i] = '\0';
  gmvread_open_fromfileskip(charbuffer);
}


x86 assembly (clang, -O0):
<fgmvread_open_fromfileskip_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1156 <fgmvread_open_fromfileskip_+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0xe0(%rbp,%rax,1)
jmp    1126 <fgmvread_open_fromfileskip_+0x16>
movslq -0xc(%rbp),%rax
movb   $0x0,-0xe0(%rbp,%rax,1)
lea    -0xe0(%rbp),%rdi
call   1030 <gmvread_open_fromfileskip@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvread_open_fromfileskip_>:
sub    $0xc8,%rsp
movb   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <gmvread_open_fromfileskip@plt>
add    $0xc8,%rsp
ret

LLVM IR (-O0):
define void @fgmvread_open_fromfileskip_(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [200 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %22
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %20
store i8 %18, i8* %21
br label %5
22: ; preds = %5
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %24
store i8 0, i8* %25
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%27 = call i32 @gmvread_open_fromfileskip(i8* %26)
ret void
}

LLVM IR (-O2):
define void @fgmvread_open_fromfileskip_(i8* nocapture %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = call i32 @gmvread_open_fromfileskip(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fitting(int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                           double *);
int load(char *, int);
int /*<<< orphan*/ m_buf(int);
int /*<<< orphan*/ m_destruct();
int /*<<< orphan*/ m_free(int);
int /*<<< orphan*/ m_init();
int m_len(int);
scalar_t__ m_next(int, int *, int **);
scalar_t__ mls(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_gauss();
int /*<<< orphan*/ test_touch_cal();
int main(int argc, char *argv[]) {
  double res[3];
  m_init();
  test_touch_cal();
  exit(1);
  test_gauss();
  exit(1);
  int table = load("f3flowtab", 5);
  printf("rows %d\n", m_len((*(int *)mls((table), (0)))));
  puts("fit 2:4");
  fitting(m_buf((*(int *)mls((table), (1)))),
          m_buf((*(int *)mls((table), (3)))),
          m_len((*(int *)mls((table), (1)))), 2, res);
  int *d;
  int i;
  for (i = -1; m_next(table, &i, &d);)
    m_free(*d);
  m_free(table);
  m_destruct();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <m_init@plt>
mov    $0x0,%al
call   1030 <test_touch_cal@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <m_init@plt>
xor    %eax,%eax
call   1030 <test_touch_cal@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x double]
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (...) @m_init()
%11 = call i32 (...) @test_touch_cal()
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @m_init()
%4 = tail call i32 (...) @test_touch_cal()
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ nl();
int /*<<< orphan*/ noraw();
int ro_screen_end(void) {
  curs_set(1);
  nl();
  noraw();
  echo();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<ro_screen_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1070 <curs_set@plt>
mov    $0x0,%al
call   1040 <nl@plt>
mov    $0x0,%al
call   1050 <noraw@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ro_screen_end>:
push   %rax
mov    $0x1,%edi
call   1070 <curs_set@plt>
xor    %eax,%eax
call   1040 <nl@plt>
xor    %eax,%eax
call   1050 <noraw@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ro_screen_end() {
%1 = call i32 @curs_set(i32 1)
%2 = call i32 (...) @nl()
%3 = call i32 (...) @noraw()
%4 = call i32 (...) @echo()
%5 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @ro_screen_end() {
%1 = tail call i32 @curs_set(i32 1)
%2 = tail call i32 (...) @nl()
%3 = tail call i32 (...) @noraw()
%4 = tail call i32 (...) @echo()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_char(char);
int /*<<< orphan*/ cm_w(int);
void cm_tie(int arg) {
  if (arg == 0) {
    cm_w(0);
    add_char(' ');
  } else
    cm_w(1);
}


x86 assembly (clang, -O0):
<cm_tie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114b <cm_tie+0x2b>
xor    %edi,%edi
call   1040 <cm_w@plt>
mov    $0x20,%edi
call   1030 <add_char@plt>
jmp    1155 <cm_tie+0x35>
mov    $0x1,%edi
call   1040 <cm_w@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_tie>:
test   %edi,%edi
je     112e <cm_tie+0xe>
mov    $0x1,%edi
jmp    1040 <cm_w@plt>
push   %rax
xor    %edi,%edi
call   1040 <cm_w@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <add_char@plt>

LLVM IR (-O0):
define void @cm_tie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @cm_w(i32 0)
%7 = call i32 @add_char(i8 signext 32)
br label %10
8: ; preds = %1
%9 = call i32 @cm_w(i32 1)
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @cm_tie(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @cm_w(i32 0)
%5 = tail call i32 @add_char(i8 signext 32)
br label %8
6: ; preds = %1
%7 = tail call i32 @cm_w(i32 1)
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void rpi_usleep(uint32_t us) { usleep(us); }


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

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

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

LLVM IR (-O2):
define void @rpi_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool I2CSlaveIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return (((*((volatile uint32_t *)(ui32Base + 0x00000814)))) ? true : false);
  } else {
    return (((*((volatile uint32_t *)(ui32Base + 0x00000810)))) ? true : false);
  }
}


x86 assembly (clang, -O0):
<I2CSlaveIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1136 <I2CSlaveIntStatus+0x36>
mov    -0x10(%rbp),%rax
mov    0x814(%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <I2CSlaveIntStatus+0x52>
mov    -0x10(%rbp),%rax
mov    0x810(%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntStatus>:
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
xor    %eax,%eax
cmpq   $0x0,0x810(%rdi,%rcx,4)
setne  %al
ret

LLVM IR (-O0):
define i32 @I2CSlaveIntStatus(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i64, i64* %4
%10 = add nsw i64 %9, 2068
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
store i32 %15, i32* %3
br label %24
16: ; preds = %2
%17 = load i64, i64* %4
%18 = add nsw i64 %17, 2064
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
store i32 %23, i32* %3
br label %24
24: ; preds = %16, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @I2CSlaveIntStatus(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i64 2064, i64 2068
%5 = add nsw i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct iax_session {
  int dummy;
};

/* Variables and functions */
int send_command(struct iax_session *, int, int, int /*<<< orphan*/,
                 unsigned char *, int, int);
int iax_send_image(struct iax_session *session, int format, unsigned char *data,
                   int datalen) {
  return send_command(session, 8, format, 0, data, datalen, -1);
}


x86 assembly (clang, -O0):
<iax_send_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x8,%esi
xor    %ecx,%ecx
movl   $0xffffffff,(%rsp)
call   1030 <send_command@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iax_send_image>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%edx
movl   $0xffffffff,(%rsp)
mov    $0x8,%esi
xor    %ecx,%ecx
call   1030 <send_command@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.iax_session = type { i32 }
define i32 @iax_send_image(%struct.iax_session* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.iax_session*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.iax_session* %0, %struct.iax_session** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.iax_session*, %struct.iax_session** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @send_command(%struct.iax_session* %9, i32 8, i32 %10, i32 0, i8* %11, i32 %12, i32 -1)
ret i32 %13
}

LLVM IR (-O2):
%struct.iax_session = type { i32 }
define i32 @iax_send_image(%struct.iax_session* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @send_command(%struct.iax_session* %0, i32 8, i32 %1, i32 0, i8* %2, i32 %3, i32 -1)
ret i32 %5
}
/* Type definitions */
typedef unsigned int int32_t;

/* Variables and functions */
int e32(const void *s) {
  unsigned int c;
  c = *(int32_t *)s;
  return ((c >> 24) | ((c >> 8) & 0x00FF00) | ((c << 8) & 0xFF0000) |
          (c << 24));
}


x86 assembly (clang, -O0):
<e32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @e32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = lshr i32 %7, 24
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %3
%14 = shl i32 %13, 8
%15 = and i32 %14, 16711680
%16 = or i32 %12, %15
%17 = load i32, i32* %3
%18 = shl i32 %17, 24
%19 = or i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @e32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}
char *http_skip2break(char *ptr) {
  while (*ptr != '\r')
    ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<http_skip2break>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1129 <http_skip2break+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <http_skip2break+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_skip2break>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0xd,0x1(%rax)
lea    0x1(%rax),%rax
jne    1110 <http_skip2break+0x10>
ret

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

LLVM IR (-O2):
define i8* @http_skip2break(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 13
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct MemoryTable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MemoryTable_clear(struct MemoryTable *);
void MemoryTable_deinit(struct MemoryTable *self) { MemoryTable_clear(self); }


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

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

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

LLVM IR (-O2):
%struct.MemoryTable = type { i32 }
define void @MemoryTable_deinit(%struct.MemoryTable* %0) {
%2 = tail call i32 @MemoryTable_clear(%struct.MemoryTable* %0)
ret void
}
/* Variables and functions */
char *DbugMalloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *StrDup(const char *str) {
  register char *new_malloc;
  new_malloc = DbugMalloc((int)strlen(str) + 1);
  (void)strcpy(new_malloc, str);
  return (new_malloc);
}


x86 assembly (clang, -O0):
<StrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1050 <DbugMalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrDup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <DbugMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @StrDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, 1
%8 = call i8* @DbugMalloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @StrDup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 1
%5 = tail call i8* @DbugMalloc(i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
int sx(unsigned int val, int bits) {
  int mask;
  if (val & (1 << (bits - 1))) {
    mask = ~((1 << (bits - 1)) - 1);
    val = val | mask;
  }
  return val;
}


x86 assembly (clang, -O0):
<sx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1146 <sx+0x46>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sx>:
mov    %esi,%ecx
add    $0xff,%cl
mov    $0x1,%edx
shl    %cl,%edx
movzbl %cl,%ecx
neg    %edx
xor    %eax,%eax
bt     %ecx,%edi
cmovb  %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @sx(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* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
%10 = and i32 %6, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = shl i32 1, %14
%16 = sub nsw i32 %15, 1
%17 = xor i32 %16, -1
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = or i32 %18, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %12, %2
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @sx(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = sub i32 0, %4
%8 = select i1 %6, i32 0, i32 %7
%9 = or i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int open(char const *, int, int);
int mmp_open(const char *path, int flags, int mode) {
  return open(path, flags, mode);
}


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

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

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

LLVM IR (-O2):
define i32 @mmp_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void av_get_channel_name() {}


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

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

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

LLVM IR (-O2):
define void @av_get_channel_name() {
ret void
}
void hiusb_ohci_disable_clk(void) {}


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

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

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

LLVM IR (-O2):
define void @hiusb_ohci_disable_clk() {
ret void
}
char get_host_endian() {
  int i = 1;
  char *p = (char *)&i;
  return (p[0] == 1) ? 0x02 : 0x01;
}


x86 assembly (clang, -O0):
<get_host_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_host_endian>:
mov    $0x2,%al
ret

LLVM IR (-O0):
define signext i8 @get_host_endian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 2, i32 1
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @get_host_endian() {
ret i8 2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int fsetxattr(int __fd, const char *__name, const void *__value, size_t __size,
              int __flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<fsetxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsetxattr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @fsetxattr(i32 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @fsetxattr(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
int strlen(const char *s) {
  for (int i = 0;; i++)
    if (s[i] == '\0')
      return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1129 <strlen+0x29>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    112e <strlen+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int mknod(n, m, a)
char *n;
{ return (0); }


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mknod(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x98() {
  Assert_real((isascii(152) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              765, ("isascii should be 0 for 0x98"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x98>:
push   %rax
mov    $0x98,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2fd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x98\00"
define void @t_isascii_0x98() {
%1 = call i64 @isascii(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x98\00"
define void @t_isascii_0x98() {
%1 = tail call i64 @isascii(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_A9uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xA9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A9uint64_lowword_reg>:
test   $0xa9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A9uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 169
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cli_fatal(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int mkdir(char const *, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void cli_mkdir(const char *fpath, int mode) {
  if (mkdir(fpath, mode) == -1)
    cli_fatal("cli_mkdir(%s): %s", fpath, strerror(errno));
}


x86 assembly (clang, -O0):
<cli_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    117c <cli_mkdir+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe89(%rip),%rdi
call   1040 <cli_fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_mkdir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
je     1140 <cli_mkdir+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <cli_fatal@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"cli_mkdir(%s): %s\00"
@errno = global i32 0
define void @cli_mkdir(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 @mkdir(i8* %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @cli_fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %12)
br label %14
14: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"cli_mkdir(%s): %s\00"
@errno = global i32 0
define void @cli_mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @cli_fatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
br label %9
9: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *run_lmntal_system(int /*<<< orphan*/, char *, char *,
                                      char *, char *, int /*<<< orphan*/);
FILE *lmntal_compile_rule_str(char *rule_str) {
  return run_lmntal_system(0, "--slimcode", "--compile-rule", "-e", rule_str,
                           0);
}


x86 assembly (clang, -O0):
<lmntal_compile_rule_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
xor    %r9d,%r9d
lea    0xed6(%rip),%rsi
lea    0xeda(%rip),%rdx
lea    0xee2(%rip),%rcx
mov    %r9d,%edi
call   1030 <run_lmntal_system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmntal_compile_rule_str>:
mov    %rdi,%r8
lea    0xee6(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xef2(%rip),%rcx
xor    %edi,%edi
xor    %r9d,%r9d
jmp    1030 <run_lmntal_system@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"--slimcode\00"
@.str.1 = [15 x i8] c"--compile-rule\00"
@.str.2 = [3 x i8] c"-e\00"
define i32* @lmntal_compile_rule_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @run_lmntal_system(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3, i32 0)
ret i32* %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"--slimcode\00"
@.str.1 = [15 x i8] c"--compile-rule\00"
@.str.2 = [3 x i8] c"-e\00"
define i32* @lmntal_compile_rule_str(i8* %0) {
%2 = tail call i32* @run_lmntal_system(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 0)
ret i32* %2
}
char *doit(int flag) { return 1 + (flag ? "\0wrong\n" : "\0right\n"); }


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef7(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
test   %edi,%edi
lea    0xeff(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\00wrong\0A\00"
@.str.1 = [8 x i8] c"\00right\0A\00"
define i8* @doit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%7 = getelementptr inbounds i8, i8* %6, i64 1
ret i8* %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"\00wrong\0A\00"
@.str.1 = [8 x i8] c"\00right\0A\00"
define i8* @doit(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 1), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1)
ret i8* %3
}