xunge/DecIR huggingface dataset:
/* Type definitions */
struct aiocb {
  int /*<<< orphan*/ __return_value;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t aio_return(struct aiocb *aiocbp) { return aiocbp->__return_value; }


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

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

LLVM IR (-O0):
%struct.aiocb = type { i32 }
define i32 @aio_return(%struct.aiocb* %0) {
%2 = alloca %struct.aiocb*
store %struct.aiocb* %0, %struct.aiocb** %2
%3 = load %struct.aiocb*, %struct.aiocb** %2
%4 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
define i32 @aio_return(%struct.aiocb* nocapture %0) {
%2 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int sys_shutdown_system(unsigned long magic) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sys_shutdown_system(i64 %0) {
ret i32 0
}
/* Type definitions */
struct string {
  int dummy;
};

/* Variables and functions */
int string_concatb(struct string *, char const *, size_t);
int /*<<< orphan*/ string_lazyinit(struct string *, size_t);
size_t strlen(char const *);
bool string_initfromstringz(struct string *s, const char *is) {
  size_t l;
  l = strlen(is);
  string_lazyinit(s, l);
  return string_concatb(s, is, l);
}


x86 assembly (clang, -O0):
<string_initfromstringz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <string_lazyinit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <string_concatb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_initfromstringz>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <string_lazyinit@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <string_concatb@plt>

LLVM IR (-O0):
%struct.string = type { i32 }
define i32 @string_initfromstringz(%struct.string* %0, i8* %1) {
%3 = alloca %struct.string*
%4 = alloca i8*
%5 = alloca i64
store %struct.string* %0, %struct.string** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load %struct.string*, %struct.string** %3
%9 = load i64, i64* %5
%10 = call i32 @string_lazyinit(%struct.string* %8, i64 %9)
%11 = load %struct.string*, %struct.string** %3
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i32 @string_concatb(%struct.string* %11, i8* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.string = type { i32 }
define i32 @string_initfromstringz(%struct.string* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @string_lazyinit(%struct.string* %0, i64 %3)
%5 = tail call i32 @string_concatb(%struct.string* %0, i8* %1, i64 %3)
ret i32 %5
}
int main() {
  int a = 5;
  int b = 6;
  int c = a + b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void manipulacion(int m) {}


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

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

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

LLVM IR (-O2):
define void @manipulacion(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_closure() { printf("#<closure>"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"#<closure>\00"
define void @print_closure() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"#<closure>\00"
define void @print_closure() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  int a = 10;
  int b = 20;
  *(int *)0x07FC = a + b;
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
mov    $0x7fc,%eax
mov    %ecx,(%rax)
jmp    1126 <main+0x26>

x86 assembly (clang, -O2):
<main>:
movl   $0x1e,0x7fc
nopl   0x0(%rax,%rax,1)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
store i32 %6, i32* inttoptr (i64 2044 to i32*)
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
define i32 @main() {
store i32 30, i32* inttoptr (i64 2044 to i32*)
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ GPIO_SET_GPCLR(int);
int /*<<< orphan*/ GPIO_SET_GPSET(int);
void blink_GPIO19(void) {
  static int lit16 = 0;
  if (lit16) {
    GPIO_SET_GPSET(19);
    lit16 = 0;
  } else {
    GPIO_SET_GPCLR(19);
    lit16 = 1;
  }
}


x86 assembly (clang, -O0):
<blink_GPIO19>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
je     114a <blink_GPIO19+0x2a>
mov    $0x13,%edi
call   1040 <GPIO_SET_GPSET@plt>
movl   $0x0,0x2eef(%rip)
jmp    115e <blink_GPIO19+0x3e>
mov    $0x13,%edi
call   1030 <GPIO_SET_GPCLR@plt>
movl   $0x1,0x2ed6(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink_GPIO19>:
push   %rbx
mov    0x2f0d(%rip),%bl
mov    $0x13,%edi
cmp    $0x1,%bl
jne    1138 <blink_GPIO19+0x18>
call   1040 <GPIO_SET_GPSET@plt>
jmp    113d <blink_GPIO19+0x1d>
call   1030 <GPIO_SET_GPCLR@plt>
xor    $0x1,%bl
mov    %bl,0x2eee(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@blink_GPIO19.lit16 = internal global i32 0
define void @blink_GPIO19() {
%1 = load i32, i32* @blink_GPIO19.lit16
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @GPIO_SET_GPSET(i32 19)
store i32 0, i32* @blink_GPIO19.lit16
br label %7
5: ; preds = %0
%6 = call i32 @GPIO_SET_GPCLR(i32 19)
store i32 1, i32* @blink_GPIO19.lit16
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@blink_GPIO19.lit16 = internal unnamed_addr global i1 false
define void @blink_GPIO19() {
%1 = load i1, i1* @blink_GPIO19.lit16
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 @GPIO_SET_GPSET(i32 19)
br label %6
4: ; preds = %0
%5 = tail call i32 @GPIO_SET_GPCLR(i32 19)
br label %6
6: ; preds = %4, %2
%7 = xor i1 %1, true
store i1 %7, i1* @blink_GPIO19.lit16
ret void
}
int test_imm_27int64_highword_reg(long long val) {
  return ((val >> 32) & (0x27 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_27int64_highword_reg>:
movabs $0x2700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_27int64_highword_reg(i64 %0) {
%2 = and i64 %0, 167503724544
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr,
          "usage: %s -a ALIGNMENT -c COUNT -e EQUAL-SIZE -L LOOPS\n"
          "   -m STRATEGY -s SIZE -S SEED\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"usage: %s -a ALIGNMENT -c COUNT -e EQUAL-SIZE -L LOOPS\0A -m STRATEGY -s SIZE -S SEED\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"usage: %s -a ALIGNMENT -c COUNT -e EQUAL-SIZE -L LOOPS\0A -m STRATEGY -s SIZE -S SEED\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int do_785() { return 785; }


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

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

LLVM IR (-O0):
define i32 @do_785() {
ret i32 785
}

LLVM IR (-O2):
define i32 @do_785() {
ret i32 785
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int PTHREAD_PROCESS_PRIVATE;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ pthread_rwlockattr_destroy(int /*<<< orphan*/ *);
scalar_t__ pthread_rwlockattr_getpshared(int /*<<< orphan*/ *, int *);
scalar_t__ pthread_rwlockattr_init(int /*<<< orphan*/ *);
int main(void) {
  pthread_rwlockattr_t rwla;
  int pshared;
  printf("process-shared attribute is not available for testing\n");
  return 4;
  if (pthread_rwlockattr_init(&rwla) != 0) {
    printf("Error at pthread_rwlockattr_init()\n");
    return 2;
  }
  if (pthread_rwlockattr_getpshared(&rwla, &pshared) != 0) {
    printf("Error at pthread_rwlockattr_getpshared()\n");
    return 2;
  }
  if (pshared != PTHREAD_PROCESS_PRIVATE) {
    printf("Test FAILED: Incorrect default pshared value: %d\n", pshared);
    return 1;
  }
  if ((pthread_rwlockattr_destroy(&rwla)) != 0) {
    printf("Error at pthread_rwlockattr_destroy()\n");
    return 2;
  }
  printf("Test PASSED\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@PTHREAD_PROCESS_PRIVATE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@PTHREAD_PROCESS_PRIVATE = global i32 0
@str = [54 x i8] c"process-shared attribute is not available for testing\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC16F628A_stop(void) {
  serial_close(0);
  ;
}


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

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

LLVM IR (-O0):
define void @PIC16F628A_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F628A_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
void __attribute__((__no__)) copy(double *a, double *b) { *b = *a; }


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

x86 assembly (clang, -O2):
<copy>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @copy(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
ret void
}
int ch_test_cjk(const char *s) {
  int ch = (*(const unsigned char *)(s));
  return (ch > 0x80) ? 1 : 0;
}


x86 assembly (clang, -O0):
<ch_test_cjk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x80,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_test_cjk>:
xor    %eax,%eax
cmpb   $0x81,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @ch_test_cjk(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 128
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @ch_test_cjk(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ugt i8 %2, -128
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int f65(unsigned int x, unsigned int y) {
  return (x << y) + (x >> (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f65>:
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    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f65>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f65(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* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = add i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f65(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = add i32 %5, %3
ret i32 %6
}
int NearestPowerOf2(int n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}


x86 assembly (clang, -O0):
<NearestPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NearestPowerOf2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @NearestPowerOf2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  time_t t;
  srand((unsigned)time(&t));
  printf("%d%d %d%d", rand(), rand(), rand(), rand());
  return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    %eax,%r8d
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <rand@plt>
lea    0xe7d(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d%d %d%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @time(i32* %6)
%8 = trunc i64 %7 to i32
%9 = call i32 @srand(i32 %8)
%10 = call i32 (...) @rand()
%11 = call i32 (...) @rand()
%12 = call i32 (...) @rand()
%13 = call i32 (...) @rand()
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d%d %d%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @time(i32* %3)
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = call i32 (...) @rand()
%10 = call i32 (...) @rand()
%11 = call i32 (...) @rand()
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
yyerror(void) { printf("Syntaxfehler!"); }


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Syntaxfehler!\00"
define i32 @yyerror() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"Syntaxfehler!\00"
define i32 @yyerror() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
intptr_t abs_value(intptr_t num) {
  if (((intptr_t) ~(~(uintptr_t)0 >> 1)) == num) {
    return -1;
  } else if (num > 0) {
    return num;
  } else {
    return -num;
  }
}


x86 assembly (clang, -O0):
<abs_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0x8000000000000000,%rax
cmp    -0x10(%rbp),%rax
jne    1129 <abs_value+0x29>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114b <abs_value+0x4b>
cmpq   $0x0,-0x10(%rbp)
jle    1141 <abs_value+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <abs_value+0x4b>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_value>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
movabs $0x8000000000000000,%rax
cmp    %rax,%rdi
mov    $0xffffffffffffffff,%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @abs_value(i64 %0) {
%2 = icmp eq i64 %0, -9223372036854775808
%3 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%4 = select i1 %2, i64 -1, i64 %3
ret i64 %4
}
/* Variables and functions */
scalar_t__ gui_getk();
int /*<<< orphan*/ usleep(int);
void gui_wait_for_any_key() {
  while (gui_getk()) {
  }
  while (!gui_getk()) {
    usleep(10000);
  }
}


x86 assembly (clang, -O0):
<gui_wait_for_any_key>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <gui_wait_for_any_key+0x9>
mov    $0x0,%al
call   1030 <gui_getk@plt>
cmp    $0x0,%rax
je     113f <gui_wait_for_any_key+0x1f>
jmp    1129 <gui_wait_for_any_key+0x9>
jmp    1144 <gui_wait_for_any_key+0x24>
mov    $0x0,%al
call   1030 <gui_getk@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1161 <gui_wait_for_any_key+0x41>
jmp    1170 <gui_wait_for_any_key+0x50>
mov    $0x2710,%edi
call   1040 <usleep@plt>
jmp    1144 <gui_wait_for_any_key+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_wait_for_any_key>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gui_getk@plt>
test   %rax,%rax
jne    1130 <gui_wait_for_any_key+0x10>
jmp    114a <gui_wait_for_any_key+0x2a>
xchg   %ax,%ax
mov    $0x2710,%edi
call   1040 <usleep@plt>
xor    %eax,%eax
call   1030 <gui_getk@plt>
test   %rax,%rax
je     1140 <gui_wait_for_any_key+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @gui_wait_for_any_key() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @gui_getk()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
br label %6
6: ; preds = %10, %5
%7 = call i64 (...) @gui_getk()
%8 = icmp ne i64 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @usleep(i32 10000)
br label %6
12: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @gui_wait_for_any_key() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @gui_getk()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i64 (...) @gui_getk()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4, %7
%8 = tail call i32 @usleep(i32 10000)
%9 = tail call i64 (...) @gui_getk()
%10 = icmp eq i64 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7, %4
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ tid;
};
typedef TYPE_1__ ERR_STATE;

/* Variables and functions */
int CRYPTO_THREADID_hash(int /*<<< orphan*/ *);
unsigned long err_state_hash(const ERR_STATE *a) {
  return CRYPTO_THREADID_hash(&a->tid) * 13;
}


x86 assembly (clang, -O0):
<err_state_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CRYPTO_THREADID_hash@plt>
imul   $0xd,%eax,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_state_hash>:
push   %rax
call   1030 <CRYPTO_THREADID_hash@plt>
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i64 @err_state_hash(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = call i32 @CRYPTO_THREADID_hash(i32* %4)
%6 = mul nsw i32 %5, 13
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i64 @err_state_hash(%struct.TYPE_3__* %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = tail call i32 @CRYPTO_THREADID_hash(i32* %2)
%4 = mul nsw i32 %3, 13
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ resetty();
void cmd_resetty(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(resetty());
}


x86 assembly (clang, -O0):
<cmd_resetty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_resetty+0x27>
jmp    117f <cmd_resetty+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1040 <resetty@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_resetty>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_resetty+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1040 <resetty@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_resetty(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @resetty()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_resetty(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @resetty()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
void SysTime_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @SysTime_destroy() {
ret void
}
/* Variables and functions */
double pow(double, int);
double f1(double x) { return 1.0 + pow(x, 3); }


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

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

LLVM IR (-O0):
define double @f1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, i32 3)
%5 = fadd double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @pow(double %0, i32 3)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
void pathconN_nm8_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm8_incref() {
ret void
}
/* Variables and functions */
char *frob();
int /*<<< orphan*/ oof();
void test_3(int code) {
  char *temp = frob();
  int rotate = (code == 22);
  if (!rotate || temp == 0)
    oof();
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <frob@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x16,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115a <test_3+0x3a>
cmpq   $0x0,-0x10(%rbp)
jne    1161 <test_3+0x41>
mov    $0x0,%al
call   1030 <oof@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <frob@plt>
cmp    $0x16,%ebx
jne    1136 <test_3+0x16>
test   %rax,%rax
je     1136 <test_3+0x16>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <oof@plt>

LLVM IR (-O0):
define void @test_3(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i8* (...) @frob()
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 22
%8 = zext i1 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11, %1
%15 = call i32 (...) @oof()
br label %16
16: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
define void @test_3(i32 %0) {
%2 = tail call i8* (...) @frob()
%3 = icmp ne i32 %0, 22
%4 = icmp eq i8* %2, null
%5 = select i1 %3, i1 true, i1 %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %1, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t1(int /*<<< orphan*/);
int main() {
  { t1(0); }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @t1(i32 0)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ckDynMemLogicalToPhysical(uint32_t address) {
  return address - 0x00100000 + 0x00900000;
}


x86 assembly (clang, -O0):
<ckDynMemLogicalToPhysical>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x100000,%eax
add    $0x900000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckDynMemLogicalToPhysical>:
lea    0x800000(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ckDynMemLogicalToPhysical(i32 %0) {
%2 = add nsw i32 %0, 8388608
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t read_dma_value(uint32_t address) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @read_dma_value(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ RFC2409_PRIME_768;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_bin2bn(unsigned char const *, int, int /*<<< orphan*/ *);
BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn) {
  static const unsigned char RFC2409_PRIME_768[] = {
      0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2,
      0x21, 0x68, 0xC2, 0x34, 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1,
      0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, 0x02, 0x0B, 0xBE, 0xA6,
      0x3B, 0x13, 0x9B, 0x22, 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD,
      0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, 0x30, 0x2B, 0x0A, 0x6D,
      0xF2, 0x5F, 0x14, 0x37, 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45,
      0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, 0xF4, 0x4C, 0x42, 0xE9,
      0xA6, 0x3A, 0x36, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  };
  return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn);
}


x86 assembly (clang, -O0):
<BN_get_rfc2409_prime_768>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
mov    $0x60,%esi
call   1030 <BN_bin2bn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_get_rfc2409_prime_768>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    $0x60,%esi
jmp    1030 <BN_bin2bn@plt>

LLVM IR (-O0):
@BN_get_rfc2409_prime_768.RFC2409_PRIME_768 = internal constant [96 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\C9\0F\DA\A2!h\C24\C4\C6b\8B\80\DC\1C\D1)\02N\08\8Ag\CCt\02\0B\BE\A6;\13\9B\22QJ\08y\8E4\04\DD\EF\95\19\B3\CD:C\1B0+\0Am\F2_\147O\E15mmQ\C2E\E4\85\B5vb^~\C6\F4LB\E9\A6:6 \FF\FF\FF\FF\FF\FF\FF\FF"
define i32* @BN_get_rfc2409_prime_768(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32* @BN_bin2bn(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @BN_get_rfc2409_prime_768.RFC2409_PRIME_768, i64 0, i64 0), i32 96, i32* %3)
ret i32* %4
}

LLVM IR (-O2):
@BN_get_rfc2409_prime_768.RFC2409_PRIME_768 = internal constant [96 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\C9\0F\DA\A2!h\C24\C4\C6b\8B\80\DC\1C\D1)\02N\08\8Ag\CCt\02\0B\BE\A6;\13\9B\22QJ\08y\8E4\04\DD\EF\95\19\B3\CD:C\1B0+\0Am\F2_\147O\E15mmQ\C2E\E4\85\B5vb^~\C6\F4LB\E9\A6:6 \FF\FF\FF\FF\FF\FF\FF\FF"
define i32* @BN_get_rfc2409_prime_768(i32* %0) {
%2 = tail call i32* @BN_bin2bn(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @BN_get_rfc2409_prime_768.RFC2409_PRIME_768, i64 0, i64 0), i32 96, i32* %0)
ret i32* %2
}
/* Type definitions */
struct xdg_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface) {
  wl_proxy_marshal((struct wl_proxy *)xdg_surface, 9);
}


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

x86 assembly (clang, -O2):
<xdg_surface_unset_fullscreen>:
mov    $0x9,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_unset_fullscreen(%struct.xdg_surface* %0) {
%2 = alloca %struct.xdg_surface*
store %struct.xdg_surface* %0, %struct.xdg_surface** %2
%3 = load %struct.xdg_surface*, %struct.xdg_surface** %2
%4 = bitcast %struct.xdg_surface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 9)
ret void
}

LLVM IR (-O2):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_unset_fullscreen(%struct.xdg_surface* %0) {
%2 = bitcast %struct.xdg_surface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<free_>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void no_notify(void) {}


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

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

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

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

/* Variables and functions */
int ave(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nums[] = {1, 2, 3, 4, 5};
  int len = sizeof(nums) / sizeof(int);
  printf("%d", ave(nums, len));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <ave@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <ave@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @ave(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
double clock1();
void sleep1(double intr) {
  double t = clock1() + intr;
  while (1) {
    if (clock1() > t)
      break;
  }
}


x86 assembly (clang, -O0):
<sleep1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock1@plt>
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock1@plt>
ucomisd -0x10(%rbp),%xmm0
jbe    1145 <sleep1+0x35>
jmp    114a <sleep1+0x3a>
jmp    112e <sleep1+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep1>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <clock1@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock1@plt>
ucomisd (%rsp),%xmm0
jbe    1130 <sleep1+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @sleep1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @clock1()
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %3
br label %7
7: ; preds = %1, %12
%8 = call double (...) @clock1()
%9 = load double, double* %3
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %7
13: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @sleep1(double %0) {
%2 = tail call double (...) @clock1()
%3 = fadd double %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call double (...) @clock1()
%6 = fcmp ogt double %5, %3
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
void installTss(void) { __asm__ volatile(" mov $0x2B, %ax \n ltr %ax \n"); }


x86 assembly (clang, -O0):
<installTss>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%ax
ltr    %ax
pop    %rbp
ret

x86 assembly (clang, -O2):
<installTss>:
mov    $0x2b,%ax
ltr    %ax
ret

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

LLVM IR (-O2):
define void @installTss() {
tail call void asm sideeffect " mov $$0x2B, %ax \0A ltr %ax \0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void bfq_update_budget(struct bfq_entity *next_active) {}


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

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

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

LLVM IR (-O2):
%struct.bfq_entity = type opaque
define void @bfq_update_budget(%struct.bfq_entity* nocapture %0) {
ret void
}
/* Variables and functions */
double log2(double);
double clip_log2(double p) { return p <= 0. ? -1000. : log2(p); }


x86 assembly (clang, -O0):
<clip_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     113d <clip_log2+0x2d>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114c <clip_log2+0x3c>
movsd  -0x8(%rbp),%xmm0
call   1030 <log2@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip_log2>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    111f <clip_log2+0xf>
jmp    1030 <log2@plt>
movsd  0xed9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @clip_log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @log2(double %7)
br label %9
9: ; preds = %6, %5
%10 = phi double [ -1.000000e+03, %5 ], [ %8, %6 ]
ret double %10
}

LLVM IR (-O2):
define double @clip_log2(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log2(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ -1.000000e+03, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ jet_sleep(int);
int write_block(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int dynamixelsetEndless(int servo, int status) {
  int ret = write_block(104, servo, status, 0, 0, 0);
  jet_sleep(50);
  return ret;
}


x86 assembly (clang, -O0):
<dynamixelsetEndless>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x68,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <write_block@plt>
mov    %eax,-0xc(%rbp)
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamixelsetEndless>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x68,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <write_block@plt>
mov    %eax,%ebx
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dynamixelsetEndless(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @write_block(i32 104, i32 %6, i32 %7, i32 0, i32 0, i32 0)
store i32 %8, i32* %5
%9 = call i32 @jet_sleep(i32 50)
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @dynamixelsetEndless(i32 %0, i32 %1) {
%3 = tail call i32 @write_block(i32 104, i32 %0, i32 %1, i32 0, i32 0, i32 0)
%4 = tail call i32 @jet_sleep(i32 50)
ret i32 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int read(int, void *, size_t);
ssize_t x_read(int fd, void *buf, size_t count) {
  const ssize_t result = read(fd, buf, count);
  if (result == -1) {
    perror("write() error");
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<x_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    117a <x_read+0x4a>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_read>:
push   %rax
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     113d <x_read+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"write() error\00"
@EXIT_FAILURE = global i32 0
define i32 @x_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @read(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [14 x i8] c"write() error\00"
@EXIT_FAILURE = global i32 0
define i32 @x_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret i32 %4
}