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

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int dag_set_stream_erf_types(int dagfd, int stream_num, uint8_t *erfs) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<dag_set_stream_erf_types>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec2(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dag_set_stream_erf_types>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @dag_set_stream_erf_types(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* @EINVAL
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @dag_set_stream_erf_types(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
ret i32 -1
}
double c2k(double tcelsius) {
  double tkelvin;
  tkelvin = tcelsius + 273.15;
  return (tkelvin);
}


x86 assembly (clang, -O0):
<c2k>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2k>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @c2k(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 2.731500e+02
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @c2k(double %0) {
%2 = fadd double %0, 2.731500e+02
ret double %2
}
/* Variables and functions */
char *new_token(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copy_string(char *s) {
  char *d = new_token(strlen(s) + 1);
  strcpy(d, s);
  return d;
}


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

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

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

LLVM IR (-O2):
define i8* @copy_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @new_token(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int fib(int n) {
  if (n == 0 || n == 1)
    return 1;
  return fib(n - 2) + fib(n - 1);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113b <fib+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fib+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fib+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edi
call   1030 <fib@plt>
add    $0xffffffff,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int Object_init(void *self) {
  assert(self != NULL);
  return 1;
}


x86 assembly (clang, -O0):
<Object_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Object_init>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Object_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 1
}

LLVM IR (-O2):
define i32 @Object_init(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xfc() {
  Assert_real((isdigit(252) == 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",
              1265, ("isdigit should be 0 for 0xfc"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xfc>:
push   %rax
mov    $0xfc,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f1,%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 0xfc\00"
define void @t_isdigit_0xfc() {
%1 = call i64 @isdigit(i32 252)
%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 1265, 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 0xfc\00"
define void @t_isdigit_0xfc() {
%1 = tail call i64 @isdigit(i32 252)
%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 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char nie_convert_init_letter(const char *nie) {
  char ret_val = -1;
  switch (nie[0]) {
  case 'X':
    ret_val = '0';
    break;
  case 'Y':
    ret_val = '1';
    break;
  case 'Z':
    ret_val = '2';
    break;
  default:
    break;
  }
  return ret_val;
}


x86 assembly (clang, -O0):
<nie_convert_init_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x58,%eax
je     1146 <nie_convert_init_letter+0x46>
jmp    1124 <nie_convert_init_letter+0x24>
mov    -0x10(%rbp),%eax
sub    $0x59,%eax
je     114f <nie_convert_init_letter+0x4f>
jmp    1135 <nie_convert_init_letter+0x35>
mov    -0x10(%rbp),%eax
sub    $0x5a,%eax
je     1158 <nie_convert_init_letter+0x58>
jmp    1161 <nie_convert_init_letter+0x61>
movb   $0x30,-0x9(%rbp)
jmp    1166 <nie_convert_init_letter+0x66>
movb   $0x31,-0x9(%rbp)
jmp    1166 <nie_convert_init_letter+0x66>
movb   $0x32,-0x9(%rbp)
jmp    1166 <nie_convert_init_letter+0x66>
jmp    1166 <nie_convert_init_letter+0x66>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nie_convert_init_letter>:
movsbl (%rdi),%eax
add    $0xffffffa8,%eax
lea    0x30(%rax),%ecx
cmp    $0x3,%eax
movzbl %cl,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @nie_convert_init_letter(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 -1, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %11 [
i32 88, label %8
i32 89, label %9
i32 90, label %10
]
8: ; preds = %1
store i8 48, i8* %3
br label %12
9: ; preds = %1
store i8 49, i8* %3
br label %12
10: ; preds = %1
store i8 50, i8* %3
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %10, %9, %8
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @nie_convert_init_letter(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -88
%5 = icmp ult i32 %4, 3
%6 = trunc i32 %4 to i8
%7 = add i8 %6, 48
%8 = select i1 %5, i8 %7, i8 -1
ret i8 %8
}
int uninitialize_tcompress() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uninitialize_tcompress() {
ret i32 0
}
int divide_round_i(int a, int b) { return (2 * a + b) / (2 * b); }


x86 assembly (clang, -O0):
<divide_round_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_round_i>:
lea    (%rsi,%rdi,2),%eax
add    %esi,%esi
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @divide_round_i(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
%5 = shl nsw i32 %1, 1
%6 = sdiv i32 %4, %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isdir(int c) {
  if (isalpha(c) || isdigit(c) || c == ' ') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
jne    1159 <isdir+0x39>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1159 <isdir+0x39>
cmpl   $0x20,-0x8(%rbp)
jne    1165 <isdir+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <isdir+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isdir+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isdir(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = icmp eq i32 %0, 32
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
ret i32 %11
}
int print_params(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @print_params() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RFA1RadioP__UniqueConfig__reportChannelError();
void UniqueLayerP__0__UniqueConfig__reportChannelError(void) {
  RFA1RadioP__UniqueConfig__reportChannelError();
}


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

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

LLVM IR (-O0):
define void @UniqueLayerP__0__UniqueConfig__reportChannelError() {
%1 = call i32 (...) @RFA1RadioP__UniqueConfig__reportChannelError()
ret void
}

LLVM IR (-O2):
define void @UniqueLayerP__0__UniqueConfig__reportChannelError() {
%1 = tail call i32 (...) @RFA1RadioP__UniqueConfig__reportChannelError()
ret void
}
void trace(char *str, ...) { (void)str; }


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

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

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

LLVM IR (-O2):
define void @trace(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *mem_double(void *ptr, size_t size) {
  void *newptr;
  newptr = calloc(2 * size, 1);
  if (newptr == NULL)
    return NULL;
  memcpy(newptr, ptr, size);
  free(ptr);
  return newptr;
}


x86 assembly (clang, -O0):
<mem_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1170 <mem_double+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1192 <mem_double+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_double>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    (%rsi,%rsi,1),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1166 <mem_double+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mem_double(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = mul i64 2, %7
%9 = trunc i64 %8 to i32
%10 = call i8* @calloc(i32 %9, i32 1)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
store i8* null, i8** %3
br label %22
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %14, %13
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @mem_double(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %3, 1
%5 = tail call i8* @calloc(i32 %4, i32 1)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%9 = tail call i32 @free(i8* %0)
br label %10
10: ; preds = %2, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int shell_execve(char *command, char **args, char **export_env) {
  if (*command == '/')
    execv(command, args);
  else
    execvp(command, args);
  fprintf(stderr, "exec failed for command: %s\n", command);
  return 1;
}


x86 assembly (clang, -O0):
<shell_execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1166 <shell_execve+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execv@plt>
jmp    1173 <shell_execve+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execvp@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe79(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_execve>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x2f,(%rdi)
jne    1143 <shell_execve+0x13>
mov    %rbx,%rdi
call   1050 <execv@plt>
jmp    114b <shell_execve+0x1b>
mov    %rbx,%rdi
call   1040 <execvp@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"exec failed for command: %s\0A\00"
define i32 @shell_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8**, i8*** %5
%14 = call i32 @execv(i8* %12, i8** %13)
br label %19
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i8**, i8*** %5
%18 = call i32 @execvp(i8* %16, i8** %17)
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %4
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %21)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"exec failed for command: %s\0A\00"
define i32 @shell_execve(i8* %0, i8** %1, i8** nocapture readnone %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 47
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @execv(i8* %0, i8** %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @execvp(i8* %0, i8** %1)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
int func(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 2
}

LLVM IR (-O2):
define i32 @func() {
ret i32 2
}
unsigned int hash(unsigned int key) {
  key = ~key + (key << 15);
  key = key ^ (key >> 12);
  key = key + (key << 2);
  key = key ^ (key >> 4);
  key = key * 2057;
  key = key ^ (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0xc,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x809,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
not    %eax
shl    $0xf,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0xc,%eax
xor    %edi,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,%ecx
shr    $0x4,%ecx
xor    %eax,%ecx
imul   $0x809,%ecx,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = xor i32 %0, -1
%3 = shl i32 %0, 15
%4 = add i32 %3, %2
%5 = lshr i32 %4, 12
%6 = xor i32 %5, %4
%7 = mul i32 %6, 5
%8 = lshr i32 %7, 4
%9 = xor i32 %8, %7
%10 = mul i32 %9, 2057
%11 = lshr i32 %10, 16
%12 = xor i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int append_mode();
int /*<<< orphan*/ insertch(char);
int /*<<< orphan*/ lnend();
int open_before(void) {
  lnend();
  if (!insertch('\n'))
    return append_mode();
  return 1;
}


x86 assembly (clang, -O0):
<open_before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lnend@plt>
mov    $0xa,%edi
call   1030 <insertch@plt>
cmp    $0x0,%eax
jne    1161 <open_before+0x31>
mov    $0x0,%al
call   1050 <append_mode@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <open_before+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_before>:
push   %rax
xor    %eax,%eax
call   1040 <lnend@plt>
mov    $0xa,%edi
call   1030 <insertch@plt>
test   %eax,%eax
je     114d <open_before+0x1d>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1050 <append_mode@plt>

LLVM IR (-O0):
define i32 @open_before() {
%1 = alloca i32
%2 = call i32 (...) @lnend()
%3 = call i32 @insertch(i8 signext 10)
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @append_mode()
store i32 %6, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @open_before() {
%1 = tail call i32 (...) @lnend()
%2 = tail call i32 @insertch(i8 signext 10)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @append_mode()
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
size_t align_to_word_boundary(int /*<<< orphan*/);
int /*<<< orphan*/ size_with_header(size_t);
size_t request2size(size_t n) {
  return align_to_word_boundary(size_with_header(n));
}


x86 assembly (clang, -O0):
<request2size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <size_with_header@plt>
mov    %eax,%edi
call   1030 <align_to_word_boundary@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request2size>:
push   %rax
call   1040 <size_with_header@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <align_to_word_boundary@plt>

LLVM IR (-O0):
define i64 @request2size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @size_with_header(i64 %3)
%5 = call i64 @align_to_word_boundary(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @request2size(i64 %0) {
%2 = tail call i32 @size_with_header(i64 %0)
%3 = tail call i64 @align_to_word_boundary(i32 %2)
ret i64 %3
}
int test_imm_2Bint32_mem(int *val) {
  return ((*val) & (0x2B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Bint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 43
%6 = icmp ne i32 %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_2Bint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 43
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int func() {
  static int a = 1;
  return a++;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@func.a = internal global i32 1
define i32 @func() {
%1 = load i32, i32* @func.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @func.a
ret i32 %1
}

LLVM IR (-O2):
@func.a = internal unnamed_addr global i32 1
define i32 @func() {
%1 = load i32, i32* @func.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @func.a
ret i32 %1
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
struct timeval ms2tv(int ms) {
  struct timeval result;
  result.tv_sec = ms / 1000;
  result.tv_usec = ((ms % 1000) * 1000);
  return result;
}


x86 assembly (clang, -O0):
<ms2tv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms2tv>:
movslq %edi,%rcx
imul   $0x10624dd3,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
imul   $0x3e8,%eax,%edx
sub    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
shl    $0x20,%rcx
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @ms2tv(i32 %0) {
%2 = alloca %struct.timeval
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %3
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i32 %9, i32* %10
%11 = bitcast %struct.timeval* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ms2tv(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = srem i32 %0, 1000
%4 = mul nsw i32 %3, 1000
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %2 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Type definitions */
struct symbolTableRecord {
  int dummy;
};

/* Variables and functions */
scalar_t__ lookupLocal(struct symbolTableRecord *, char *);
int /*<<< orphan*/ yyserror(char *, char *);
void uniqueName(struct symbolTableRecord *syms, char *name) {
  if (lookupLocal(syms, name)) {
    yyserror("name must be unique within context: %s", name);
  }
}


x86 assembly (clang, -O0):
<uniqueName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lookupLocal@plt>
cmp    $0x0,%rax
je     1157 <uniqueName+0x37>
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <yyserror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniqueName>:
push   %rbx
mov    %rsi,%rbx
call   1030 <lookupLocal@plt>
test   %rax,%rax
je     113e <uniqueName+0x1e>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <yyserror@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.symbolTableRecord = type { i32 }
@.str = [39 x i8] c"name must be unique within context: %s\00"
define void @uniqueName(%struct.symbolTableRecord* %0, i8* %1) {
%3 = alloca %struct.symbolTableRecord*
%4 = alloca i8*
store %struct.symbolTableRecord* %0, %struct.symbolTableRecord** %3
store i8* %1, i8** %4
%5 = load %struct.symbolTableRecord*, %struct.symbolTableRecord** %3
%6 = load i8*, i8** %4
%7 = call i64 @lookupLocal(%struct.symbolTableRecord* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @yyserror(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.symbolTableRecord = type { i32 }
@.str = [39 x i8] c"name must be unique within context: %s\00"
define void @uniqueName(%struct.symbolTableRecord* %0, i8* %1) {
%3 = tail call i64 @lookupLocal(%struct.symbolTableRecord* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @yyserror(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void myinit(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_FLAT = global i32 0
define void @myinit() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @myinit() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void foo() {
  char a[4000];
  bar(a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfa0,%rsp
lea    -0xfa0(%rbp),%rdi
call   1030 <bar@plt>
add    $0xfa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0xfa8,%rsp
mov    %rsp,%rdi
call   1030 <bar@plt>
add    $0xfa8,%rsp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca [4000 x i8]
%2 = getelementptr inbounds [4000 x i8], [4000 x i8]* %1, i64 0, i64 0
%3 = call i32 @bar(i8* %2)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [4000 x i8]
%2 = getelementptr inbounds [4000 x i8], [4000 x i8]* %1, i64 0, i64 0
%3 = call i32 @bar(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int f() {
  int a;
  printf("f 0: a = %d\n", a);
  a = 2;
  printf("f 1: a = %d\n", a);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x2,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"f 0: a = %d\0A\00"
@.str.1 = [13 x i8] c"f 1: a = %d\0A\00"
define i32 @f() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 undef
}
unsigned long long get_system_hertz(void) {
  unsigned long long myhz = 1;
  myhz = myhz;
  error_int("ERROR",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/hlzz/dotfiles/refs/heads/master/dev/"
            "netdata/src/apps_plugin.c",
            __FUNCTION__, 284, "Unknown HZ value. Assuming %llu.", myhz);
  return myhz;
}


x86 assembly (clang, -O0):
<get_system_hertz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xecd(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xf5d(%rip),%rdx
mov    $0x11c,%ecx
lea    0xf62(%rip),%r8
mov    $0x0,%al
call   1030 <error_int@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_system_hertz>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xf78(%rip),%rdx
lea    0xf82(%rip),%r8
mov    $0x1,%r9d
mov    $0x11c,%ecx
xor    %eax,%eax
call   1030 <error_int@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hlzz/dotfiles/refs/heads/master/dev/netdata/src/apps_plugin.c\00"
@__FUNCTION__.get_system_hertz = [17 x i8] c"get_system_hertz\00"
@.str.2 = [33 x i8] c"Unknown HZ value. Assuming %llu.\00"
define i64 @get_system_hertz() {
%1 = alloca i64
store i64 1, i64* %1
%2 = load i64, i64* %1
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 (i8*, i8*, i8*, i32, i8*, i64, ...) bitcast (i32 (...)* @error_int to i32 (i8*, i8*, i8*, i32, i8*, i64, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.get_system_hertz, i64 0, i64 0), i32 284, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %1
ret i64 %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hlzz/dotfiles/refs/heads/master/dev/netdata/src/apps_plugin.c\00"
@__FUNCTION__.get_system_hertz = [17 x i8] c"get_system_hertz\00"
@.str.2 = [33 x i8] c"Unknown HZ value. Assuming %llu.\00"
define i64 @get_system_hertz() {
%1 = tail call i32 (i8*, i8*, i8*, i32, i8*, i64, ...) bitcast (i32 (...)* @error_int to i32 (i8*, i8*, i8*, i32, i8*, i64, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.get_system_hertz, i64 0, i64 0), i32 284, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i64 1)
ret i64 1
}
void back_mouse_down(double x, double y) {
  (void)x;
  (void)y;
}


x86 assembly (clang, -O0):
<back_mouse_down>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @back_mouse_down(double %0, double %1) {
ret void
}
/* Variables and functions */
int i_rnd(int);
int ia_rnd(int index, int maximum) { return i_rnd(maximum); }


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

x86 assembly (clang, -O2):
<ia_rnd>:
mov    %esi,%edi
jmp    1030 <i_rnd@plt>

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

LLVM IR (-O2):
define i32 @ia_rnd(i32 %0, i32 %1) {
%3 = tail call i32 @i_rnd(i32 %1)
ret i32 %3
}
/* Variables and functions */
void *thread_func(void *unused_arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @thread_func(i8* nocapture readnone %0) {
ret i8* null
}
int execute_splice() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_splice() {
ret i32 0
}
int vfs_dq_rename(struct inode *inode, struct inode *old_dir,
                  struct inode *new_dir) {
  return 0;
}


x86 assembly (clang, -O0):
<vfs_dq_rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @vfs_dq_rename(%struct.inode* nocapture readnone %0, %struct.inode* nocapture readnone %1, %struct.inode* nocapture readnone %2) {
ret i32 0
}
int RIGHT(int i) { return 2 * i + 2; }


x86 assembly (clang, -O0):
<RIGHT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIGHT>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @RIGHT(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int remove(char const *);
int File_Delete(const char *FileName) { return remove(FileName); }


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

x86 assembly (clang, -O2):
<File_Delete>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @File_Delete(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(long);
void simulated_file_read(long disk_read_time_ms) {
  usleep(disk_read_time_ms * 1000);
}


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

x86 assembly (clang, -O2):
<simulated_file_read>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @simulated_file_read(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @simulated_file_read(i64 %0) {
%2 = mul nsw i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
void main() {
  int n;
  goto next;
backhere:
  n = 0;
next:
  goto backhere;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1110 <main+0x10>
movl   $0x0,-0x4(%rbp)
jmp    1109 <main+0x9>

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void gtk_check_menu_item_get_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_check_menu_item_get_active() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void explore() { printf("Nothing interesting here.\n"); }


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"Nothing interesting here.\00"
define void @explore() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t gt0(uint64_t x) {
  if (x > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gt0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1120 <gt0+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1128 <gt0+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt0>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i64 @gt0(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %8
7: ; preds = %1
store i64 0, i64* %2
br label %8
8: ; preds = %7, %6
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @gt0(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ Log(char *, char *, char *, char *);
char *TextOf(int /*<<< orphan*/);
void Act_Log(void) {
  char *a = TextOf(ArgText());
  char *b = TextOf(ArgText());
  char *c = TextOf(ArgText());
  Log("%s%s%s", a, b, c);
}


x86 assembly (clang, -O0):
<Act_Log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe7f(%rip),%rdi
call   1040 <Log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Log>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1050 <TextOf@plt>
lea    0xe95(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Log@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
define void @Act_Log() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = call i32 (...) @ArgText()
%5 = call i8* @TextOf(i32 %4)
store i8* %5, i8** %1
%6 = call i32 (...) @ArgText()
%7 = call i8* @TextOf(i32 %6)
store i8* %7, i8** %2
%8 = call i32 (...) @ArgText()
%9 = call i8* @TextOf(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %1
%11 = load i8*, i8** %2
%12 = load i8*, i8** %3
%13 = call i32 @Log(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
define void @Act_Log() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 (...) @ArgText()
%4 = tail call i8* @TextOf(i32 %3)
%5 = tail call i32 (...) @ArgText()
%6 = tail call i8* @TextOf(i32 %5)
%7 = tail call i32 @Log(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4, i8* %6)
ret void
}