xunge/DecIR huggingface dataset:
add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void doStuff_constPointerToConstInt(int const *const u) {}


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

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

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

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

/* Variables and functions */
int EVP_DigestUpdate(int /*<<< orphan*/ *, unsigned char *, unsigned int);
int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, unsigned int count) {
  return EVP_DigestUpdate(ctx, data, count);
}


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

x86 assembly (clang, -O2):
<PEM_SignUpdate>:
jmp    1030 <EVP_DigestUpdate@plt>

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

LLVM IR (-O2):
define i32 @PEM_SignUpdate(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @EVP_DigestUpdate(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
int HelpItem79(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem79() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem79() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calc_test(char *);
int /*<<< orphan*/ symmetric_test();
int main(int argc, char *argv[]) {
  symmetric_test();
  calc_test(argc > 1 ? argv[1] : NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <symmetric_test@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1158 <main+0x38>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1163 <main+0x43>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1163 <main+0x43>
mov    -0x18(%rbp),%rdi
call   1030 <calc_test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <symmetric_test@plt>
cmp    $0x2,%ebp
jl     113b <main+0x1b>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1030 <calc_test@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @symmetric_test()
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi i8* [ %12, %9 ], [ null, %13 ]
%16 = call i32 @calc_test(i8* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @symmetric_test()
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
%10 = tail call i32 @calc_test(i8* %9)
ret i32 0
}
/* Variables and functions */
char *broadcast_command(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ print_broadcast_response(char *);
char *strdup(char *);
void broadcast_to_local(char *cmd) {
  char *dest = strdup("127.0.0.1");
  char *r = broadcast_command(dest, cmd);
  free(dest);
  print_broadcast_response(r);
  if (r)
    free(r);
}


x86 assembly (clang, -O0):
<broadcast_to_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <broadcast_command@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <print_broadcast_response@plt>
cmpq   $0x0,-0x18(%rbp)
je     1193 <broadcast_to_local+0x53>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<broadcast_to_local>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1050 <broadcast_command@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1040 <print_broadcast_response@plt>
test   %rbx,%rbx
je     1188 <broadcast_to_local+0x48>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
define void @broadcast_to_local(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i8* @broadcast_command(i8* %6, i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @print_broadcast_response(i8* %11)
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
br label %18
18: ; preds = %15, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
define void @broadcast_to_local(i8* %0) {
%2 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @broadcast_command(i8* %2, i8* %0)
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @print_broadcast_response(i8* %3)
%6 = icmp eq i8* %3, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @free(i8* %3)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int /*<<< orphan*/ swap_bits(unsigned int, unsigned int *);
int main(void) {
  unsigned int num, new_num;
  printf("Enter the number\n");
  scanf("%d", &num);
  swap_bits(num, &new_num);
  printf("Given number %d after swapping even bits with odd becomes %d\n", num,
         new_num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1040 <swap_bits@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%edi
lea    0x4(%rsp),%rsi
call   1050 <swap_bits@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter the number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"Given number %d after swapping even bits with odd becomes %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @swap_bits(i32 %6, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"Given number %d after swapping even bits with odd becomes %d\0A\00"
@str = [17 x i8] c"Enter the number\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @swap_bits(i32 %7, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vstart_init(int *, int);
void mp2vgop_init(uint8_t *p_mp2vgop) {
  mp2vstart_init(p_mp2vgop, 0xb8);
  p_mp2vgop[7] = 0x0;
}


x86 assembly (clang, -O0):
<mp2vgop_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb8,%esi
call   1030 <mp2vstart_init@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,0x1c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vgop_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb8,%esi
call   1030 <mp2vstart_init@plt>
movl   $0x0,0x1c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mp2vgop_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @mp2vstart_init(i32* %3, i32 184)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 7
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @mp2vgop_init(i32* %0) {
%2 = tail call i32 @mp2vstart_init(i32* %0, i32 184)
%3 = getelementptr inbounds i32, i32* %0, i64 7
store i32 0, i32* %3
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int arr[], int first, int last) {
  int pivot_pos;
  if (first < last) {
    pivot_pos = partition(arr, first, last);
    quick_sort(arr, first, pivot_pos - 1);
    quick_sort(arr, pivot_pos + 1, last);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ line_border_cond(struct mesh_var *, int const, int, int);
scalar_t__ line_mesh(struct mesh_var *, int const);
void inflow_1D_mesh(struct mesh_var *mv) {
  const int n_a = 0;
  if (line_mesh(mv, n_a) == 0)
    exit(5);
  line_border_cond(mv, n_a, -1, -3);
}


x86 assembly (clang, -O0):
<inflow_1D_mesh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <line_mesh@plt>
cmp    $0x0,%rax
jne    1162 <inflow_1D_mesh+0x32>
mov    $0x5,%edi
call   1030 <exit@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xfffffffd,%ecx
call   1040 <line_border_cond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inflow_1D_mesh>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1050 <line_mesh@plt>
test   %rax,%rax
je     1155 <inflow_1D_mesh+0x25>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xfffffffd,%ecx
pop    %rbx
jmp    1040 <line_border_cond@plt>
mov    $0x5,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.mesh_var = type { i32 }
define void @inflow_1D_mesh(%struct.mesh_var* %0) {
%2 = alloca %struct.mesh_var*
%3 = alloca i32
store %struct.mesh_var* %0, %struct.mesh_var** %2
store i32 0, i32* %3
%4 = load %struct.mesh_var*, %struct.mesh_var** %2
%5 = call i64 @line_mesh(%struct.mesh_var* %4, i32 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 5)
unreachable
9: ; preds = %1
%10 = load %struct.mesh_var*, %struct.mesh_var** %2
%11 = call i32 @line_border_cond(%struct.mesh_var* %10, i32 0, i32 -1, i32 -3)
ret void
}

LLVM IR (-O2):
%struct.mesh_var = type { i32 }
define void @inflow_1D_mesh(%struct.mesh_var* %0) {
%2 = tail call i64 @line_mesh(%struct.mesh_var* %0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 5)
unreachable
6: ; preds = %1
%7 = tail call i32 @line_border_cond(%struct.mesh_var* %0, i32 0, i32 -1, i32 -3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((weak)) weakDefault(void) { printf("redefine"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"redefine\00"
define weak void @weakDefault() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void script_get_vid_pid(int *out_vid, int *out_pid) {
  *out_vid = 0x17cc;
  *out_pid = 0x1600;
}


x86 assembly (clang, -O0):
<script_get_vid_pid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x17cc,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1600,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_get_vid_pid>:
movl   $0x17cc,(%rdi)
movl   $0x1600,(%rsi)
ret

LLVM IR (-O0):
define void @script_get_vid_pid(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
store i32 6092, i32* %5
%6 = load i32*, i32** %4
store i32 5632, i32* %6
ret void
}

LLVM IR (-O2):
define void @script_get_vid_pid(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 6092, i32* %0
store i32 5632, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int i = 1;
  printf("i:%d\n", i);
  do {
    printf("haha\n");
    continue;
  } while (--i);
  printf("i:%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    113e <main+0x2e>
mov    -0x14(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"i:%d\0A\00"
@str = [5 x i8] c"haha\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int main() {
  int a, b;
  a = 3 + 4;
  if (a > 5) {
    b = a;
  } else if (b < a) {
    b = a * 3 + 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1127 <main+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <main+0x42>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113d <main+0x3d>
imul   $0x3,-0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <main+0x42>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, int, long long);
int fun_stub_base_13_stub(long long a, int b, long long c) {
  printf("fun_stub_base_13_stub:a = %lld, b = %d, c = %lld\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_stub_base_13_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_13_stub>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
lea    0xedc(%rip),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
add    %r14d,%ebp
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"fun_stub_base_13_stub:a = %lld, b = %d, c = %lld\0A\00"
define i32 @fun_stub_base_13_stub(i64 %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %8, i64 %9)
%11 = load i64, i64* %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = load i64, i64* %6
%16 = add nsw i64 %14, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [50 x i8] c"fun_stub_base_13_stub:a = %lld, b = %d, c = %lld\0A\00"
define i32 @fun_stub_base_13_stub(i64 %0, i32 %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %1, i64 %2)
%5 = zext i32 %1 to i64
%6 = add i64 %5, %0
%7 = add i64 %6, %2
%8 = trunc i64 %7 to i32
ret i32 %8
}
int fun945() { return 945; }


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

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

LLVM IR (-O0):
define i32 @fun945() {
ret i32 945
}

LLVM IR (-O2):
define i32 @fun945() {
ret i32 945
}
showhelp() {}


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

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

LLVM IR (-O0):
define i32 @showhelp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @showhelp() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "a");
  fprintf(fp, "Testing...\n");
  fclose(fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int *get_int_pointer(void) { return (int *)malloc(sizeof(int *)); }


x86 assembly (clang, -O0):
<get_int_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int_pointer>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @get_int_pointer() {
%1 = call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
define i32* @get_int_pointer() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int fun1016() { return 1016; }


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

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

LLVM IR (-O0):
define i32 @fun1016() {
ret i32 1016
}

LLVM IR (-O2):
define i32 @fun1016() {
ret i32 1016
}
/* Type definitions */
struct fpga_model {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ is_in_row(struct fpga_model *, int, int /*<<< orphan*/,
                             int *);
int pos_in_row(int y, struct fpga_model *model) {
  int result;
  is_in_row(model, y, 0, &result);
  return result;
}


x86 assembly (clang, -O0):
<pos_in_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
xor    %edx,%edx
lea    -0x14(%rbp),%rcx
call   1030 <is_in_row@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_in_row>:
push   %rax
mov    %edi,%eax
lea    0x4(%rsp),%rcx
mov    %rsi,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <is_in_row@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.fpga_model = type { i32 }
define i32 @pos_in_row(i32 %0, %struct.fpga_model* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @is_in_row(%struct.fpga_model* %1, i32 %0, i32 0, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
struct dat {
  int dummy;
};

/* Variables and functions */
int __remove_pattern(struct dat *, unsigned char *, unsigned long,
                     int /*<<< orphan*/, void (*)(void *));
int remove_pattern(struct dat *d, unsigned char *key, unsigned long key_len,
                   void (*free_fn)(void *)) {
  return __remove_pattern(d, key, key_len, 0, free_fn);
}


x86 assembly (clang, -O0):
<remove_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %ecx,%ecx
call   1030 <__remove_pattern@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_pattern>:
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <__remove_pattern@plt>

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

LLVM IR (-O2):
%struct.dat = type { i32 }
define i32 @remove_pattern(%struct.dat* %0, i8* %1, i64 %2, void (i8*)* %3) {
%5 = tail call i32 @__remove_pattern(%struct.dat* %0, i8* %1, i64 %2, i32 0, void (i8*)* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ err1Flush(int /*<<< orphan*/, int *, int *);
void errFlbel(int *status) {
  int errbel = 1;
  err1Flush(0, &errbel, status);
}


x86 assembly (clang, -O0):
<errFlbel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
lea    -0xc(%rbp),%rsi
call   1030 <err1Flush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errFlbel>:
push   %rax
mov    %rdi,%rdx
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1030 <err1Flush@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @errFlbel(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 @err1Flush(i32 0, i32* %2, i32* %0)
ret void
}
void pcp_def_net_udp6_metrics(void) {}


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

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

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

LLVM IR (-O2):
define void @pcp_def_net_udp6_metrics() {
ret void
}
unsigned long int S(unsigned long int x, unsigned long int n) {
  return ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)));
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
movabs $0xffffffff,%rdx
and    -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
mov    %rsi,%rcx
mov    %rdi,%rdx
shl    %cl,%rdx
mov    %edi,%eax
lea    0x20(%rsi),%rcx
neg    %rcx
shr    %cl,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @S(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = shl i64 %5, %6
%8 = load i64, i64* %3
%9 = and i64 %8, 4294967295
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = lshr i64 %9, %11
%13 = or i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @S(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
%4 = and i64 %0, 4294967295
%5 = sub i64 32, %1
%6 = lshr i64 %4, %5
%7 = or i64 %6, %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int main() {
  int descriptor = open("/tmp/test_file", O_RDONLY);
  if (descriptor != -1) {
    close(descriptor);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1159 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1142 <main+0x22>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/test_file\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/test_file\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double fabs(double);
int rand();
double gen_rand_float(double min, double max) {
  double k, len = max - min;
  k = 10 * len * rand() / (RAND_MAX + 1.0);
  k = k / 10.0 - fabs(min);
  return k;
}


x86 assembly (clang, -O0):
<gen_rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed7(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
mov    0x2e82(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movaps 0xe70(%rip),%xmm2
pand   %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_rand_float>:
sub    $0x28,%rsp
movapd %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
mulsd  0xeda(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
mov    0x2ea1(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  0xea1(%rip),%xmm0
movapd 0x10(%rsp),%xmm1
andpd  0xea3(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @gen_rand_float(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = fmul double 1.000000e+01, %10
%12 = call i32 (...) @rand()
%13 = sitofp i32 %12 to double
%14 = fmul double %11, %13
%15 = load double, double* @RAND_MAX
%16 = fadd double %15, 1.000000e+00
%17 = fdiv double %14, %16
store double %17, double* %5
%18 = load double, double* %5
%19 = fdiv double %18, 1.000000e+01
%20 = load double, double* %3
%21 = call double @llvm.fabs.f64(double %20)
%22 = fsub double %19, %21
store double %22, double* %5
%23 = load double, double* %5
ret double %23
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @gen_rand_float(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fmul double %3, 1.000000e+01
%5 = tail call i32 (...) @rand()
%6 = sitofp i32 %5 to double
%7 = fmul double %4, %6
%8 = load double, double* @RAND_MAX
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %7, %9
%11 = fdiv double %10, 1.000000e+01
%12 = tail call double @llvm.fabs.f64(double %0)
%13 = fsub double %11, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xcd() {
  Assert_real((isprint(205) == 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_isprint.c",
              1030, ("isprint should be 0 for 0xcd"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xcd>:
push   %rax
mov    $0xcd,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x406,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xcd\00"
define void @t_isprint_0xcd() {
%1 = call i64 @isprint(i32 205)
%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 1030, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xcd\00"
define void @t_isprint_0xcd() {
%1 = tail call i64 @isprint(i32 205)
%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 1030, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void module_bug_cleanup(struct module *mod) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @module_bug_cleanup(%struct.module* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltr_int_finish_usb(int /*<<< orphan*/);
int /*<<< orphan*/ ltr_int_log_message(char *);
int /*<<< orphan*/ stop_camera_tir();
bool close_camera_tir4() {
  ltr_int_log_message("Closing the TIR4 camera.\n");
  stop_camera_tir();
  ltr_int_finish_usb(0);
  ltr_int_log_message("TIR4 camera closed.\n");
  return true;
}


x86 assembly (clang, -O0):
<close_camera_tir4>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
mov    $0x0,%al
call   1030 <stop_camera_tir@plt>
xor    %edi,%edi
call   1050 <ltr_int_finish_usb@plt>
lea    0xec5(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_camera_tir4>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
xor    %eax,%eax
call   1030 <stop_camera_tir@plt>
xor    %edi,%edi
call   1050 <ltr_int_finish_usb@plt>
lea    0xec8(%rip),%rdi
call   1040 <ltr_int_log_message@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Closing the TIR4 camera.\0A\00"
@.str.1 = [21 x i8] c"TIR4 camera closed.\0A\00"
define i32 @close_camera_tir4() {
%1 = call i32 @ltr_int_log_message(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @stop_camera_tir()
%3 = call i32 @ltr_int_finish_usb(i32 0)
%4 = call i32 @ltr_int_log_message(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [26 x i8] c"Closing the TIR4 camera.\0A\00"
@.str.1 = [21 x i8] c"TIR4 camera closed.\0A\00"
define i32 @close_camera_tir4() {
%1 = tail call i32 @ltr_int_log_message(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @stop_camera_tir()
%3 = tail call i32 @ltr_int_finish_usb(i32 0)
%4 = tail call i32 @ltr_int_log_message(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
int /*<<< orphan*/ fuu();
main() {
  fuu();
omg:
  echo("yo");
  if (1)
    goto omg;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fuu@plt>
lea    0xec3(%rip),%rdi
call   1030 <echo@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <fuu@plt>
lea    0xed1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <echo@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"yo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fuu()
br label %3
3: ; preds = %3, %0
%4 = call i32 @echo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"yo\00"
define i32 @main() {
%1 = tail call i32 (...) @fuu()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @echo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int **, int);
int main() {
  int int1 = 32;
  int *x = &int1;
  printf("%p d degeri => %d\n", &x, *x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x20,0xc(%rsp)
lea    0xc(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x20,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%p d degeri => %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 32, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32** %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%p d degeri => %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 32, i32* %1
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32** %2, i32 32)
ret i32 0
}
/* Type definitions */
struct source_data_str {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct source_data_str *);
void source_data_str_destroy(void *data) {
  struct source_data_str *data_str;
  if (data == NULL)
    return;
  data_str = (struct source_data_str *)data;
  free(data_str);
  data_str = NULL;
}


x86 assembly (clang, -O0):
<source_data_str_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <source_data_str_destroy+0x1c>
jmp    1145 <source_data_str_destroy+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.source_data_str = type { i32 }
define void @source_data_str_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.source_data_str*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to %struct.source_data_str*
store %struct.source_data_str* %9, %struct.source_data_str** %3
%10 = load %struct.source_data_str*, %struct.source_data_str** %3
%11 = call i32 @free(%struct.source_data_str* %10)
store %struct.source_data_str* null, %struct.source_data_str** %3
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.source_data_str = type { i32 }
define void @source_data_str_destroy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to %struct.source_data_str*
%5 = tail call i32 @free(%struct.source_data_str* %4)
br label %6
6: ; preds = %1, %3
ret void
}
void wifi_evt_sme_wps_failed(const struct wifi_msg_sme_wps_failed_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_wps_failed_evt_t = type opaque
define void @wifi_evt_sme_wps_failed(%struct.wifi_msg_sme_wps_failed_evt_t* nocapture %0) {
ret void
}
char GetEncoding2() { return 0x00; }


x86 assembly (clang, -O0):
<GetEncoding2>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @GetEncoding2() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @GetEncoding2() {
ret i8 0
}
int ehnlc_iscntrl(int c) { return ((c >= 0 && c <= 31) || (c == 127)) ? 2 : 0; }


x86 assembly (clang, -O0):
<ehnlc_iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <ehnlc_iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <ehnlc_iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x2,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ehnlc_iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 2, i32 0
ret i32 %14
}

LLVM IR (-O2):
define i32 @ehnlc_iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = select i1 %4, i32 2, i32 0
ret i32 %5
}