xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_quaddobl_multi_affinization(int n, int m, int *z) {
  int fail;
  int pars[2];
  double c;
  pars[0] = n;
  pars[1] = m;
  fail = _ada_use_c2phc4c(915, pars, z, &c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_quaddobl_multi_affinization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x393,%edi
lea    -0x28(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_quaddobl_multi_affinization>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x393,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @solcon_quaddobl_multi_affinization(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 %12, i32* %13
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%15 = load i32*, i32** %6
%16 = call i32 @_ada_use_c2phc4c(i32 915, i32* %14, i32* %15, double* %9, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @solcon_quaddobl_multi_affinization(i32 %0, i32 %1, i32* %2) {
%4 = alloca [2 x i32]
%5 = alloca double
%6 = bitcast [2 x i32]* %4 to i8*
%7 = bitcast double* %5 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %9
%10 = call i32 @_ada_use_c2phc4c(i32 915, i32* %8, i32* %2, double* %5, i32 0)
ret i32 %10
}
char *strchr(const char *str, int c) { return 0; }


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

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

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strchr(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ operators;

/* Variables and functions */
bool is_operator(const char c) {
  static const char operators[] = "|<>";
  static const size_t num_ops = sizeof(operators) / sizeof(operators[0]) - 1;
  for (size_t i = 0; i < num_ops; ++i) {
    if (c == operators[i]) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<is_operator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x3,-0x10(%rbp)
jae    115a <is_operator+0x5a>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rdx
lea    0xed4(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1144 <is_operator+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1161 <is_operator+0x61>
jmp    1149 <is_operator+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1112 <is_operator+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operator>:
mov    $0x1,%eax
cmp    $0x3c,%dil
je     1119 <is_operator+0x19>
cmp    $0x3e,%dil
je     1119 <is_operator+0x19>
cmp    $0x7c,%dil
je     1119 <is_operator+0x19>
xor    %eax,%eax
ret

LLVM IR (-O0):
@is_operator.operators = internal constant [4 x i8] c"|<>\00"
@is_operator.num_ops = internal constant i64 3
define i32 @is_operator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 0, i64* %4
br label %5
5: ; preds = %18, %1
%6 = load i64, i64* %4
%7 = icmp ult i64 %6, 3
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = load i64, i64* %4
%12 = getelementptr inbounds [4 x i8], [4 x i8]* @is_operator.operators, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %10, %14
br i1 %15, label %16, label %17
16: ; preds = %8
store i32 1, i32* %2
br label %22
17: ; preds = %8
br label %18
18: ; preds = %17
%19 = load i64, i64* %4
%20 = add i64 %19, 1
store i64 %20, i64* %4
br label %5
21: ; preds = %5
store i32 0, i32* %2
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_operator(i8 signext %0) {
switch i8 %0, label %2 [
i8 124, label %3
i8 60, label %3
i8 62, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void RTLockValidatorReadLockDec(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorReadLockDec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isOrdered(int *, int);
int /*<<< orphan*/ shuffle(int *, int);
void bogoSort(int A[], int length) {
  while (!isOrdered(A, length)) {
    shuffle(A, length);
  }
}


x86 assembly (clang, -O0):
<bogoSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <isOrdered@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1150 <bogoSort+0x30>
jmp    1161 <bogoSort+0x41>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <shuffle@plt>
jmp    112f <bogoSort+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bogoSort>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <isOrdered@plt>
test   %eax,%eax
jne    114a <bogoSort+0x2a>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <shuffle@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
jmp    1130 <bogoSort+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @bogoSort(i32* %0, i32 %1) {
%3 = tail call i32 @isOrdered(i32* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2, %5
%6 = tail call i32 @shuffle(i32* %0, i32 %1)
%7 = tail call i32 @isOrdered(i32* %0, i32 %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq(int, unsigned char *, long long);
void vt100_SU(int n) { vt100_EscSeq(n, (unsigned char *)"S", (long long)2); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x2,%edx
call   1030 <vt100_EscSeq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <vt100_EscSeq@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"S\00"
define void @vt100_SU(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vt100_EscSeq(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"S\00"
define void @vt100_SU(i32 %0) {
%2 = tail call i32 @vt100_EscSeq(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_destroy(pthread_mutexattr_t *mattr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_destroy(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void chomp(char *s) {
  while (*s && *s != '\n' && *s != '\r')
    s++;
  *s = 0;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <chomp+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1142 <chomp+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <chomp+0x52>
jmp    1163 <chomp+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <chomp+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
mov    $0x2401,%eax
jmp    1114 <chomp+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xd,%rcx
ja     1110 <chomp+0x10>
bt     %rcx,%rax
jae    1110 <chomp+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
i8 13, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
store i8 0, i8* %3
ret void
}
void RTC_EveryMonthHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @RTC_EveryMonthHandler() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *getProgname(char *string) {
  char *progname;
  progname = strrchr(string, '/');
  if (progname == NULL)
    progname = string;
  else
    progname++;
  return (progname);
}


x86 assembly (clang, -O0):
<getProgname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <getProgname+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <getProgname+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProgname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getProgname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
int main() {
  int a = 10;
  foobar(a);
  foobar(++a);
  foobar(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <foobar@plt>
mov    $0xb,%edi
call   1030 <foobar@plt>
mov    $0xb,%edi
call   1030 <foobar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foobar(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = call i32 @foobar(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @foobar(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 10)
%2 = tail call i32 @foobar(i32 11)
%3 = tail call i32 @foobar(i32 11)
ret i32 0
}
/* Variables and functions */
int EmptyOrError(int, char **);
int Os9Delete(char *);
int /*<<< orphan*/ RestoreLastChar(char *, char);
char SetHiBitOfLastChar(char *);
int picolCommand9Delete(int argc, char **argv, void *pd) {
  char *path = argv[1];
  char final = SetHiBitOfLastChar(path);
  int e = Os9Delete(path);
  RestoreLastChar(path, final);
  return EmptyOrError(e, argv);
}


x86 assembly (clang, -O0):
<picolCommand9Delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <SetHiBitOfLastChar@plt>
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <Os9Delete@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
movsbl -0x21(%rbp),%esi
call   1060 <RestoreLastChar@plt>
mov    -0x28(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <EmptyOrError@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolCommand9Delete>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <SetHiBitOfLastChar@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <Os9Delete@plt>
mov    %eax,%r15d
movsbl %bpl,%esi
mov    %rbx,%rdi
call   1060 <RestoreLastChar@plt>
mov    %r15d,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <EmptyOrError@plt>

LLVM IR (-O0):
define i32 @picolCommand9Delete(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = call signext i8 @SetHiBitOfLastChar(i8* %13)
store i8 %14, i8* %8
%15 = load i8*, i8** %7
%16 = call i32 @Os9Delete(i8* %15)
store i32 %16, i32* %9
%17 = load i8*, i8** %7
%18 = load i8, i8* %8
%19 = call i32 @RestoreLastChar(i8* %17, i8 signext %18)
%20 = load i32, i32* %9
%21 = load i8**, i8*** %5
%22 = call i32 @EmptyOrError(i32 %20, i8** %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @picolCommand9Delete(i32 %0, i8** %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call signext i8 @SetHiBitOfLastChar(i8* %5)
%7 = tail call i32 @Os9Delete(i8* %5)
%8 = tail call i32 @RestoreLastChar(i8* %5, i8 signext %6)
%9 = tail call i32 @EmptyOrError(i32 %7, i8** %1)
ret i32 %9
}
void _M2_Assertion_init(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_Assertion_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_Assertion_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Proc0();
int main() {
  Proc0();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Proc0()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int);
int /*<<< orphan*/ foo(int);
int main() {
  foo(100);
  for (unsigned int i = 0; i < 12; ++i) {
    bar(i);
  }
  foo(4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <foo@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jae    1160 <main+0x40>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
mov    $0x4,%edi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1040 <foo@plt>
xor    %edi,%edi
call   1030 <bar@plt>
mov    $0x1,%edi
call   1030 <bar@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x3,%edi
call   1030 <bar@plt>
mov    $0x4,%edi
call   1030 <bar@plt>
mov    $0x5,%edi
call   1030 <bar@plt>
mov    $0x6,%edi
call   1030 <bar@plt>
mov    $0x7,%edi
call   1030 <bar@plt>
mov    $0x8,%edi
call   1030 <bar@plt>
mov    $0x9,%edi
call   1030 <bar@plt>
mov    $0xa,%edi
call   1030 <bar@plt>
mov    $0xb,%edi
call   1030 <bar@plt>
mov    $0x4,%edi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32 100)
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 12
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @bar(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = call i32 @foo(i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 100)
%2 = tail call i32 @bar(i32 0)
%3 = tail call i32 @bar(i32 1)
%4 = tail call i32 @bar(i32 2)
%5 = tail call i32 @bar(i32 3)
%6 = tail call i32 @bar(i32 4)
%7 = tail call i32 @bar(i32 5)
%8 = tail call i32 @bar(i32 6)
%9 = tail call i32 @bar(i32 7)
%10 = tail call i32 @bar(i32 8)
%11 = tail call i32 @bar(i32 9)
%12 = tail call i32 @bar(i32 10)
%13 = tail call i32 @bar(i32 11)
%14 = tail call i32 @foo(i32 4)
ret i32 0
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void timeval_copy(struct timeval *dst, const struct timeval *src) {
  dst->tv_sec = src->tv_sec;
  dst->tv_usec = src->tv_usec;
}


x86 assembly (clang, -O0):
<timeval_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_copy>:
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @timeval_copy(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @timeval_copy(%struct.timeval* nocapture writeonly %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %7, i32* %8
ret void
}
int foo30() { return 30; }


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

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

LLVM IR (-O0):
define i32 @foo30() {
ret i32 30
}

LLVM IR (-O2):
define i32 @foo30() {
ret i32 30
}
int reverse(int a) {
  int temp = 0;
  while (a > 0) {
    temp = temp * 10 + (a % 10);
    a = a / 10;
  }
  return temp;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverse+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void ff_hevc_put_hevc_uni_epel_hv24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv24_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AccelGyroSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AccelGyroSettingsRequestUpdate() {
  UAVObjRequestUpdate(AccelGyroSettingsHandle());
}


x86 assembly (clang, -O0):
<AccelGyroSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AccelGyroSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelGyroSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AccelGyroSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AccelGyroSettingsRequestUpdate() {
%1 = call i32 (...) @AccelGyroSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelGyroSettingsRequestUpdate() {
%1 = tail call i32 (...) @AccelGyroSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void f_omp_target(void) {
#pragma omp target
  {
#pragma omp target
    ;
#pragma omp target data
    ;
#pragma omp target update to(i)
#pragma omp parallel
    {
#pragma omp target
      ;
#pragma omp target data
      ;
#pragma omp target update to(i)
    }
  }
}


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

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

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

LLVM IR (-O2):
define void @f_omp_target() {
ret void
}
/* Type definitions */
typedef int uintmax_t;

/* Variables and functions */
int CHAR_BIT;
__attribute__((const)) uintmax_t bit_rotl_umax(uintmax_t x, int r) {
  return ((x << r) | (x >> (sizeof(uintmax_t) * CHAR_BIT - r)));
}


x86 assembly (clang, -O0):
<bit_rotl_umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    0x2ec4(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
movslq -0x8(%rbp),%rsi
sub    %rsi,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_rotl_umax>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    0x2ed3(%rip),%rdx
mov    (%rdx),%edx
shl    $0x2,%edx
sub    %esi,%edx
mov    %edx,%ecx
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @bit_rotl_umax(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = sub i64 %11, %13
%15 = trunc i64 %14 to i32
%16 = ashr i32 %8, %15
%17 = or i32 %7, %16
ret i32 %17
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @bit_rotl_umax(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = load i32, i32* @CHAR_BIT
%5 = shl i32 %4, 2
%6 = sub i32 %5, %1
%7 = ashr i32 %0, %6
%8 = or i32 %7, %3
ret i32 %8
}
const char *onoff(int x) {
  if (x) {
    return "On ";
  }
  return "Off";
}


x86 assembly (clang, -O0):
<onoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <onoff+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <onoff+0x2c>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onoff>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"On \00"
@.str.1 = [4 x i8] c"Off\00"
define i8* @onoff(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"On \00"
@.str.1 = [4 x i8] c"Off\00"
define i8* @onoff(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_system_callbacks();
void test_callbacks_suite() {
  printf("== %s ==\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Netflix/dial-reference/refs/heads/master/"
         "server/tests/test_callbacks.c");
  test_system_callbacks();
}


x86 assembly (clang, -O0):
<test_callbacks_suite>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_system_callbacks@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_callbacks_suite>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_system_callbacks@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"== %s ==\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Netflix/dial-reference/refs/heads/master/server/tests/test_callbacks.c\00"
define void @test_callbacks_suite() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @test_system_callbacks()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"== %s ==\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Netflix/dial-reference/refs/heads/master/server/tests/test_callbacks.c\00"
define void @test_callbacks_suite() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_system_callbacks()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkZ() {
  int c = 0;
  while (c != 2) {
    blinkdash();
    c++;
  }
  blinkdot();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     115e <blinkZ+0x2e>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <blinkZ+0xf>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xe8c(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkZ>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkZ() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i32 (...) @blinkdash()
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 (...) @blinkdot()
%11 = call i32 (...) @blinkdot()
%12 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkZ() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
char __le_func(long double d1, long double d2) { return d1 <= d2 ? 1 : 0; }


x86 assembly (clang, -O0):
<__le_func>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__le_func>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define signext i8 @__le_func(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ole x86_fp80 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @__le_func(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ole x86_fp80 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void resetStr(char s1[], char b[]) { strcpy(s1, b); }


x86 assembly (clang, -O0):
<resetStr>:
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 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetStr>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @resetStr(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int wrpkru(unsigned int);
int pkey_set(int pkey, unsigned long rights, unsigned long flags) {
  unsigned int pkru = (rights << (2 * pkey));
  return wrpkru(pkru);
}


x86 assembly (clang, -O0):
<pkey_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
shl    %cl,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <wrpkru@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkey_set>:
lea    (%rdi,%rdi,1),%ecx
shl    %cl,%rsi
mov    %esi,%edi
jmp    1030 <wrpkru@plt>

LLVM IR (-O0):
define i32 @pkey_set(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = load i32, i32* %4
%10 = mul nsw i32 2, %9
%11 = zext i32 %10 to i64
%12 = shl i64 %8, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @wrpkru(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @pkey_set(i32 %0, i64 %1, i64 %2) {
%4 = shl nsw i32 %0, 1
%5 = zext i32 %4 to i64
%6 = shl i64 %1, %5
%7 = trunc i64 %6 to i32
%8 = tail call i32 @wrpkru(i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int ar_size, int *ar) {
  for (int i = 0; i < ar_size; i++) {
    printf("%d ", ar[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1159 <print_arr+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <print_arr+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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


x86 assembly (clang, -O0):
<roundup_to_next_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <roundup_to_next_power_of_2+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <roundup_to_next_power_of_2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_to_next_power_of_2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <roundup_to_next_power_of_2+0x10>
ret

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

LLVM IR (-O2):
define i32 @roundup_to_next_power_of_2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp slt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void test_vorrimm_s32x4(int32_t *__restrict__ dest, int32_t *a) {
  int i;
  for (i = 0; i < 4; i++) {
    dest[i] = a[i] | 1;
  }
}


x86 assembly (clang, -O0):
<test_vorrimm_s32x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <test_vorrimm_s32x4+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vorrimm_s32x4+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorrimm_s32x4>:
movups (%rsi),%xmm0
orps   0xef6(%rip),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorrimm_s32x4(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = or <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void fastd_hash_final(uint32_t *hash) {
  *hash += (*hash << 3);
  *hash ^= (*hash >> 11);
  *hash += (*hash << 15);
}


x86 assembly (clang, -O0):
<fastd_hash_final>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x3,%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0xb,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0xf,%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastd_hash_final>:
mov    (%rdi),%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
sar    $0xb,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0xf,%eax
add    %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @fastd_hash_final(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = shl i32 %4, 3
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
store i32 %8, i32* %6
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = ashr i32 %10, 11
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = xor i32 %13, %11
store i32 %14, i32* %12
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = shl i32 %16, 15
%18 = load i32*, i32** %2
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %17
store i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @fastd_hash_final(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 9
%4 = ashr i32 %3, 11
%5 = xor i32 %4, %3
%6 = mul i32 %5, 32769
store i32 %6, i32* %0
ret void
}
/* Type definitions */
struct statx {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_statx;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, char const *, unsigned int,
                           unsigned int, struct statx *);
__attribute__((unused)) ssize_t statx(int dfd, const char *filename,
                                      unsigned flags, unsigned int mask,
                                      struct statx *buffer) {
  return syscall(__NR_statx, dfd, filename, flags, mask, buffer);
}


x86 assembly (clang, -O0):
<statx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statx>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.statx = type { i32 }
@__NR_statx = global i32 0
define i32 @statx(i32 %0, i8* %1, i32 %2, i32 %3, %struct.statx* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.statx*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.statx* %4, %struct.statx** %10
%11 = load i32, i32* @__NR_statx
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load %struct.statx*, %struct.statx** %10
%17 = call i32 @syscall(i32 %11, i32 %12, i8* %13, i32 %14, i32 %15, %struct.statx* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.statx = type { i32 }
@__NR_statx = global i32 0
define i32 @statx(i32 %0, i8* %1, i32 %2, i32 %3, %struct.statx* %4) {
%6 = load i32, i32* @__NR_statx
%7 = tail call i32 @syscall(i32 %6, i32 %0, i8* %1, i32 %2, i32 %3, %struct.statx* %4)
ret i32 %7
}
int main() {
  static int i;
  return !__builtin_constant_p(&i);
}


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

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

LLVM IR (-O0):
@main.i = internal global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void vgDestroyPaint(VGPaint) {}


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

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

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

LLVM IR (-O2):
define void @vgDestroyPaint(i32 %0) {
ret void
}
/* Variables and functions */
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int increase_speed(void) { return write_block(116, 0, 0, 0); }


x86 assembly (clang, -O0):
<increase_speed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x74,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<increase_speed>:
mov    $0x74,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @increase_speed() {
%1 = call i32 @write_block(i32 116, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @increase_speed() {
%1 = tail call i32 @write_block(i32 116, i32 0, i32 0, i32 0)
ret i32 %1
}