xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int file_is_dir(const char *file_name) {
  struct stat st;
  if (stat(file_name, &st) == -1)
    return 0;
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<file_is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <file_is_dir+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1159 <file_is_dir+0x39>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <file_is_dir+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_inverse(float *, float *);
__attribute__((always_)) struct mat4 *psmat4_inverse(struct mat4 *result,
                                                     struct mat4 *m) {
  mat4_inverse((float *)result, (float *)m);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_inverse>:
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 <mat4_inverse@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_inverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_inverse@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_inverse(%struct.mat4* %0, %struct.mat4* %1) {
%3 = alloca %struct.mat4*
%4 = alloca %struct.mat4*
store %struct.mat4* %0, %struct.mat4** %3
store %struct.mat4* %1, %struct.mat4** %4
%5 = load %struct.mat4*, %struct.mat4** %3
%6 = bitcast %struct.mat4* %5 to float*
%7 = load %struct.mat4*, %struct.mat4** %4
%8 = bitcast %struct.mat4* %7 to float*
%9 = call i32 @mat4_inverse(float* %6, float* %8)
%10 = load %struct.mat4*, %struct.mat4** %3
ret %struct.mat4* %10
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_inverse(%struct.mat4* returned %0, %struct.mat4* %1) {
%3 = bitcast %struct.mat4* %0 to float*
%4 = bitcast %struct.mat4* %1 to float*
%5 = tail call i32 @mat4_inverse(float* %3, float* %4)
ret %struct.mat4* %0
}
/* Variables and functions */
int close(int);
int ness_os_close(int fd) {
  int r = -1;
  r = close(fd);
  return r;
}


x86 assembly (clang, -O0):
<ness_os_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ness_os_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @ness_os_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void ap9x_pci_setup_wmac_btns(unsigned wmac, struct gpio_keys_button *btns,
                              unsigned num_btns, unsigned poll_interval) {}


x86 assembly (clang, -O0):
<ap9x_pci_setup_wmac_btns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gpio_keys_button = type opaque
define void @ap9x_pci_setup_wmac_btns(i32 %0, %struct.gpio_keys_button* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.gpio_keys_button*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.gpio_keys_button* %1, %struct.gpio_keys_button** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.gpio_keys_button = type opaque
define void @ap9x_pci_setup_wmac_btns(i32 %0, %struct.gpio_keys_button* nocapture %1, i32 %2, i32 %3) {
ret void
}
void umocktypes_free_unsignedshort(unsigned short *value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_unsignedshort(i16* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ stderr;
void *allocate(size_t sz) {
  void *p = malloc(sz);
  if (!p) {
    fprintf(stderr, "out of memory\n");
    return NULL;
  }
  memset(p, 0, sz);
  return p;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <allocate+0x46>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    118d <allocate+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1153 <allocate+0x23>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
jmp    1168 <allocate+0x38>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @allocate(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i64, i64* %3
%15 = call i32 @memset(i8* %13, i32 0, i64 %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %9
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @allocate(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %9
9: ; preds = %7, %4
ret i8* %2
}
void BIO_get_retry_BIO(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_get_retry_BIO() {
ret void
}
void platform_add_devices(void) {}


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

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

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

LLVM IR (-O2):
define void @platform_add_devices() {
ret void
}
void print_memory() {}


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

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

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

LLVM IR (-O2):
define void @print_memory() {
ret void
}
/* Variables and functions */
double ceil(double);
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Ceil(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (ceil(a));
}


x86 assembly (clang, -O0):
<Ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ceil>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <ceil@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.ceil.f64(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @llvm.ceil.f64(double %6)
ret double %7
}
/* Variables and functions */
bool nrf52_errata_135(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_135() {
ret i32 0
}
void I_UpdateCD(void) {}


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

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

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

LLVM IR (-O2):
define void @I_UpdateCD() {
ret void
}
const char *Format_Definition(void) {
  return "struct Format {\n"
         "  int (*format_to)(var,int,const char*,va_list);\n"
         "  int (*format_from)(var,int,const char*,va_list);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [120 x i8] c"struct Format {\0A int (*format_to)(var,int,const char*,va_list);\0A int (*format_from)(var,int,const char*,va_list);\0A};\0A\00"
define i8* @Format_Definition() {
ret i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [120 x i8] c"struct Format {\0A int (*format_to)(var,int,const char*,va_list);\0A int (*format_from)(var,int,const char*,va_list);\0A};\0A\00"
define i8* @Format_Definition() {
ret i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {10, 20, 30, 40, 50};
  int *j;
  j = a;
  j = j + 3;
  printf("%d", *j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 40)
ret i32 0
}
int isPrime(int n) {
  int i;
  if (n <= 1)
    return 0;
  if (n == 2)
    return 1;
  for (i = 2; i < n; i++) {
    if (n % i == 0)
      return 0;
  }
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     111d <isPrime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1175 <isPrime+0x75>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <isPrime+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1175 <isPrime+0x75>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1175 <isPrime+0x75>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1162 <isPrime+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1175 <isPrime+0x75>
jmp    1167 <isPrime+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <isPrime+0x3a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %27
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %2
br label %27
12: ; preds = %8
store i32 2, i32* %4
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 0, i32* %2
br label %27
23: ; preds = %17
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %13
27: ; preds = %7, %11, %22, %13
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t necro_hash(size_t input) { return (size_t)(input * 37); }


x86 assembly (clang, -O0):
<necro_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x25,-0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<necro_hash>:
lea    (%rdi,%rdi,8),%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @necro_hash(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 37
ret i64 %4
}

LLVM IR (-O2):
define i64 @necro_hash(i64 %0) {
%2 = mul i64 %0, 37
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ serial_write_char(char);
unsigned int strlen(char *);
int serial_write(char *buf) {
  unsigned int len = strlen(buf);
  unsigned int i;
  for (i = 0; i < len; i++) {
    serial_write_char(buf[i]);
  }
  return len;
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1169 <serial_write+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <serial_write_char@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <serial_write+0x1f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %eax,%r14d
test   %eax,%eax
je     1153 <serial_write+0x33>
mov    %r14d,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <serial_write_char@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <serial_write+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @serial_write(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @serial_write_char(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void od_aligned_free(void *_ptr) {
  unsigned char *p;
  p = (unsigned char *)_ptr;
  if (p != NULL) {
    int offs;
    offs = *--p;
    free(p - offs);
  }
}


x86 assembly (clang, -O0):
<od_aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <od_aligned_free+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movzbl -0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<od_aligned_free>:
test   %rdi,%rdi
je     1125 <od_aligned_free+0x15>
movzbl -0x1(%rdi),%eax
add    $0xffffffffffffffff,%rdi
sub    %rax,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @od_aligned_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = sub nsw i64 0, %6
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = tail call i32 @free(i8* %8)
br label %10
10: ; preds = %3, %1
ret void
}
int test_imm_96uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x96 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_96uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 150
%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_96uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 150
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int axt_to_uint32(unsigned int axt_uint32) {
  unsigned char *buf = (unsigned char *)&axt_uint32;
  return (((unsigned int)buf[0]) << 24) + (((unsigned int)buf[1]) << 16) +
         (((unsigned int)buf[2]) << 8) + (((unsigned int)buf[3]));
}


x86 assembly (clang, -O0):
<axt_to_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<axt_to_uint32>:
mov    %edi,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @axt_to_uint32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int test_imm_71uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x71 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_71uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 113
%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_71uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 485331304448
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutSwapBuffers();
void guiSwapBuffers() { glutSwapBuffers(); }


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

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

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

LLVM IR (-O2):
define void @guiSwapBuffers() {
%1 = tail call i32 (...) @glutSwapBuffers()
ret void
}
void get_rid_of(char *string) {
  while ('\0' != *string) {
    if ('\r' == *string || '\n' == *string) {
      *string = '\0';
    }
    string++;
  }
}


x86 assembly (clang, -O0):
<get_rid_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1159 <get_rid_of+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
je     1141 <get_rid_of+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    1148 <get_rid_of+0x48>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <get_rid_of+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rid_of>:
jmp    1117 <get_rid_of+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <get_rid_of+0x10>
cmp    $0xd,%al
je     1110 <get_rid_of+0x10>
test   %al,%al
jne    1113 <get_rid_of+0x13>
ret

LLVM IR (-O0):
define void @get_rid_of(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 0, %6
br i1 %7, label %8, label %23
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 13, %11
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 10, %16
br i1 %17, label %18, label %20
18: ; preds = %13, %8
%19 = load i8*, i8** %2
store i8 0, i8* %19
br label %20
20: ; preds = %18, %13
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %3
23: ; preds = %3
ret void
}

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


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

x86 assembly (clang, -O2):
<rc_to_priv>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.xxhash_running_checksum = type opaque
%struct.running_checksum = type opaque
define %struct.xxhash_running_checksum* @rc_to_priv(%struct.running_checksum* %0) {
%2 = alloca %struct.running_checksum*
store %struct.running_checksum* %0, %struct.running_checksum** %2
%3 = load %struct.running_checksum*, %struct.running_checksum** %2
%4 = bitcast %struct.running_checksum* %3 to %struct.xxhash_running_checksum*
ret %struct.xxhash_running_checksum* %4
}

LLVM IR (-O2):
%struct.xxhash_running_checksum = type opaque
%struct.running_checksum = type opaque
define %struct.xxhash_running_checksum* @rc_to_priv(%struct.running_checksum* readnone %0) {
%2 = bitcast %struct.running_checksum* %0 to %struct.xxhash_running_checksum*
ret %struct.xxhash_running_checksum* %2
}
int main() {
  int a, b, c, d, i, j, k;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%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
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
__attribute__((always_)) unsigned long
partial_name_hash(unsigned long c, unsigned long prevhash) {
  return (prevhash + (c << 4) + (c >> 4)) * 11;
}


x86 assembly (clang, -O0):
<partial_name_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
add    %rcx,%rax
imul   $0xb,%rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<partial_name_hash>:
mov    %rdi,%rax
shl    $0x4,%rax
add    %rsi,%rax
shr    $0x4,%rdi
add    %rax,%rdi
lea    (%rdi,%rdi,4),%rax
lea    (%rdi,%rax,2),%rax
ret

LLVM IR (-O0):
define i64 @partial_name_hash(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = shl i64 %6, 4
%8 = add i64 %5, %7
%9 = load i64, i64* %3
%10 = lshr i64 %9, 4
%11 = add i64 %8, %10
%12 = mul i64 %11, 11
ret i64 %12
}

LLVM IR (-O2):
define i64 @partial_name_hash(i64 %0, i64 %1) {
%3 = shl i64 %0, 4
%4 = add i64 %3, %1
%5 = lshr i64 %0, 4
%6 = add i64 %4, %5
%7 = mul i64 %6, 11
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ reverseString(char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char str1[] = "This is a test string";
  reverseString(str1);
  assert(strcmp(str1, "gnirts tset a si sihT") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeaf(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <reverseString@plt>
lea    -0x20(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x676e6972747320,%rax
mov    %rax,0xe(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <reverseString@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str1 = [22 x i8] c"This is a test string\00"
@.str = [22 x i8] c"gnirts tset a si sihT\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [22 x i8]
store i32 0, i32* %1
%3 = bitcast [22 x i8]* %2 to i8*
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%5 = call i32 @reverseString(i8* %4)
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [22 x i8] c"This is a test string\00"
@.str = [22 x i8] c"gnirts tset a si sihT\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverseString(i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}
int OK(int r) { return r == 0; }


x86 assembly (clang, -O0):
<OK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OK>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @OK(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @OK(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int yas_kxtf9_read_reg_byte(int);
int /*<<< orphan*/ yas_kxtf9_write_reg_byte(int, int);
int yas_kxtf9_power_down(void) {
  yas_kxtf9_write_reg_byte(
      0x1b, ((yas_kxtf9_read_reg_byte(0x1b) & ~0x80) | ((0) << 7)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_kxtf9_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1040 <yas_kxtf9_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffff7f,%esi
or     $0x0,%esi
mov    $0x1b,%edi
call   1030 <yas_kxtf9_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_kxtf9_power_down>:
push   %rax
mov    $0x1b,%edi
call   1040 <yas_kxtf9_read_reg_byte@plt>
and    $0xffffff7f,%eax
mov    $0x1b,%edi
mov    %eax,%esi
call   1030 <yas_kxtf9_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_kxtf9_power_down() {
%1 = call i32 @yas_kxtf9_read_reg_byte(i32 27)
%2 = and i32 %1, -129
%3 = or i32 %2, 0
%4 = call i32 @yas_kxtf9_write_reg_byte(i32 27, i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_kxtf9_power_down() {
%1 = tail call i32 @yas_kxtf9_read_reg_byte(i32 27)
%2 = and i32 %1, -129
%3 = tail call i32 @yas_kxtf9_write_reg_byte(i32 27, i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;
typedef int /*<<< orphan*/ n;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int n = 1;
  char c = '1';
  char s[] = "1";
  printf("sizeof 1:%d\n", sizeof(n));
  printf("sizeof '1':%d\n", sizeof(c));
  printf("sizeof \"1\":%d\n", sizeof(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movb   $0x31,-0x5(%rbp)
mov    0xed6(%rip),%ax
mov    %ax,-0x7(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [2 x i8] c"1\00"
@.str = [13 x i8] c"sizeof 1:%d\0A\00"
@.str.1 = [15 x i8] c"sizeof '1':%d\0A\00"
@.str.2 = [15 x i8] c"sizeof \221\22:%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [2 x i8]
store i32 1, i32* %1
store i8 49, i8* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"sizeof 1:%d\0A\00"
@.str.1 = [15 x i8] c"sizeof '1':%d\0A\00"
@.str.2 = [15 x i8] c"sizeof \221\22:%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret void
}
unsigned int absv(int value) { return value > 0 ? value : -value; }


x86 assembly (clang, -O0):
<absv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <absv+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absv+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absv>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @absv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absv(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MTU2_ch3_restart();
void tcnt_restart(void) { MTU2_ch3_restart(); }


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

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

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

LLVM IR (-O2):
define void @tcnt_restart() {
%1 = tail call i32 (...) @MTU2_ch3_restart()
ret void
}
int rl_reverse_search_history(sign, key)
int sign, key;
{ return (rl_search_history(-sign, key)); }


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

x86 assembly (clang, -O2):
<rl_reverse_search_history>:
neg    %edi
xor    %eax,%eax
jmp    1030 <rl_search_history@plt>

LLVM IR (-O0):
define i32 @rl_reverse_search_history(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 = sub nsw i32 0, %5
%7 = load i32, i32* %4
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_search_history to i32 (i32, i32, ...)*)(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rl_reverse_search_history(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_search_history to i32 (i32, i32, ...)*)(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
float __nv_frcp_ru(float);
float __frcp_ru(float __a) { return __nv_frcp_ru(__a); }


x86 assembly (clang, -O0):
<__frcp_ru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_frcp_ru@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__frcp_ru>:
jmp    1030 <__nv_frcp_ru@plt>

LLVM IR (-O0):
define float @__frcp_ru(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__nv_frcp_ru(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__frcp_ru(float %0) {
%2 = tail call float @__nv_frcp_ru(float %0)
ret float %2
}
/* Variables and functions */
unsigned long get_unaligned(unsigned long *);
unsigned long flat_get_addr_from_rp(unsigned long *rp, unsigned long relval,
                                    unsigned long flags) {
  unsigned long addr = get_unaligned(rp);
  (void)flags;
  if (relval & 0x80000000)
    addr &= 0x003fffff;
  else if (relval & 0x40000000)
    addr &= 0x000003ff;
  return (addr);
}


x86 assembly (clang, -O0):
<flat_get_addr_from_rp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_unaligned@plt>
mov    %rax,-0x20(%rbp)
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     115c <flat_get_addr_from_rp+0x4c>
mov    -0x20(%rbp),%rax
and    $0x3fffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1183 <flat_get_addr_from_rp+0x73>
mov    -0x10(%rbp),%rax
and    $0x40000000,%rax
cmp    $0x0,%rax
je     117e <flat_get_addr_from_rp+0x6e>
mov    -0x20(%rbp),%rax
and    $0x3ff,%rax
mov    %rax,-0x20(%rbp)
jmp    1183 <flat_get_addr_from_rp+0x73>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flat_get_addr_from_rp>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_unaligned@plt>
test   $0x80000000,%ebx
jne    1135 <flat_get_addr_from_rp+0x25>
mov    %eax,%ecx
and    $0x3ff,%ecx
test   $0x40000000,%ebx
cmovne %rcx,%rax
pop    %rbx
ret
and    $0x3fffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @flat_get_addr_from_rp(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = call i64 @get_unaligned(i64* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = and i64 %11, 2147483648
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i64, i64* %7
%16 = and i64 %15, 4194303
store i64 %16, i64* %7
br label %25
17: ; preds = %3
%18 = load i64, i64* %5
%19 = and i64 %18, 1073741824
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i64, i64* %7
%23 = and i64 %22, 1023
store i64 %23, i64* %7
br label %24
24: ; preds = %21, %17
br label %25
25: ; preds = %24, %14
%26 = load i64, i64* %7
ret i64 %26
}

LLVM IR (-O2):
define i64 @flat_get_addr_from_rp(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 @get_unaligned(i64* %0)
%5 = and i64 %1, 2147483648
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i64 %4, 4194303
br label %14
9: ; preds = %3
%10 = and i64 %1, 1073741824
%11 = icmp eq i64 %10, 0
%12 = and i64 %4, 1023
%13 = select i1 %11, i64 %4, i64 %12
br label %14
14: ; preds = %9, %7
%15 = phi i64 [ %8, %7 ], [ %13, %9 ]
ret i64 %15
}
/* Type definitions */
typedef int useconds_t;
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int __nanosleep(struct timespec *, int /*<<< orphan*/ *);
int usleep(useconds_t useconds) {
  struct timespec ts = {.tv_sec = (long int)(useconds / 1000000),
                        .tv_nsec = (long int)(useconds % 1000000) * 1000ul};
  return __nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <__nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rsp)
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
cltq
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <__nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000
%7 = sext i32 %6 to i64
store i64 %7, i64* %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 1000
store i64 %12, i64* %8
%13 = call i32 @__nanosleep(%struct.timespec* %3, i32* null)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = sdiv i32 %0, 1000000
%6 = sext i32 %5 to i64
store i64 %6, i64* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%8 = srem i32 %0, 1000000
%9 = mul nsw i32 %8, 1000
%10 = sext i32 %9 to i64
store i64 %10, i64* %7
%11 = call i32 @__nanosleep(%struct.timespec* %2, i32* null)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
int Is_numeric(char *s) {
  while (*s)
    if (!isdigit((int)(unsigned char)*(s++)))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<Is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <Is_numeric+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <Is_numeric+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <Is_numeric+0x51>
jmp    111c <Is_numeric+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Is_numeric>:
movzbl (%rdi),%eax
test   %eax,%eax
je     1116 <Is_numeric+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <Is_numeric>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Is_numeric(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = zext i8 %4 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ override_redirect;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
int get_XConfigureEvent_override_redirect(void *_p) {
  return (int)((XConfigureEvent *)_p)->override_redirect;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureEvent_override_redirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureEvent_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}