xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
main() {
  int a[] = {1, 1, 2, 2, 4};
  int i = 0;
  a[i++] = a[++i] + i;
  printf("%d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cltq
mov    -0x20(%rbp,%rax,4),%ecx
add    -0x24(%rbp),%ecx
mov    -0x24(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
cltq
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
mov    $0x4,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 1, i32 2, i32 2, i32 4]
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = bitcast [5 x i32]* %1 to i8*
store i32 0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %13
store i32 %10, i32* %14
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%16 = load i32, i32* %15
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%18 = load i32, i32* %17
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%20 = load i32, i32* %19
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%22 = load i32, i32* %21
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18, i32 %20, i32 %22, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 2, i32 2, i32 4)
ret i32 0
}
void glIsRenderbuffer(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *fileName) {
  FILE *fp;
  if (fp = fopen(fileName, "r")) {
    fclose(fp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <file_exists+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <file_exists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %4
%10 = call i32 @fclose(i32* %9)
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
float soma(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @soma(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @soma(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ *s6_addr32;
};

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
int /*<<< orphan*/ ipv6_addr_set(struct in6_addr *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void ipv6_addr_llocal(const struct in6_addr *addr, struct in6_addr *llocal) {
  ipv6_addr_set(llocal, htonl(0xFE800000), 0, addr->s6_addr32[2],
                addr->s6_addr32[3]);
}


x86 assembly (clang, -O0):
<ipv6_addr_llocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0xfe800000,%edi
call   1030 <htonl@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0xc(%rax),%r8d
xor    %edx,%edx
call   1040 <ipv6_addr_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_llocal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xfe800000,%edi
call   1030 <htonl@plt>
mov    (%rbx),%rdx
mov    0x8(%rdx),%ecx
mov    0xc(%rdx),%r8d
mov    %r14,%rdi
mov    %eax,%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ipv6_addr_set@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32* }
define void @ipv6_addr_llocal(%struct.in6_addr* %0, %struct.in6_addr* %1) {
%3 = alloca %struct.in6_addr*
%4 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %3
store %struct.in6_addr* %1, %struct.in6_addr** %4
%5 = load %struct.in6_addr*, %struct.in6_addr** %4
%6 = call i32 @htonl(i32 -25165824)
%7 = load %struct.in6_addr*, %struct.in6_addr** %3
%8 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %7, i32 0, i32 0
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load %struct.in6_addr*, %struct.in6_addr** %3
%13 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %12, i32 0, i32 0
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load i32, i32* %15
%17 = call i32 @ipv6_addr_set(%struct.in6_addr* %5, i32 %6, i32 0, i32 %11, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.in6_addr = type { i32* }
define void @ipv6_addr_llocal(%struct.in6_addr* nocapture %0, %struct.in6_addr* %1) {
%3 = tail call i32 @htonl(i32 -25165824)
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %5, i64 3
%9 = load i32, i32* %8
%10 = tail call i32 @ipv6_addr_set(%struct.in6_addr* %1, i32 %3, i32 0, i32 %7, i32 %9)
ret void
}
int fun1189() { return 1189; }


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

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

LLVM IR (-O0):
define i32 @fun1189() {
ret i32 1189
}

LLVM IR (-O2):
define i32 @fun1189() {
ret i32 1189
}
/* Variables and functions */
int /*<<< orphan*/ orderings(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *);
int /*<<< orphan*/ system(char *);
int main() {
  unsigned int n, k;
  printf("Give the number of elements in the set and it's subsets: ");
  scanf("%u%u", &n, &k);
  orderings(n, k);
  system("PAUSE");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <orderings@plt>
lea    0xecb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Give the number of elements in the set and it's subsets: \00"
@.str.1 = [5 x i8] c"%u%u\00"
@.str.2 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @orderings(i32 %6, i32 %7)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"Give the number of elements in the set and it's subsets: \00"
@.str.1 = [5 x i8] c"%u%u\00"
@.str.2 = [6 x i8] c"PAUSE\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 @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @orderings(i32 %7, i32 %8)
%10 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_version(void) {
  printf("sordi "
         "0.12.2"
         " <http://drobilla.net/software/sord>\n");
  printf("Copyright 2011-2013 David Robillard <http://drobilla.net>.\n"
         "License: <http://www.opensource.org/licenses/isc>\n"
         "This is free software; you are free to change and redistribute it."
         "\nThere is NO WARRANTY, to the extent permitted by law.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"sordi 0.12.2 <http://drobilla.net/software/sord>\0A\00"
@.str.1 = [231 x i8] c"Copyright 2011-2013 David Robillard <http://drobilla.net>.\0ALicense: <http://www.opensource.org/licenses/isc>\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define i32 @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [49 x i8] c"sordi 0.12.2 <http://drobilla.net/software/sord>\00"
@str.2 = [230 x i8] c"Copyright 2011-2013 David Robillard <http://drobilla.net>.\0ALicense: <http://www.opensource.org/licenses/isc>\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define i32 @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([230 x i8], [230 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void cpg_mstp_add_clk_domain(struct device_node *np) {}


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define void @cpg_mstp_add_clk_domain(%struct.device_node* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xa4() {
  Assert_real((isdigit(164) == 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_isdigit.c",
              825, ("isdigit should be 0 for 0xa4"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xa4>:
push   %rax
mov    $0xa4,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x339,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa4\00"
define void @t_isdigit_0xa4() {
%1 = call i64 @isdigit(i32 164)
%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 825, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa4\00"
define void @t_isdigit_0xa4() {
%1 = tail call i64 @isdigit(i32 164)
%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 825, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void file_logger_log_message(FILE *fd, char *message) {
  fprintf(fd, "%s\n", message);
}


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

x86 assembly (clang, -O2):
<file_logger_log_message>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @file_logger_log_message(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ deleteAttr(char *, char *);
int listattr_numattr();
int /*<<< orphan*/ setattr_testattr();
ssize_t setattr_create() {
  setattr_testattr();
  if (listattr_numattr() != 1) {
    return EXIT_FAILURE;
  }
  deleteAttr("testFile", "ctest_testing");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<setattr_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <setattr_testattr@plt>
mov    $0x0,%al
call   1050 <listattr_numattr@plt>
cmp    $0x1,%eax
je     1160 <setattr_create+0x30>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <setattr_create+0x4f>
lea    0xe99(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <deleteAttr@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setattr_create>:
push   %rax
xor    %eax,%eax
call   1040 <setattr_testattr@plt>
xor    %eax,%eax
call   1050 <listattr_numattr@plt>
cmp    $0x1,%eax
jne    1160 <setattr_create+0x30>
lea    0xeb5(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <deleteAttr@plt>
mov    0x2e7a(%rip),%rax
jmp    1167 <setattr_create+0x37>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [9 x i8] c"testFile\00"
@.str.1 = [14 x i8] c"ctest_testing\00"
@EXIT_SUCCESS = global i32 0
define i32 @setattr_create() {
%1 = alloca i32
%2 = call i32 (...) @setattr_testattr()
%3 = call i32 (...) @listattr_numattr()
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
store i32 %6, i32* %1
br label %10
7: ; preds = %0
%8 = call i32 @deleteAttr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [9 x i8] c"testFile\00"
@.str.1 = [14 x i8] c"ctest_testing\00"
@EXIT_SUCCESS = global i32 0
define i32 @setattr_create() {
%1 = tail call i32 (...) @setattr_testattr()
%2 = tail call i32 (...) @listattr_numattr()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @deleteAttr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
%7 = phi i32* [ @EXIT_SUCCESS, %4 ], [ @EXIT_FAILURE, %0 ]
%8 = load i32, i32* %7
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;
struct ether_addr {
  scalar_t__ *ether_addr_octet;
};

/* Variables and functions */
uint64_t macAddrToUint64(struct ether_addr *srcMacAddr) {
  uint64_t macAddrQWORD;
  int mac;
  macAddrQWORD = 0;
  for (mac = 0; mac < 6; mac++) {
    macAddrQWORD |= ((uint64_t)(srcMacAddr->ether_addr_octet[6 - 1 - mac]))
                    << (8 * mac);
  }
  return (macAddrQWORD);
}


x86 assembly (clang, -O0):
<macAddrToUint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1152 <macAddrToUint64+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x5,%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <macAddrToUint64+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ether_addr = type { i64* }
define i32 @macAddrToUint64(%struct.ether_addr* %0) {
%2 = alloca %struct.ether_addr*
%3 = alloca i32
%4 = alloca i32
store %struct.ether_addr* %0, %struct.ether_addr** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load %struct.ether_addr*, %struct.ether_addr** %2
%10 = getelementptr inbounds %struct.ether_addr, %struct.ether_addr* %9, i32 0, i32 0
%11 = load i64*, i64** %10
%12 = load i32, i32* %4
%13 = sub nsw i32 5, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = load i32, i32* %4
%19 = mul nsw i32 8, %18
%20 = shl i32 %17, %19
%21 = load i32, i32* %3
%22 = or i32 %21, %20
store i32 %22, i32* %3
br label %23
23: ; preds = %8
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
%struct.ether_addr = type { i64* }
define i32 @macAddrToUint64(%struct.ether_addr* nocapture %0) {
ret i32 poison
}
void fly_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @fly_terminate() {
ret void
}
int printf(const char *format __attribute__((unused)), ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  struct POINT {
    int x;
    int y;
  } a, b;
  a.x = 10;
  a.y = 20;
  b.x = 30;
  b.y = 40;
  a = b;
  printf("a.x = %d, a.y = %d\n", a.x, a.y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0x4(%rbp)
movl   $0x1e,-0x10(%rbp)
movl   $0x28,-0xc(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1e,%esi
mov    $0x28,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.POINT = type { i32, i32 }
@.str = [20 x i8] c"a.x = %d, a.y = %d\0A\00"
define i32 @main() {
%1 = alloca %struct.POINT
%2 = alloca %struct.POINT
%3 = getelementptr inbounds %struct.POINT, %struct.POINT* %1, i32 0, i32 0
store i32 10, i32* %3
%4 = getelementptr inbounds %struct.POINT, %struct.POINT* %1, i32 0, i32 1
store i32 20, i32* %4
%5 = getelementptr inbounds %struct.POINT, %struct.POINT* %2, i32 0, i32 0
store i32 30, i32* %5
%6 = getelementptr inbounds %struct.POINT, %struct.POINT* %2, i32 0, i32 1
store i32 40, i32* %6
%7 = bitcast %struct.POINT* %1 to i8*
%8 = bitcast %struct.POINT* %2 to i8*
%9 = getelementptr inbounds %struct.POINT, %struct.POINT* %1, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.POINT, %struct.POINT* %1, i32 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"a.x = %d, a.y = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 30, i32 40)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t ustime(void) {
  struct timeval tv;
  uint64_t ust;
  gettimeofday(&tv, NULL);
  ust = ((uint64_t)tv.tv_sec) * 1000000;
  ust += tv.tv_usec;
  return ust;
}


x86 assembly (clang, -O0):
<ustime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movabs $0xf424000000000,%rax
imul   0x10(%rsp),%rax
shr    $0x20,%rax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @ustime() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @ustime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %5, 4294967296000000
%9 = lshr exact i64 %8, 32
%10 = add i64 %9, %7
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_regex_version(void) {
  setvar(cintern("*regex-version*"),
         cintern("$Id: regex.c,v 1.1.1.1 2003/01/15 23:55:08 ulric Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_regex_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed2(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_regex_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*regex-version*\00"
@.str.1 = [55 x i8] c"$Id: regex.c,v 1.1.1.1 2003/01/15 23:55:08 ulric Exp $\00"
define void @init_regex_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [16 x i8] c"*regex-version*\00"
@.str.1 = [55 x i8] c"$Id: regex.c,v 1.1.1.1 2003/01/15 23:55:08 ulric Exp $\00"
define void @init_regex_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __glutFatalError(char *);
int /*<<< orphan*/ __glutWarning(char *);
void __glutMenuModificationError(void) {
  __glutWarning("The following is a new check for GLUT 3.0; update your code.");
  __glutFatalError("menu manipulation not allowed while menus in use.");
}


x86 assembly (clang, -O0):
<__glutMenuModificationError>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <__glutWarning@plt>
lea    0xf06(%rip),%rdi
call   1030 <__glutFatalError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glutMenuModificationError>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <__glutWarning@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <__glutFatalError@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"The following is a new check for GLUT 3.0; update your code.\00"
@.str.1 = [50 x i8] c"menu manipulation not allowed while menus in use.\00"
define void @__glutMenuModificationError() {
%1 = call i32 @__glutWarning(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @__glutFatalError(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"The following is a new check for GLUT 3.0; update your code.\00"
@.str.1 = [50 x i8] c"menu manipulation not allowed while menus in use.\00"
define void @__glutMenuModificationError() {
%1 = tail call i32 @__glutWarning(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @__glutFatalError(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int hash_djb2(const char *str) {
  unsigned int h = 5381;
  const char *p = str;
  while (*p != '\0')
    h = ((h << 5) + h) + (*p++);
  return h;
}


x86 assembly (clang, -O0):
<hash_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <hash_djb2+0x4c>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash_djb2+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_djb2+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_djb2+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_djb2(i8* nocapture %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 i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ CE(int /*<<< orphan*/);
int /*<<< orphan*/ p24stop();
void p24init(void) {
  p24stop();
  CE(0);
}


x86 assembly (clang, -O0):
<p24init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <p24stop@plt>
xor    %edi,%edi
call   1030 <CE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p24init>:
push   %rax
xor    %eax,%eax
call   1040 <p24stop@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <CE@plt>

LLVM IR (-O0):
define void @p24init() {
%1 = call i32 (...) @p24stop()
%2 = call i32 @CE(i32 0)
ret void
}

LLVM IR (-O2):
define void @p24init() {
%1 = tail call i32 (...) @p24stop()
%2 = tail call i32 @CE(i32 0)
ret void
}
int grcfil(fd)
int *fd;
{
  if ((*fd) == 1) {
    return 0;
  } else {
    return close(*fd);
  }
}


x86 assembly (clang, -O0):
<grcfil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1135 <grcfil+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1145 <grcfil+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grcfil>:
mov    (%rdi),%edi
cmp    $0x1,%edi
jne    111a <grcfil+0xa>
xor    %eax,%eax
ret
xor    %eax,%eax
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @grcfil(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
int test_imm_3Cint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x3C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Cint64_midword_mem>:
testb  $0x3c,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Cint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3932160
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void Call_C_Start(char *fct_name, int fc, int nb_args, int nb_args_in_words,
                  char **p_) {}


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

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

LLVM IR (-O0):
define void @Call_C_Start(i8* %0, i32 %1, i32 %2, i32 %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
ret void
}

LLVM IR (-O2):
define void @Call_C_Start(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i8** nocapture %4) {
ret void
}
void set_result(unsigned char *res) {}


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

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

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

LLVM IR (-O2):
define void @set_result(i8* nocapture %0) {
ret void
}
q(a, b) int a;
{}


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

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

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

LLVM IR (-O2):
define i32 @q(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int lock_me_to_cpu(int /*<<< orphan*/);
int enter_UP_mode(void) { return lock_me_to_cpu(0); }


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

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

LLVM IR (-O0):
define i32 @enter_UP_mode() {
%1 = call i32 @lock_me_to_cpu(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @enter_UP_mode() {
%1 = tail call i32 @lock_me_to_cpu(i32 0)
ret i32 %1
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
int priv_vm_mlock_setup(int asroot, int injail, struct test *test) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.test = type { i32 }
define i32 @priv_vm_mlock_setup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret i32 0
}

LLVM IR (-O2):
%struct.test = type { i32 }
define i32 @priv_vm_mlock_setup(i32 %0, i32 %1, %struct.test* nocapture readnone %2) {
ret i32 0
}
int fs_get_filesize(int fildes) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fs_get_filesize(i32 %0) {
ret i32 -1
}
int test_imm_E9uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E9uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff17,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E9uint8_mem>:
testb  $0x17,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 23
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long glongxor(long x, long y) {
  x ^= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<glongxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <glongxor+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glongxor>:
push   %rbx
mov    %rdi,%rbx
xor    %rsi,%rbx
jne    1120 <glongxor+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @glongxor(i64 %0, i64 %1) {
%3 = xor i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ chk_curs_draw();
void curs_attron(long at) {
  if (!chk_curs_draw())
    return;
}


x86 assembly (clang, -O0):
<curs_attron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <chk_curs_draw@plt>
cmp    $0x0,%eax
jne    1131 <curs_attron+0x21>
jmp    1131 <curs_attron+0x21>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @curs_attron(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @chk_curs_draw()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @curs_attron(i64 %0) {
%2 = tail call i32 (...) @chk_curs_draw()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int vc4_isopcode(char ch) {
  return strchr("01?!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                ch) != NULL;
}


x86 assembly (clang, -O0):
<vc4_isopcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vc4_isopcode>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"01?!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @vc4_isopcode(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @strchr(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [57 x i8] c"01?!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @vc4_isopcode(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
int tls13_client_hello_retry_recv(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_hello_retry_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
int *dynamic_configuration_watch_routine_running() {
  static int running = 1;
  return &running;
}


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

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

LLVM IR (-O0):
@dynamic_configuration_watch_routine_running.running = internal global i32 1
define i32* @dynamic_configuration_watch_routine_running() {
ret i32* @dynamic_configuration_watch_routine_running.running
}

LLVM IR (-O2):
@dynamic_configuration_watch_routine_running.running = internal global i32 1
define i32* @dynamic_configuration_watch_routine_running() {
ret i32* @dynamic_configuration_watch_routine_running.running
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int *arr, int size) {
  int i;
  for (i = 0; i < size; ++i)
    printf("%d ", arr[i]);
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}