xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ die(char *, int);
void noerr(int rc) {
  if (rc != 0)
    die("error %d", rc);
}


x86 assembly (clang, -O0):
<noerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <noerr+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noerr>:
test   %edi,%edi
je     1122 <noerr+0x12>
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <die@plt>
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"error %d\00"
define void @noerr(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
char *GetTelnetKey() { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @GetTelnetKey() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @GetTelnetKey() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int libmesh_C_isnan_longdouble(long double a) {
  printf("libmesh_C_isnan_longdouble is deprecated and should not be used!\n");
  return (a != a);
}


x86 assembly (clang, -O0):
<libmesh_C_isnan_longdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
fldt   -0x10(%rbp)
fucomip %st(0),%st
setp   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libmesh_C_isnan_longdouble>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  0xc(%rsp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
fldt   0xc(%rsp)
fucomip %st(0),%st
setp   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [66 x i8] c"libmesh_C_isnan_longdouble is deprecated and should not be used!\0A\00"
define i32 @libmesh_C_isnan_longdouble(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = fcmp une x86_fp80 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@str = [65 x i8] c"libmesh_C_isnan_longdouble is deprecated and should not be used!\00"
define i32 @libmesh_C_isnan_longdouble(x86_fp80 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%3 = fcmp uno x86_fp80 %0, 0xK00000000000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}
char *strcat(char *a, const char *b) {
  while (*a) {
    a++;
  }
  while (*a++ = *b++)
    ;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strcat+0x2a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcat+0xc>
jmp    112f <strcat+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <strcat+0x5e>
jmp    112f <strcat+0x2f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat+0x10>
ret

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

LLVM IR (-O2):
define noalias i8* @strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, sum;
  scanf("%d%d", &a, &b);
  printf("%d", sum = a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
mov    %esi,-0x10(%rbp)
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct fs_dirent {
  int dummy;
};

/* Variables and functions */
struct fs_dirent *diskfs_dirent_create_file_or_dir(struct fs_dirent *,
                                                   char const *, int);
struct fs_dirent *diskfs_dirent_create_file(struct fs_dirent *d,
                                            const char *name) {
  return diskfs_dirent_create_file_or_dir(d, name, 1);
}


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

x86 assembly (clang, -O2):
<diskfs_dirent_create_file>:
mov    $0x1,%edx
jmp    1030 <diskfs_dirent_create_file_or_dir@plt>

LLVM IR (-O0):
%struct.fs_dirent = type { i32 }
define %struct.fs_dirent* @diskfs_dirent_create_file(%struct.fs_dirent* %0, i8* %1) {
%3 = alloca %struct.fs_dirent*
%4 = alloca i8*
store %struct.fs_dirent* %0, %struct.fs_dirent** %3
store i8* %1, i8** %4
%5 = load %struct.fs_dirent*, %struct.fs_dirent** %3
%6 = load i8*, i8** %4
%7 = call %struct.fs_dirent* @diskfs_dirent_create_file_or_dir(%struct.fs_dirent* %5, i8* %6, i32 1)
ret %struct.fs_dirent* %7
}

LLVM IR (-O2):
%struct.fs_dirent = type { i32 }
define %struct.fs_dirent* @diskfs_dirent_create_file(%struct.fs_dirent* %0, i8* %1) {
%3 = tail call %struct.fs_dirent* @diskfs_dirent_create_file_or_dir(%struct.fs_dirent* %0, i8* %1, i32 1)
ret %struct.fs_dirent* %3
}
/* Variables and functions */
void *malloc(size_t);
void *memcpy(void *, void *, size_t);
void *cp_to_heap(void *ptr, size_t size) {
  void *dest = malloc(size);
  if (dest == NULL) {
    return NULL;
  }
  return memcpy(dest, ptr, size);
}


x86 assembly (clang, -O0):
<cp_to_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <cp_to_heap+0x35>
movq   $0x0,-0x8(%rbp)
jmp    116a <cp_to_heap+0x4a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_to_heap>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <cp_to_heap+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @cp_to_heap(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %0, i64 %1, i1 false)
br label %6
6: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
void *empty_thread(void *arg) {
  pthread_detach(pthread_self());
  pthread_exit(NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<empty_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_thread>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @empty_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @pthread_detach(i32 %3)
%5 = call i32 @pthread_exit(i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @empty_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
/* Variables and functions */
int mm_support();
int ac_mmflag(void) {
  int mm_flag;
  mm_flag = mm_support();
  mm_flag |= 0x0001;
  return (mm_flag);
}


x86 assembly (clang, -O0):
<ac_mmflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <mm_support@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ac_mmflag>:
push   %rax
xor    %eax,%eax
call   1030 <mm_support@plt>
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ac_mmflag() {
%1 = alloca i32
%2 = call i32 (...) @mm_support()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @ac_mmflag() {
%1 = tail call i32 (...) @mm_support()
%2 = or i32 %1, 1
ret i32 %2
}
float tanhf(float x) { return 0.0; }


x86 assembly (clang, -O0):
<tanhf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanhf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tanhf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @tanhf(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_nop();
void test_nop(void) { __builtin_arc_nop(); }


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

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

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

LLVM IR (-O2):
define void @test_nop() {
%1 = tail call i32 (...) @__builtin_arc_nop()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MEVENT;

/* Variables and functions */
int find_pos(char *, int, int *, int *);
int /*<<< orphan*/ printf(char *, char const *, int, int);
void mrep_rep(const char *name, void *rec) {
  int low, high;
  int l = find_pos((char *)rec, sizeof(MEVENT), &low, &high);
  if (l >= 0)
    printf("         %-7s at 0 range %3d .. %3d;\n", name, low, high);
}


x86 assembly (clang, -O0):
<mrep_rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <find_pos@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1169 <mrep_rep+0x49>
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrep_rep>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
call   1040 <find_pos@plt>
test   %eax,%eax
js     115a <mrep_rep+0x3a>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c" %-7s at 0 range %3d .. %3d;\0A\00"
define void @mrep_rep(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @find_pos(i8* %8, i32 4, i32* %5, i32* %6)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c" %-7s at 0 range %3d .. %3d;\0A\00"
define void @mrep_rep(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @find_pos(i8* %1, i32 4, i32* %3, i32* %4)
%8 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %10, i32 %11)
br label %13
13: ; preds = %9, %2
ret void
}
int bar2(int c) {
  if (c < 10)
    c++;
  else
    c--;
  return c << 1;
}


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    111f <bar2+0x1f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <bar2+0x28>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar2>:
lea    0x7fffffff(%rdi),%ecx
lea    0x1(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bar2(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 1, i32 2147483647
%4 = add i32 %3, %0
%5 = shl i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f_memcpy_impl(void *, void *, int *);
void f_memcpy(void *restrict new, void *restrict old, int *length) {
  f_memcpy_impl(new, old, length);
  return;
}


x86 assembly (clang, -O0):
<f_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <f_memcpy_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_memcpy>:
jmp    1030 <f_memcpy_impl@plt>

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

LLVM IR (-O2):
define void @f_memcpy(i8* noalias %0, i8* noalias %1, i32* %2) {
%4 = tail call i32 @f_memcpy_impl(i8* %0, i8* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_raw_bytes(char *data, unsigned long size) {
  int i;
  for (i = 0; i < size; ++i)
    printf("%d, ", data[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_raw_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115d <print_raw_bytes+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <print_raw_bytes+0x17>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

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


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

x86 assembly (clang, -O2):
<gsl_pow_5>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gsl_pow_5(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @gsl_pow_5(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %2
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ mudar(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 0;
  printf("sizeof(n) = %d\n", sizeof(n));
  printf("n = %d\n", n);
  mudar(&n);
  printf("n = %d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <mudar@plt>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
call   1040 <mudar@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"sizeof(n) = %d\0A\00"
@.str.1 = [8 x i8] c"n = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = call i32 @mudar(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int longitud_string(char *s) {
  int i = 0;
  char *p = s;
  while (*(p) != '\0') {
    p++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<longitud_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <longitud_string+0x41>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <longitud_string+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud_string>:
cmpb   $0x0,(%rdi)
je     111c <longitud_string+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <longitud_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @longitud_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int getNumberOfSquares(int n) {
  int count = 0;
  int sum = 0;
  for (int i = 1; i < n; i++) {
    int square = i * i;
    if (sum + square >= n) {
      break;
    }
    sum += square;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<getNumberOfSquares>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <getNumberOfSquares+0x66>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1146 <getNumberOfSquares+0x46>
jmp    1166 <getNumberOfSquares+0x66>
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <getNumberOfSquares+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumberOfSquares>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1134 <getNumberOfSquares+0x34>
lea    -0x1(%rdi),%eax
xor    %edx,%edx
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edx,%esi
mov    %ecx,%edx
imul   %ecx,%edx
add    %esi,%edx
cmp    %edi,%edx
jge    1135 <getNumberOfSquares+0x35>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1120 <getNumberOfSquares+0x20>
ret
add    $0xffffffff,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getNumberOfSquares(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %3, %12
%6 = phi i32 [ %13, %12 ], [ 0, %3 ]
%7 = phi i32 [ %14, %12 ], [ 1, %3 ]
%8 = phi i32 [ %10, %12 ], [ 0, %3 ]
%9 = mul nsw i32 %7, %7
%10 = add nuw nsw i32 %9, %8
%11 = icmp slt i32 %10, %0
br i1 %11, label %12, label %16
12: ; preds = %5
%13 = add nuw nsw i32 %6, 1
%14 = add nuw nsw i32 %7, 1
%15 = icmp eq i32 %13, %4
br i1 %15, label %16, label %5
16: ; preds = %5, %12, %1
%17 = phi i32 [ 0, %1 ], [ %4, %12 ], [ %6, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void io_reg_atomic_set(volatile uint32_t *reg, uint32_t mask) {
  *((volatile uint32_t *)(((uintptr_t)(reg)) | (0x2000U))) = mask;
}


x86 assembly (clang, -O0):
<io_reg_atomic_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     $0x2000,%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_reg_atomic_set>:
or     $0x2000,%rdi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @io_reg_atomic_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i64
%8 = or i64 %7, 8192
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @io_reg_atomic_set(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = or i64 %3, 8192
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
void X509V3_add_value_uchar(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_add_value_uchar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ L1C_CleanInvalidateCache(int /*<<< orphan*/);
__attribute__((always_)) void L1C_InvalidateDCacheAll(void) {
  L1C_CleanInvalidateCache(0);
}


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

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

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

LLVM IR (-O2):
define void @L1C_InvalidateDCacheAll() {
%1 = tail call i32 @L1C_CleanInvalidateCache(i32 0)
ret void
}
t(int s, void **p) {
  int i;
  for (i; i < 10000; i += s)
    p[i] = 0;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1136 <t+0x36>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    110b <t+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @t(i32 %0, i8** nocapture writeonly %1) {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerBaseValid(int);
void TimerRTCDisable(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<TimerRTCDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerRTCDisable>:
push   %rbx
mov    %edi,%ebx
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xffffffef,0xc(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @TimerRTCDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_TimerBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 12
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -17
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @TimerRTCDisable(i32 %0) {
%2 = tail call i32 @_TimerBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 12
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -17
store volatile i32 %8, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __rcu_read_unlock();
__attribute__((always_)) void rcu_read_unlock(void) {
  do {
  } while (0);
  (void)0;
  __rcu_read_unlock();
}


x86 assembly (clang, -O0):
<rcu_read_unlock>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <rcu_read_unlock+0x9>
jmp    111e <rcu_read_unlock+0xe>
mov    $0x0,%al
call   1030 <__rcu_read_unlock@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rcu_read_unlock() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
%3 = call i32 (...) @__rcu_read_unlock()
ret void
}

LLVM IR (-O2):
define void @rcu_read_unlock() {
%1 = tail call i32 (...) @__rcu_read_unlock()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ event;
};
struct TYPE_4__ {
  TYPE_1__ xunmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xunmap_event(void *_p) {
  return (unsigned long)((XEvent *)_p)->xunmap.event;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xunmap_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void BIO_get_callback_arg(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_get_callback_arg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  struct intPtrs {
    int *p1;
    int *p2;
  };
  struct intPtrs pointers;
  int i1 = 100, i2;
  pointers.p1 = &i1;
  pointers.p2 = &i2;
  *pointers.p2 = -97;
  printf("i1 = %i, *pointers.p1 = %i\n", i1, *pointers.p1);
  printf("i2 = %i, *pointers.p2 = %i\n", i2, *pointers.p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffff9f,(%rax)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.intPtrs = type { i32*, i32* }
@.str = [28 x i8] c"i1 = %i, *pointers.p1 = %i\0A\00"
@.str.1 = [28 x i8] c"i2 = %i, *pointers.p2 = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.intPtrs
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %3
%5 = getelementptr inbounds %struct.intPtrs, %struct.intPtrs* %2, i32 0, i32 0
store i32* %3, i32** %5
%6 = getelementptr inbounds %struct.intPtrs, %struct.intPtrs* %2, i32 0, i32 1
store i32* %4, i32** %6
%7 = getelementptr inbounds %struct.intPtrs, %struct.intPtrs* %2, i32 0, i32 1
%8 = load i32*, i32** %7
store i32 -97, i32* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds %struct.intPtrs, %struct.intPtrs* %2, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
%14 = load i32, i32* %4
%15 = getelementptr inbounds %struct.intPtrs, %struct.intPtrs* %2, i32 0, i32 1
%16 = load i32*, i32** %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"i1 = %i, *pointers.p1 = %i\0A\00"
@.str.1 = [28 x i8] c"i2 = %i, *pointers.p2 = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 100, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 -97, i32 -97)
ret i32 0
}
/* Type definitions */
struct geometry_struct {
  int dummy;
};

/* Variables and functions */
int cone_overlaps_box(struct geometry_struct *, struct geometry_struct *);
int box_overlaps_cone(struct geometry_struct *geometry_box,
                      struct geometry_struct *geometry_cone) {
  return cone_overlaps_box(geometry_cone, geometry_box);
}


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

x86 assembly (clang, -O2):
<box_overlaps_cone>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <cone_overlaps_box@plt>

LLVM IR (-O0):
%struct.geometry_struct = type { i32 }
define i32 @box_overlaps_cone(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = alloca %struct.geometry_struct*
%4 = alloca %struct.geometry_struct*
store %struct.geometry_struct* %0, %struct.geometry_struct** %3
store %struct.geometry_struct* %1, %struct.geometry_struct** %4
%5 = load %struct.geometry_struct*, %struct.geometry_struct** %4
%6 = load %struct.geometry_struct*, %struct.geometry_struct** %3
%7 = call i32 @cone_overlaps_box(%struct.geometry_struct* %5, %struct.geometry_struct* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.geometry_struct = type { i32 }
define i32 @box_overlaps_cone(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = tail call i32 @cone_overlaps_box(%struct.geometry_struct* %1, %struct.geometry_struct* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ elg_cntl_msg(char *, char *);
int strlen(char *);
void epk_archive_update(char *filename) {
  int mark = strlen(filename);
  filename[mark] = '+';
  filename[mark + 1] = '\0';
  elg_cntl_msg("Prepared to update archive file %s", filename);
}


x86 assembly (clang, -O0):
<epk_archive_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2b,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1030 <elg_cntl_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epk_archive_update>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
movw   $0x2b,(%rbx,%rax,1)
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <elg_cntl_msg@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Prepared to update archive file %s\00"
define void @epk_archive_update(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 43, i8* %9
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %2
%16 = call i32 @elg_cntl_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Prepared to update archive file %s\00"
define void @epk_archive_update(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 43, i8* %4
%5 = add nsw i32 %2, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i32 @elg_cntl_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int mvprintw(int, int, char const *, float);
int r_mvprintw(int y, int x, const char *fmt, float r) {
  return (mvprintw(y, x, fmt, r));
}


x86 assembly (clang, -O0):
<r_mvprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
movss  -0x14(%rbp),%xmm0
call   1030 <mvprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_mvprintw>:
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
define i32 @r_mvprintw(i32 %0, i32 %1, i8* %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store float %3, float* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load float, float* %8
%13 = call i32 @mvprintw(i32 %9, i32 %10, i8* %11, float %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @r_mvprintw(i32 %0, i32 %1, i8* %2, float %3) {
%5 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* %2, float %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ interchange(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int x = 5, y = 10;
  printf("Originally x = %d and y = %d.\n", x, y);
  interchange(&x, &y);
  printf("Now x = %d and y = %d.\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <interchange@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <interchange@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Originally x = %d and y = %d.\0A\00"
@.str.1 = [24 x i8] c"Now x = %d and y = %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @interchange(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Originally x = %d and y = %d.\0A\00"
@.str.1 = [24 x i8] c"Now x = %d and y = %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 5, i32 10)
%6 = call i32 @interchange(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
void dev_pm_disable_wake_irq(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @dev_pm_disable_wake_irq(%struct.device* nocapture %0) {
ret void
}
void mmmeIInit(void) {
  { return; }
}


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

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

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

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