xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t convert_byte_array_to_32_bit(uint8_t *data) {
  union {
    uint32_t u32;
    uint8_t u8[4];
  } long_addr;
  uint8_t index;
  for (index = 0; index < 4; index++) {
    long_addr.u8[index] = *data++;
  }
  return long_addr.u32;
}


x86 assembly (clang, -O0):
<convert_byte_array_to_32_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1140 <convert_byte_array_to_32_bit+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%ecx
movslq -0x1c(%rbp),%rax
mov    %ecx,-0x18(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    110f <convert_byte_array_to_32_bit+0xf>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
define i32 @convert_byte_array_to_32_bit(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %2
%11 = load i32, i32* %9
%12 = bitcast %union.anon* %3 to [4 x i32]*
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = bitcast %union.anon* %3 to i32*
%21 = load i32, i32* %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @convert_byte_array_to_32_bit(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error_msg(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void perror_msg(const char *prefix) {
  error_msg("%s: %s", prefix, strerror(errno));
}


x86 assembly (clang, -O0):
<perror_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
call   1030 <error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror_msg>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <error_msg@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @perror_msg(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @error_msg(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
int msm_hsusb_vbus_powerup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_hsusb_vbus_powerup() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t gmtime2bjtime(uint64_t ts) { return ts + 28800; }


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

x86 assembly (clang, -O2):
<gmtime2bjtime>:
lea    0x7080(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @gmtime2bjtime(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 28800
ret i64 %4
}

LLVM IR (-O2):
define i64 @gmtime2bjtime(i64 %0) {
%2 = add nsw i64 %0, 28800
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x7a() {
  Assert_real((isxdigit(122) == 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_isxdigit.c",
              615, ("isxdigit should be 0 for z"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x7a>:
push   %rax
mov    $0x7a,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x267,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for z\00"
define void @t_isxdigit_0x7a() {
%1 = call i64 @isxdigit(i32 122)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for z\00"
define void @t_isxdigit_0x7a() {
%1 = tail call i64 @isxdigit(i32 122)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a() { printf("Found a\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Found a\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int R3InitGlut(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @R3InitGlut() {
ret i32 1
}

LLVM IR (-O2):
define i32 @R3InitGlut() {
ret i32 1
}
int fun224() { return 224; }


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

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

LLVM IR (-O0):
define i32 @fun224() {
ret i32 224
}

LLVM IR (-O2):
define i32 @fun224() {
ret i32 224
}
int lxc_caps_check(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @lxc_caps_check() {
ret i32 1
}

LLVM IR (-O2):
define i32 @lxc_caps_check() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sqrt(double);
int perfect_square(uint32_t n) {
  uint32_t tmp = (uint32_t)sqrt((double)n);
  return ((tmp * tmp) == n);
}


x86 assembly (clang, -O0):
<perfect_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfect_square>:
push   %rbx
mov    %edi,%ebx
cvtsi2sd %edi,%xmm0
call   1030 <sqrt@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @perfect_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call i32 @sqrt(double %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %2
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @perfect_square(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i32 @sqrt(double %2)
%4 = mul nsw i32 %3, %3
%5 = icmp eq i32 %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  printf("%d %d %d\n", 1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
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    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(int);
int is_idsym(int c) {
  if (isalnum(c))
    return 1;
  if (c == '_')
    return 1;
  if (c == '$')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_idsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     1139 <is_idsym+0x29>
movl   $0x1,-0x4(%rbp)
jmp    116c <is_idsym+0x5c>
cmpl   $0x5f,-0x8(%rbp)
jne    114f <is_idsym+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    116c <is_idsym+0x5c>
cmpl   $0x24,-0x8(%rbp)
jne    1165 <is_idsym+0x55>
movl   $0x1,-0x4(%rbp)
jmp    116c <is_idsym+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_idsym>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
cmp    $0x24,%ebx
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_idsym(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = icmp eq i32 %0, 36
%6 = or i1 %4, %5
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __cut_assert(char *, int, char *, char *, int);
int sum(int, int);
void __CUT__Sum(void) {
  __cut_assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/AskDrCatcher/cut-2.4/refs/"
               "heads/master/examples/TestCompute.c",
               7, "Check sum", "sum(1, 2) == 3", sum(1, 2) == 3);
}


x86 assembly (clang, -O0):
<__CUT__Sum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%r8d
lea    0xeba(%rip),%rdi
mov    $0x7,%esi
lea    0xf46(%rip),%rdx
lea    0xf49(%rip),%rcx
call   1040 <__cut_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__CUT__Sum>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %r8d,%r8d
cmp    $0x3,%eax
sete   %r8b
lea    0xebf(%rip),%rdi
lea    0xf50(%rip),%rdx
lea    0xf53(%rip),%rcx
mov    $0x7,%esi
pop    %rax
jmp    1040 <__cut_assert@plt>

LLVM IR (-O0):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AskDrCatcher/cut-2.4/refs/heads/master/examples/TestCompute.c\00"
@.str.1 = [10 x i8] c"Check sum\00"
@.str.2 = [15 x i8] c"sum(1, 2) == 3\00"
define void @__CUT__Sum() {
%1 = call i32 @sum(i32 1, i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @__cut_assert(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AskDrCatcher/cut-2.4/refs/heads/master/examples/TestCompute.c\00"
@.str.1 = [10 x i8] c"Check sum\00"
@.str.2 = [15 x i8] c"sum(1, 2) == 3\00"
define void @__CUT__Sum() {
%1 = tail call i32 @sum(i32 1, i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @__cut_assert(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
char toupper(int /*<<< orphan*/);
void strToUpper(char *s) {
  char *p = s;
  ;
  if (s == NULL) {
    return;
  }
  while ((*p++ = toupper(*s++)) != '\0') {
  }
}


x86 assembly (clang, -O0):
<strToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <strToUpper+0x24>
jmp    1172 <strToUpper+0x62>
jmp    1139 <strToUpper+0x29>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1172 <strToUpper+0x62>
jmp    1139 <strToUpper+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strToUpper>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1135 <strToUpper+0x25>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
mov    %r14,%rbx
test   %al,%al
jne    1120 <strToUpper+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strToUpper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = tail call signext i8 @toupper(i32 %7)
store i8 %8, i8* %4
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
ret void
}
/* Variables and functions */
double errcheck(int /*<<< orphan*/, char *);
int /*<<< orphan*/ log10(double);
double Log10(double x) { return errcheck(log10(x), "log10"); }


x86 assembly (clang, -O0):
<Log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
call   1030 <errcheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log10>:
push   %rax
call   1040 <log10@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errcheck@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"log10\00"
define double @Log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log10(double %3)
%5 = call double @errcheck(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret double %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"log10\00"
define double @Log10(double %0) {
%2 = tail call i32 @log10(double %0)
%3 = tail call double @errcheck(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ setenv(char *, char *, int);
int main() {
  setenv("Hu", "Ha", 1);
  exit(0x0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"Hu\00"
@.str.1 = [3 x i8] c"Ha\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"Hu\00"
@.str.1 = [3 x i8] c"Ha\00"
define i32 @main() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void add(struct DynArr *stack) {}


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

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

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

LLVM IR (-O2):
%struct.DynArr = type opaque
define void @add(%struct.DynArr* nocapture %0) {
ret void
}
int fun299() { return 299; }


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

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

LLVM IR (-O0):
define i32 @fun299() {
ret i32 299
}

LLVM IR (-O2):
define i32 @fun299() {
ret i32 299
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("in source_2\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"in source_2\0A\00"
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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"in source_2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int imodulo(int v1, int v2) {
  int v = v1 % v2;
  return (v >= 0) ? v : v + v2;
}


x86 assembly (clang, -O0):
<imodulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1129 <imodulo+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <imodulo+0x32>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imodulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @imodulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
__attribute__((no)) int baz(int a, int b) { return a - b + a * b; }


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

x86 assembly (clang, -O2):
<baz>:
mov    %edi,%eax
sub    %esi,%eax
imul   %edi,%esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @baz(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 = sub nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) {
  say("It's a well.  People tend to get water and such from it.", 1);
}


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"It's a well. People tend to get water and such from it.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"It's a well. People tend to get water and such from it.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *mem = malloc(100);
  mem = "Hello\n";
  printf("%s", mem);
  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    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xeb5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_heap();
int /*<<< orphan*/ test_split_line_weight();
int /*<<< orphan*/ test_split_line_weightless();
void test_utils() {
  printf("Utils test\n");
  test_split_line_weightless();
  test_split_line_weight();
  test_heap();
  printf("End Utils test\n");
}


x86 assembly (clang, -O0):
<test_utils>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_split_line_weightless@plt>
mov    $0x0,%al
call   1050 <test_split_line_weight@plt>
mov    $0x0,%al
call   1060 <test_heap@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_utils>:
push   %rax
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_split_line_weightless@plt>
xor    %eax,%eax
call   1050 <test_split_line_weight@plt>
xor    %eax,%eax
call   1060 <test_heap@plt>
lea    0xe97(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Utils test\0A\00"
@.str.1 = [16 x i8] c"End Utils test\0A\00"
define void @test_utils() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_split_line_weightless()
%3 = call i32 (...) @test_split_line_weight()
%4 = call i32 (...) @test_heap()
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Utils test\00"
@str.2 = [15 x i8] c"End Utils test\00"
define void @test_utils() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_split_line_weightless()
%3 = tail call i32 (...) @test_split_line_weight()
%4 = tail call i32 (...) @test_heap()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __uClibc_main(unsigned int, char **, char **);
void _uClibc_start(unsigned int first_arg) {
  unsigned int argc;
  char **argv, **envp;
  unsigned long *stack;
  stack = (unsigned long *)first_arg;
  argc = *(stack);
  argv = (char **)(stack + 1);
  envp = (char **)(stack + 1 + argc + 1);
  __uClibc_main(argc, argv, envp);
}


x86 assembly (clang, -O0):
<_uClibc_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    -0x8(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__uClibc_main@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uClibc_start>:
mov    %edi,%esi
mov    (%rsi),%rdi
mov    %edi,%eax
lea    (%rsi,%rax,8),%rdx
add    $0x10,%rdx
add    $0x8,%rsi
jmp    1030 <__uClibc_main@plt>

LLVM IR (-O0):
define void @_uClibc_start(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i64*
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
store i64* %9, i64** %6
%10 = load i64*, i64** %6
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
%13 = load i64*, i64** %6
%14 = getelementptr inbounds i64, i64* %13, i64 1
%15 = bitcast i64* %14 to i8**
store i8** %15, i8*** %4
%16 = load i64*, i64** %6
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i32, i32* %3
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i64, i64* %17, i64 %19
%21 = getelementptr inbounds i64, i64* %20, i64 1
%22 = bitcast i64* %21 to i8**
store i8** %22, i8*** %5
%23 = load i32, i32* %3
%24 = load i8**, i8*** %4
%25 = load i8**, i8*** %5
%26 = call i32 @__uClibc_main(i32 %23, i8** %24, i8** %25)
ret void
}

LLVM IR (-O2):
define void @_uClibc_start(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i64*
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds i64, i64* %3, i64 1
%7 = bitcast i64* %6 to i8**
%8 = and i64 %4, 4294967295
%9 = getelementptr inbounds i64, i64* %6, i64 %8
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = bitcast i64* %10 to i8**
%12 = tail call i32 @__uClibc_main(i32 %5, i8** %7, i8** %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cJSON_free(char *);
void cJSON_FreePrint(char *p) {
  if (p)
    cJSON_free(p);
}


x86 assembly (clang, -O0):
<cJSON_FreePrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <cJSON_FreePrint+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <cJSON_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cJSON_FreePrint(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cJSON_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
double pow(double, int);
double fn(double x) { return pow(x, 3) - x - 2; }


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
subsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
subsd  (%rsp),%xmm0
addsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, i32 3)
%5 = load double, double* %2
%6 = fsub double %4, %5
%7 = fsub double %6, 2.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @fn(double %0) {
%2 = tail call double @pow(double %0, i32 3)
%3 = fsub double %2, %0
%4 = fadd double %3, -2.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long labs(long x) { abort(); }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<labs>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int devnode_acl(const char *path, bool flush, bool del, uid_t old_uid, bool add,
                uid_t new_uid) {
  return 0;
}


x86 assembly (clang, -O0):
<devnode_acl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @devnode_acl(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ __useconds_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ timeval_diff(struct timeval *, struct timeval *,
                                struct timeval *);
__useconds_t get_timeval_passed(struct timeval *since, struct timeval *diff) {
  struct timeval now;
  gettimeofday(&now, NULL);
  return timeval_diff(&now, since, diff);
}


x86 assembly (clang, -O0):
<get_timeval_passed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1040 <timeval_diff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timeval_passed>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <timeval_diff@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_timeval_passed(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = call i32 @timeval_diff(%struct.timeval* %3, %struct.timeval* %0, %struct.timeval* %1)
ret i32 %6
}
int Parrot_dlclose(void *handle) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @Parrot_dlclose(i8* nocapture readnone %0) {
ret i32 -1
}
int test_imm_7Duint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x7D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Duint64_midword_reg>:
test   $0x7d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Duint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8192000
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int S_API(void) { return 32; }


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

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

LLVM IR (-O0):
define i32 @S_API() {
ret i32 32
}

LLVM IR (-O2):
define i32 @S_API() {
ret i32 32
}
__attribute__((always_)) void paravirt_alloc_ldt(struct desc_struct *ldt,
                                                 unsigned entries) {}


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

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

LLVM IR (-O0):
%struct.desc_struct = type opaque
define void @paravirt_alloc_ldt(%struct.desc_struct* %0, i32 %1) {
%3 = alloca %struct.desc_struct*
%4 = alloca i32
store %struct.desc_struct* %0, %struct.desc_struct** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.desc_struct = type opaque
define void @paravirt_alloc_ldt(%struct.desc_struct* nocapture %0, i32 %1) {
ret void
}
unsigned int hweight16(unsigned int w) {
  unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555);
  res = (res & 0x3333) + ((res >> 2) & 0x3333);
  res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F);
  return (res & 0x00FF) + ((res >> 8) & 0x00FF);
}


x86 assembly (clang, -O0):
<hweight16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x5555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x5555,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3333,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0f,%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight16>:
mov    %edi,%eax
and    $0x5555,%eax
shr    %edi
and    $0x5555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x3333,%ecx
shr    $0x2,%eax
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x707,%ecx
shr    $0x4,%eax
and    $0x707,%eax
add    %ecx,%eax
movzbl %al,%ecx
shr    $0x8,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 21845
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 21845
%9 = add i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 13107
%12 = load i32, i32* %3
%13 = lshr i32 %12, 2
%14 = and i32 %13, 13107
%15 = add i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = and i32 %16, 3855
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = and i32 %19, 3855
%21 = add i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = and i32 %22, 255
%24 = load i32, i32* %3
%25 = lshr i32 %24, 8
%26 = and i32 %25, 255
%27 = add i32 %23, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @hweight16(i32 %0) {
%2 = and i32 %0, 21845
%3 = lshr i32 %0, 1
%4 = and i32 %3, 21845
%5 = add nuw nsw i32 %4, %2
%6 = and i32 %5, 13107
%7 = lshr i32 %5, 2
%8 = and i32 %7, 13107
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 1799
%11 = lshr i32 %9, 4
%12 = and i32 %11, 1799
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 15
%15 = lshr i32 %13, 8
%16 = add nuw nsw i32 %14, %15
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ unix_error(char *);
void Sigfillset(sigset_t *set) {
  if (sigfillset(set) < 0)
    unix_error("Sigfillset error");
  return;
}


x86 assembly (clang, -O0):
<Sigfillset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sigfillset@plt>
cmp    $0x0,%rax
jge    114b <Sigfillset+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigfillset>:
push   %rax
call   1030 <sigfillset@plt>
test   %rax,%rax
js     112d <Sigfillset+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Sigfillset error\00"
define void @Sigfillset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @sigfillset(i32* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @unix_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Sigfillset error\00"
define void @Sigfillset(i32* %0) {
%2 = tail call i64 @sigfillset(i32* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void proc32() {}


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

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

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

LLVM IR (-O2):
define void @proc32() {
ret void
}
/* Type definitions */
struct s_virtserv_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int const);
int virtservDecodeEcho(struct s_virtserv_state *virtserv, unsigned char *outbuf,
                       const int outbuf_len, const unsigned char *inbuf,
                       const int inbuf_len) {
  if (inbuf_len <= outbuf_len) {
    memcpy(outbuf, inbuf, inbuf_len);
    return inbuf_len;
  }
  return 0;
}


x86 assembly (clang, -O0):
<virtservDecodeEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1152 <virtservDecodeEcho+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <virtservDecodeEcho+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<virtservDecodeEcho>:
xor    %eax,%eax
cmp    %edx,%r8d
jg     112c <virtservDecodeEcho+0x1c>
push   %rbx
mov    %r8d,%ebx
mov    %rsi,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.s_virtserv_state = type { i32 }
define i32 @virtservDecodeEcho(%struct.s_virtserv_state* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca %struct.s_virtserv_state*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store %struct.s_virtserv_state* %0, %struct.s_virtserv_state** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%12 = load i32, i32* %11
%13 = load i32, i32* %9
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %5
%16 = load i8*, i8** %8
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
%20 = load i32, i32* %11
store i32 %20, i32* %6
br label %22
21: ; preds = %5
store i32 0, i32* %6
br label %22
22: ; preds = %21, %15
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
%struct.s_virtserv_state = type { i32 }
define i32 @virtservDecodeEcho(%struct.s_virtserv_state* nocapture readnone %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp sgt i32 %4, %2
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @memcpy(i8* %1, i8* %3, i32 %4)
br label %9
9: ; preds = %5, %7
%10 = phi i32 [ %4, %7 ], [ 0, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hfuzz_trace_cmp4_internal(uintptr_t, int /*<<< orphan*/,
                                             int /*<<< orphan*/);
void hfuzz_trace_cmp4(uintptr_t pc, uint32_t Arg1, uint32_t Arg2) {
  hfuzz_trace_cmp4_internal(pc, Arg1, Arg2);
}


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

x86 assembly (clang, -O2):
<hfuzz_trace_cmp4>:
jmp    1030 <hfuzz_trace_cmp4_internal@plt>

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

LLVM IR (-O2):
define void @hfuzz_trace_cmp4(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @hfuzz_trace_cmp4_internal(i64 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdout;
void print_character(char ch) {
  printf("%c", ch);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_character>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @print_character(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @print_character(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}