xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aFree_(void *p, const char *file, int line, const char *func) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<aFree_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <aFree_+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aFree_>:
test   %rdi,%rdi
je     111a <aFree_+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @aFree_(i8* %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void testing_log_callback(const char *msg) {
  fprintf(stderr, "Log: %s\n", msg);
}


x86 assembly (clang, -O0):
<testing_log_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testing_log_callback>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"Log: %s\0A\00"
define void @testing_log_callback(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void bootmain(void) {
  int i;
  while (1) {
  }
}


x86 assembly (clang, -O0):
<bootmain>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <bootmain+0x4>

x86 assembly (clang, -O2):
<bootmain>:
jmp    1100 <bootmain>

LLVM IR (-O0):
define void @bootmain() {
%1 = alloca i32
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @bootmain() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int main(int argc, char *argv[]) {
  func1();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @func1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void info() {
  fprintf(stdout, "Try \'confextract -h\' for more information\n");
}


x86 assembly (clang, -O0):
<info>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<info>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [43 x i8] c"Try 'confextract -h' for more information\0A\00"
define void @info() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [43 x i8] c"Try 'confextract -h' for more information\0A\00"
define void @info() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ logprintf(int /*<<< orphan*/, char *);
int sqlite_add_popd(int /*<<< orphan*/ *, char *);
int mode_add(sqlite3 *db, int argc, char *argv[]) {
  if (argc < 2) {
    logprintf(0, "Missing user\n\n");
    return -1;
  }
  return sqlite_add_popd(db, argv[1]);
}


x86 assembly (clang, -O0):
<mode_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1157 <mode_add+0x37>
xor    %edi,%edi
lea    0xeba(%rip),%rsi
call   1040 <logprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <mode_add+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <sqlite_add_popd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_add>:
push   %rax
cmp    $0x1,%esi
jg     113b <mode_add+0x1b>
lea    0xed3(%rip),%rsi
xor    %edi,%edi
call   1040 <logprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rdx),%rsi
pop    %rax
jmp    1030 <sqlite_add_popd@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Missing user\0A\0A\00"
define i32 @mode_add(i32* %0, i32 %1, i8** nocapture %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @logprintf(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %2, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @sqlite_add_popd(i32* %0, i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ -1, %5 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int valor = 0;
  switch (valor) {
  case 0:
    printf("es igual a 0\n");
    break;
  case 1:
    printf("es igual a 1\n");
    break;
  default:
    printf("Valor no esperado\n");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <main+0x33>
jmp    1132 <main+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <main+0x44>
jmp    1165 <main+0x55>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x61>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x61>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"es igual a 0\0A\00"
@.str.1 = [14 x i8] c"es igual a 1\0A\00"
@.str.2 = [19 x i8] c"Valor no esperado\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
switch i32 %2, label %7 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5, %3
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"es igual a 0\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void int_array2D_delete(int **p) {
  if (p) {
    free(p[0]);
    free(p);
  }
}


x86 assembly (clang, -O0):
<int_array2D_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <int_array2D_delete+0x2c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_array2D_delete>:
test   %rdi,%rdi
je     112a <int_array2D_delete+0x1a>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @int_array2D_delete(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i32** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i32** %0 to i8*
tail call void @free(i8* %6)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dynamicArr;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
void dynamicArray(void) {
  int *dynamicArr = malloc(20 * sizeof(int));
  *dynamicArr = 10;
  dynamicArr[1] = 100;
  printf("The size of dynamicArr is %d\n", sizeof(dynamicArr));
  free(dynamicArr);
}


x86 assembly (clang, -O0):
<dynamicArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x64,0x4(%rax)
lea    0xe9e(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamicArray>:
push   %rbx
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movabs $0x640000000a,%rax
mov    %rax,(%rbx)
lea    0xeae(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"The size of dynamicArr is %d\0A\00"
define void @dynamicArray() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 80)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 10, i32* %3
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32 100, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 8)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"The size of dynamicArr is %d\0A\00"
define void @dynamicArray() {
%1 = tail call i32* @malloc(i32 80)
store i32 10, i32* %1
%2 = getelementptr inbounds i32, i32* %1, i64 1
store i32 100, i32* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = tail call i32 @free(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ wyhash64();
uint32_t wyhash64_cast32(void) { return (uint32_t)wyhash64(); }


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

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

LLVM IR (-O0):
define i32 @wyhash64_cast32() {
%1 = call i32 (...) @wyhash64()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wyhash64_cast32() {
%1 = tail call i32 (...) @wyhash64()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ config_end();
int /*<<< orphan*/ qqsocket_end();
void libqq_cleanup() {
  config_end();
  qqsocket_end();
}


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

x86 assembly (clang, -O2):
<libqq_cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <config_end@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <qqsocket_end@plt>

LLVM IR (-O0):
define void @libqq_cleanup() {
%1 = call i32 (...) @config_end()
%2 = call i32 (...) @qqsocket_end()
ret void
}

LLVM IR (-O2):
define void @libqq_cleanup() {
%1 = tail call i32 (...) @config_end()
%2 = tail call i32 (...) @qqsocket_end()
ret void
}
void comm_barrier(const struct comm *c) {}


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

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

LLVM IR (-O0):
%struct.comm = type opaque
define void @comm_barrier(%struct.comm* %0) {
%2 = alloca %struct.comm*
store %struct.comm* %0, %struct.comm** %2
ret void
}

LLVM IR (-O2):
%struct.comm = type opaque
define void @comm_barrier(%struct.comm* nocapture %0) {
ret void
}
/* Type definitions */
struct cc_usb {
  int dummy;
};

/* Variables and functions */
scalar_t__ _cc_usb_sync(struct cc_usb *, int /*<<< orphan*/, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cc_usb_sync(struct cc_usb *cc) {
  if (_cc_usb_sync(cc, 0, 5000) < 0) {
    fprintf(stderr, "USB link timeout\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<cc_usb_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1040 <_cc_usb_sync@plt>
cmp    $0x0,%rax
jge    1175 <cc_usb_sync+0x45>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_usb_sync>:
push   %rax
xor    %esi,%esi
mov    $0x1388,%edx
call   1040 <_cc_usb_sync@plt>
test   %rax,%rax
js     1144 <cc_usb_sync+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.cc_usb = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"USB link timeout\0A\00"
define void @cc_usb_sync(%struct.cc_usb* %0) {
%2 = alloca %struct.cc_usb*
store %struct.cc_usb* %0, %struct.cc_usb** %2
%3 = load %struct.cc_usb*, %struct.cc_usb** %2
%4 = call i64 @_cc_usb_sync(%struct.cc_usb* %3, i32 0, i32 5000)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.cc_usb = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"USB link timeout\0A\00"
define void @cc_usb_sync(%struct.cc_usb* %0) {
%2 = tail call i64 @_cc_usb_sync(%struct.cc_usb* %0, i32 0, i32 5000)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void os_boot_rendez(void) {}


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

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

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

LLVM IR (-O2):
define void @os_boot_rendez() {
ret void
}
void foo243() {}


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

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

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

LLVM IR (-O2):
define void @foo243() {
ret void
}
void pack12(p, n, last) register char *p;
register n;
int last;
{}


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

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

LLVM IR (-O0):
define void @pack12(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 void
}

LLVM IR (-O2):
define void @pack12(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int __wchar_forbitten(wchar_t sym) {
  if ((sym >= 0xd800) && (sym <= 0xdfff))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<__wchar_forbitten>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xd800,-0x8(%rbp)
jl     112d <__wchar_forbitten+0x2d>
cmpl   $0xdfff,-0x8(%rbp)
jg     112d <__wchar_forbitten+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1134 <__wchar_forbitten+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wchar_forbitten>:
and    $0xfffff800,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @__wchar_forbitten(i32 %0) {
%2 = and i32 %0, -2048
%3 = icmp eq i32 %2, 55296
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int CSlim_IsCharacter(unsigned char *);
long FieldLength(unsigned char *nodeString) {
  unsigned char *p;
  long fieldlength = 0;
  for (p = nodeString; *p; p++)
    if (CSlim_IsCharacter(p) == 1)
      fieldlength++;
  return fieldlength;
}


x86 assembly (clang, -O0):
<FieldLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <FieldLength+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <CSlim_IsCharacter@plt>
cmp    $0x1,%eax
jne    1157 <FieldLength+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115c <FieldLength+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <FieldLength+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FieldLength>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113f <FieldLength+0x2f>
mov    %rdi,%rbx
xor    %r14d,%r14d
nop
mov    %rbx,%rdi
call   1030 <CSlim_IsCharacter@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %rcx,%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <FieldLength+0x10>
jmp    1142 <FieldLength+0x32>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @FieldLength(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = tail call i32 @CSlim_IsCharacter(i8* %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i64
%10 = add nuw nsw i64 %5, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Variables and functions */
long long PAPI_get_real_usec();
void papif_get_real_usec__(long long *time) { *time = PAPI_get_real_usec(); }


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

x86 assembly (clang, -O2):
<papif_get_real_usec__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_real_usec@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_get_real_usec__(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_get_real_usec()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @papif_get_real_usec__(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_usec()
store i64 %2, i64* %0
ret void
}
unsigned twoxsai_generic_output_fmts(unsigned input_fmts) { return input_fmts; }


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

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

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

LLVM IR (-O2):
define i32 @twoxsai_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int SyncDisk();
int Shutdown(void) { return SyncDisk(); }


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

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

LLVM IR (-O0):
define i32 @Shutdown() {
%1 = call i32 (...) @SyncDisk()
ret i32 %1
}

LLVM IR (-O2):
define i32 @Shutdown() {
%1 = tail call i32 (...) @SyncDisk()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void async_release() {
  printf("Your system does not support async I/O\n");
  exit(173);
}


x86 assembly (clang, -O0):
<async_release>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xad,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<async_release>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xad,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Your system does not support async I/O\0A\00"
define void @async_release() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 173)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"Your system does not support async I/O\00"
define void @async_release() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 173)
unreachable
}
void __ompc_flush(void *p) {}


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

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

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

LLVM IR (-O2):
define void @__ompc_flush(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
void unaligned_write_be32(void *_u, uint32_t a) {
  struct __attribute__((packed, may_alias)) {
    uint32_t x;
  } *u = _u;
  u->x = be32toh(a);
}


x86 assembly (clang, -O0):
<unaligned_write_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <be32toh@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_be32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <be32toh@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @unaligned_write_be32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = call i32 @be32toh(i32 %8)
%10 = load %struct.anon*, %struct.anon** %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @unaligned_write_be32(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @be32toh(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("The result of subtraction is %d", a - b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
sub    (%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [32 x i8] c"The result of subtraction is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [32 x i8] c"The result of subtraction is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int watchdog_register(struct watchdog *w) { return 0; }


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

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

LLVM IR (-O0):
%struct.watchdog = type opaque
define i32 @watchdog_register(%struct.watchdog* %0) {
%2 = alloca %struct.watchdog*
store %struct.watchdog* %0, %struct.watchdog** %2
ret i32 0
}

LLVM IR (-O2):
%struct.watchdog = type opaque
define i32 @watchdog_register(%struct.watchdog* nocapture readnone %0) {
ret i32 0
}
void sync_buffer() {}


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

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

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

LLVM IR (-O2):
define void @sync_buffer() {
ret void
}
/* Variables and functions */
char *calloc(int, int);
char *allocmem(char *buf, int size) { return buf = calloc(size, sizeof(char)); }


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

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

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

LLVM IR (-O2):
define noalias i8* @allocmem(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %1, i32 1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t _swap16(uint16_t v) {
  uint8_t *ptr = (void *)&v;
  uint8_t tmp;
  tmp = ptr[1];
  ptr[1] = ptr[0];
  ptr[0] = tmp;
  return v;
}


x86 assembly (clang, -O0):
<_swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_swap16(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void AfficherImage(char *nomFichier) {
  char command[40];
  sprintf(command, "eog %s", nomFichier);
  system(command);
}


x86 assembly (clang, -O0):
<AfficherImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <system@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfficherImage>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"eog %s\00"
define void @AfficherImage(i8* %0) {
%2 = alloca [40 x i8]
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ ncurses_display_refresh();
void ncurses_display_hal_init(void) {
  initscr();
  erase();
  ncurses_display_refresh();
}


x86 assembly (clang, -O0):
<ncurses_display_hal_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1040 <erase@plt>
mov    $0x0,%al
call   1050 <ncurses_display_refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncurses_display_hal_init>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1040 <erase@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ncurses_display_refresh@plt>

LLVM IR (-O0):
define void @ncurses_display_hal_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @erase()
%3 = call i32 (...) @ncurses_display_refresh()
ret void
}

LLVM IR (-O2):
define void @ncurses_display_hal_init() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @erase()
%3 = tail call i32 (...) @ncurses_display_refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ skip(int);
extern void Modification_Detection_Code_Packet(int len) {
  printf("\tMDC - SHA1(20 bytes)\n");
  skip(len);
}


x86 assembly (clang, -O0):
<Modification_Detection_Code_Packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Modification_Detection_Code_Packet>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <skip@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\09MDC - SHA1(20 bytes)\0A\00"
define void @Modification_Detection_Code_Packet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @skip(i32 %4)
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"\09MDC - SHA1(20 bytes)\00"
define void @Modification_Detection_Code_Packet(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @skip(i32 %0)
ret void
}
int window_int(int x, int x_min, int x_max) {
  x = (x < x_min) ? x_min : x;
  x = (x > x_max) ? x_max : x;
  return x;
}


x86 assembly (clang, -O0):
<window_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <window_int+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <window_int+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <window_int+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <window_int+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

LLVM IR (-O0):
define i32 @window_int(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %14
12: ; preds = %3
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %6
br label %23
21: ; preds = %14
%22 = load i32, i32* %4
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %4
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @window_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int popcnt5(uint64_t x) {
  int c;
  for (c = 0; x != 0; x &= x - 1)
    c++;
  return c;
}


x86 assembly (clang, -O0):
<popcnt5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <popcnt5+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <popcnt5+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcnt5>:
xor    %eax,%eax
test   %edi,%edi
je     111c <popcnt5+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <popcnt5+0x10>
ret

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

LLVM IR (-O2):
define i32 @popcnt5(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t ffi_reinterpret_uint16_t(void *result) { return (uint16_t)result; }


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

x86 assembly (clang, -O2):
<ffi_reinterpret_uint16_t>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @ffi_reinterpret_uint16_t(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
void REMR3Term(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3Term() {
ret void
}
/* Variables and functions */
unsigned char gf4_mul_2(unsigned char);
unsigned char gf4_mul(unsigned char a, unsigned char b) {
  unsigned char r = a * (b & 1);
  return r ^ (gf4_mul_2(a) * (b >> 1));
}


x86 assembly (clang, -O0):
<gf4_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
and    $0x1,%ecx
imul   %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <gf4_mul_2@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movzbl %cl,%ecx
movzbl -0x2(%rbp),%edx
sar    $0x1,%edx
imul   %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf4_mul>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %ebx,%eax
and    $0x1,%al
mul    %dil
mov    %eax,%ebp
call   1030 <gf4_mul_2@plt>
shr    %bl
mul    %bl
xor    %bpl,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i8 @gf4_mul(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, 1
%4 = mul nuw nsw i8 %3, %0
%5 = tail call zeroext i8 @gf4_mul_2(i8 zeroext %0)
%6 = lshr i8 %1, 1
%7 = mul i8 %5, %6
%8 = xor i8 %7, %4
ret i8 %8
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int main(void) {
  struct timespec ts;
  if (clock_gettime(CLOCK_REALTIME, &ts) < 0)
    return 111;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
jge    1147 <main+0x37>
movl   $0x6f,-0x4(%rbp)
jmp    114e <main+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
sar    $0x3f,%rax
and    $0x6f,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 111, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp slt i64 %4, 0
%6 = select i1 %5, i32 111, i32 0
ret i32 %6
}
main() {
  int a[2];
  return sizeof a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_version(void) {
  printf("nanddump"
         " "
         "$Revision: 1.1.1.1 $"
         "\n"
         "\n"
         "nanddump"
         " comes with NO WARRANTY\n"
         "to the extent permitted by law.\n"
         "\n"
         "You may redistribute copies of "
         "nanddump"
         "\n"
         "under the terms of the GNU General Public Licence.\n"
         "See the file `COPYING' for more information.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [233 x i8] c"nanddump $Revision: 1.1.1.1 $\0A\0Ananddump comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nanddump\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\0A\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [232 x i8] c"nanddump $Revision: 1.1.1.1 $\0A\0Ananddump comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nanddump\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([232 x i8], [232 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LCD_CLR_A0();
int /*<<< orphan*/ Send1(unsigned char);
void LCD_X_Write00(unsigned char Cmd) {
  ;
  LCD_CLR_A0();
  Send1(Cmd);
  ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <LCD_CLR_A0@plt>
movzbl -0x1(%rbp),%edi
call   1030 <Send1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @LCD_X_Write00(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @LCD_CLR_A0()
%4 = load i8, i8* %2
%5 = call i32 @Send1(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @LCD_X_Write00(i8 zeroext %0) {
%2 = tail call i32 (...) @LCD_CLR_A0()
%3 = tail call i32 @Send1(i8 zeroext %0)
ret void
}
void SXNET_add_id_INTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @SXNET_add_id_INTEGER() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toScalar(int /*<<< orphan*/);
void IF_toScalarR(void) { toScalar(0); }


x86 assembly (clang, -O0):
<IF_toScalarR>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <toScalar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_toScalarR>:
xor    %edi,%edi
jmp    1030 <toScalar@plt>

LLVM IR (-O0):
define void @IF_toScalarR() {
%1 = call i32 @toScalar(i32 0)
ret void
}

LLVM IR (-O2):
define void @IF_toScalarR() {
%1 = tail call i32 @toScalar(i32 0)
ret void
}