xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ endwin();
void nc_end(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @nc_end() {
%1 = tail call i32 (...) @endwin()
ret void
}
void dummy_foreground(int color) { color = color; }


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

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

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

LLVM IR (-O2):
define void @dummy_foreground(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ withdraw(void *);
void *withdraw_thread(void *arg) { withdraw(arg); }


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

x86 assembly (clang, -O2):
<withdraw_thread>:
jmp    1030 <withdraw@plt>

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

LLVM IR (-O2):
define noalias i8* @withdraw_thread(i8* %0) {
%2 = tail call i32 @withdraw(i8* %0)
ret i8* undef
}
int gtm_event_log_close() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gtm_event_log_close() {
ret i32 0
}
void gtk_icon_view_get_spacing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_spacing() {
ret void
}
_Complex long double test_cacosl(_Complex long double x) {
  return __builtin_cacosl(x);
}


x86 assembly (clang, -O0):
<test_cacosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <cacosl@plt>
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cacosl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fxch   %st(1)
fstpt  0x20(%rsp)
fstpt  0x30(%rsp)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <cacosl@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @test_cacosl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = call { x86_fp80, x86_fp80 } @cacosl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%11 = extractvalue { x86_fp80, x86_fp80 } %10, 0
%12 = extractvalue { x86_fp80, x86_fp80 } %10, 1
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %13
store x86_fp80 %12, x86_fp80* %14
%15 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %15
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @test_cacosl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %4, x86_fp80* %7
store x86_fp80 %6, x86_fp80* %8
%9 = tail call { x86_fp80, x86_fp80 } @cacosl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
ret { x86_fp80, x86_fp80 } %9
}
/* Type definitions */
typedef int u_int8_t;
typedef int u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, int *, int);
u_int32_t be_read32(int fd) {
  u_int32_t word;
  u_int8_t buf[4];
  read(fd, buf, 4);
  word = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
  return word;
}


x86 assembly (clang, -O0):
<be_read32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    -0x20(%rbp),%eax
shl    $0x18,%eax
mov    -0x1c(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_read32>:
sub    $0x18,%rsp
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rsp),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @be_read32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x i32]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%7 = call i32 @read(i32 %5, i32* %6, i32 4)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%9 = load i32, i32* %8
%10 = shl i32 %9, 24
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = or i32 %14, %17
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
%20 = load i32, i32* %19
%21 = or i32 %18, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @be_read32(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @read(i32 %0, i32* %4, i32 4)
%6 = load i32, i32* %4
%7 = shl i32 %6, 24
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %10, %7
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%17 = load i32, i32* %16
%18 = or i32 %15, %17
ret i32 %18
}
int is_in_bound(int *arr, int size, int *ptr) {
  for (int i = 0; i < size; i++) {
    if (arr + i == ptr) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <is_in_bound+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
jne    1147 <is_in_bound+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1161 <is_in_bound+0x61>
jmp    114c <is_in_bound+0x4c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <is_in_bound+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
movslq %esi,%r8
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rsi
cmp    %r8,%rax
jge    1128 <is_in_bound+0x28>
lea    0x1(%rsi),%rax
lea    0x4(%rdi),%rcx
cmp    %rdx,%rdi
mov    %rcx,%rdi
jne    1110 <is_in_bound+0x10>
xor    %eax,%eax
cmp    %r8,%rsi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = sext i32 %1 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %12, %5 ], [ 0, %3 ]
%7 = icmp slt i64 %6, %4
%8 = xor i1 %7, true
%9 = getelementptr inbounds i32, i32* %0, i64 %6
%10 = icmp eq i32* %9, %2
%11 = select i1 %8, i1 true, i1 %10
%12 = add nuw i64 %6, 1
br i1 %11, label %13, label %5
13: ; preds = %5
%14 = zext i1 %7 to i32
ret i32 %14
}
double max(double a, double b) { return (a < b ? b : a); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <max+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <max+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_0() {
  char *x = "abcde";
  char *y = "aBd";
  clang_analyzer_eval(strncasecmp(x, y, 5) == -1);
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_diff_length_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"aBd\00"
define void @strncasecmp_diff_length_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 5)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"aBd\00"
define void @strncasecmp_diff_length_0() {
%1 = tail call i32 @strncasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
char *buff_addb(char *, char *, char const *, int);
int strlen(char const *);
char *buff_adds(char *buff, char *buffEnd, const char *s) {
  int slen = strlen(s);
  return buff_addb(buff, buffEnd, s, slen);
}


x86 assembly (clang, -O0):
<buff_adds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <buff_addb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buff_adds>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <buff_addb@plt>

LLVM IR (-O0):
define i8* @buff_adds(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i8* @buff_addb(i8* %10, i8* %11, i8* %12, i32 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @buff_adds(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i8* @buff_addb(i8* %0, i8* %1, i8* %2, i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP(int /*<<< orphan*/ *, void *, size_t);
int /*<<< orphan*/ reverse(void *, size_t);
size_t read_FP_BE(FILE *fp, void *data, size_t size) {
  size_t count = read_FP(fp, data, size);
  reverse(data, size);
  return count;
}


x86 assembly (clang, -O0):
<read_FP_BE>:
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 <read_FP@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <reverse@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_FP_BE>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <read_FP@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <reverse@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @read_FP_BE(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @read_FP(i32* %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @reverse(i8* %12, i64 %13)
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @read_FP_BE(i32* %0, i8* %1, i64 %2) {
%4 = tail call i64 @read_FP(i32* %0, i8* %1, i64 %2)
%5 = tail call i32 @reverse(i8* %1, i64 %2)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
void *try_get_shm(int /*<<< orphan*/, size_t, int);
void *get_shm(key_t key, size_t size) {
  void *ptr;
  ptr = try_get_shm(key, size, IPC_CREAT | IPC_EXCL | 0600);
  if (ptr == NULL)
    ptr = try_get_shm(key, size, 0);
  return ptr;
}


x86 assembly (clang, -O0):
<get_shm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
mov    0x2eba(%rip),%rax
or     (%rax),%edx
or     $0x180,%edx
call   1030 <try_get_shm@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <get_shm+0x54>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <try_get_shm@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shm>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
or     (%rax),%edx
or     $0x180,%edx
call   1030 <try_get_shm@plt>
test   %rax,%rax
je     1141 <get_shm+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <try_get_shm@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i8* @get_shm(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = load i32, i32* @IPC_CREAT
%9 = load i32, i32* @IPC_EXCL
%10 = or i32 %8, %9
%11 = or i32 %10, 384
%12 = call i8* @try_get_shm(i32 %6, i64 %7, i32 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* %3
%17 = load i64, i64* %4
%18 = call i8* @try_get_shm(i32 %16, i64 %17, i32 0)
store i8* %18, i8** %5
br label %19
19: ; preds = %15, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i8* @get_shm(i32 %0, i64 %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = load i32, i32* @IPC_EXCL
%5 = or i32 %3, %4
%6 = or i32 %5, 384
%7 = tail call i8* @try_get_shm(i32 %0, i64 %1, i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i8* @try_get_shm(i32 %0, i64 %1, i32 0)
br label %11
11: ; preds = %9, %2
%12 = phi i8* [ %10, %9 ], [ %7, %2 ]
ret i8* %12
}
int fun_2(int a, int b) {
  int c;
  c = a + b;
  return c;
}


x86 assembly (clang, -O0):
<fun_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_2>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @fun_2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
void memset_c(char *dest, char c, size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    dest[i] = c;
  }
}


x86 assembly (clang, -O0):
<memset_c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1147 <memset_c+0x47>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <memset_c+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_c>:
test   %rdx,%rdx
je     1123 <memset_c+0x13>
push   %rax
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @memset_c(i8* nocapture writeonly %0, i8 signext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret void
}
void EC_KEY_get_enc_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_get_enc_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sumd(int);
main() {
  int num;
  printf("Enter a number: ");
  scanf("%d", &num);
  printf("Sum of digit is:%d\n", sumd(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <sumd@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <sumd@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Sum of digit is:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @sumd(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Sum of digit is:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sumd(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int re_match(bufp, string, size, pos, regs)
struct re_pattern_buffer *bufp;
const char *string;
int size, pos;
struct re_registers *regs;
{
  int result =
      re_match_2_internal(bufp, (void *)0, 0, string, size, pos, regs, size);
  return result;
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
xor    %edx,%edx
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <re_match_2_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rax
mov    %r8,%r10
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
call   1030 <re_match_2_internal@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
%11 = alloca i32
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%12 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load %struct.re_registers*, %struct.re_registers** %10
%17 = load i32, i32* %8
%18 = call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %12, i8* null, i32 0, i8* %13, i32 %14, i32 %15, %struct.re_registers* %16, i32 %17)
store i32 %18, i32* %11
%19 = load i32, i32* %11
ret i32 %19
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i8* null, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: hostname [-s] [name-of-host]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: hostname [-s] [name-of-host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: hostname [-s] [name-of-host]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_C8uint8_reg(unsigned char val) {
  return ((val) & (0xC8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C8uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xc8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C8uint8_reg>:
test   $0xc8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -56
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ phys_to_virt(int);
int /*<<< orphan*/ printk(char *);
void store_NMI_vector(unsigned short *high, unsigned short *low) {
  printk("Storing NMI vector\n");
  *high = *((volatile unsigned short *)phys_to_virt((0xa)));
  *low = *((volatile unsigned short *)phys_to_virt((0x8)));
}


x86 assembly (clang, -O0):
<store_NMI_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printk@plt>
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
mov    (%rax),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
mov    (%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_NMI_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <printk@plt>
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
movzwl (%rax),%eax
mov    %ax,(%rbx)
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
movzwl (%rax),%eax
mov    %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Storing NMI vector\0A\00"
define void @store_NMI_vector(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call i32 @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @phys_to_virt(i32 10)
%7 = inttoptr i64 %6 to i16*
%8 = load volatile i16, i16* %7
%9 = load i16*, i16** %3
store i16 %8, i16* %9
%10 = call i64 @phys_to_virt(i32 8)
%11 = inttoptr i64 %10 to i16*
%12 = load volatile i16, i16* %11
%13 = load i16*, i16** %4
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Storing NMI vector\0A\00"
define void @store_NMI_vector(i16* nocapture writeonly %0, i16* nocapture writeonly %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @phys_to_virt(i32 10)
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
store i16 %6, i16* %0
%7 = tail call i64 @phys_to_virt(i32 8)
%8 = inttoptr i64 %7 to i16*
%9 = load volatile i16, i16* %8
store i16 %9, i16* %1
ret void
}
int cloneEmail(int msg) {
  int retValue_acc;
  {
    retValue_acc = msg;
    return (retValue_acc);
    return (retValue_acc);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @cloneEmail(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char tolower(char a) {
  if (a >= 'A' && a <= 'Z')
    return a + 32;
  return a;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <tolower+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <tolower+0x33>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <tolower+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @tolower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @tolower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello World.\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct clock_ops {
  int dummy;
};

/* Variables and functions */
struct clock_ops *probe_for_kd_clock(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.clock_ops = type { i32 }
define %struct.clock_ops* @probe_for_kd_clock() {
ret %struct.clock_ops* null
}

LLVM IR (-O2):
%struct.clock_ops = type { i32 }
define noalias %struct.clock_ops* @probe_for_kd_clock() {
ret %struct.clock_ops* null
}
/* Type definitions */
typedef int uint_fast32_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t hash(const char *s0) {
  const unsigned char *s = (void *)s0;
  uint_fast32_t h = 0;
  while (*s) {
    h = 16 * h + *s++;
    h ^= h >> 24 & 0xf0;
  }
  return h & 0xfffffff;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <hash+0x57>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x18,%eax
and    $0xf0,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hash+0x17>
mov    -0x14(%rbp),%eax
and    $0xfffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <hash+0x33>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%eax
movzbl %cl,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x18,%eax
and    $0xfffffff0,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0xfffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(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
store i32 0, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %4
%12 = mul nsw i32 16, %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
%17 = add nsw i32 %12, %16
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = ashr i32 %18, 24
%20 = and i32 %19, 240
%21 = load i32, i32* %4
%22 = xor i32 %21, %20
store i32 %22, i32* %4
br label %6
23: ; preds = %6
%24 = load i32, i32* %4
%25 = and i32 %24, 268435455
ret i32 %25
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %14, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl nsw i32 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = lshr i32 %11, 24
%13 = and i32 %12, 240
%14 = xor i32 %13, %11
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %14, 268435455
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 0, %1 ], [ %18, %17 ]
ret i32 %20
}
__attribute__((no)) void Write(int *ptr) { *ptr = 0; }


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

x86 assembly (clang, -O2):
<Write>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @Write(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
void bar(int a) {
  __panic(__func__,
          "hello world %d\n"
          "%.0s",
          1, "dummy");
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x1,%edx
lea    0xee3(%rip),%rcx
mov    $0x0,%al
call   1030 <__panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xef3(%rip),%rcx
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <__panic@plt>

LLVM IR (-O0):
@__func__.bar = [4 x i8] c"bar\00"
@.str = [20 x i8] c"hello world %d\0A%.0s\00"
@.str.1 = [6 x i8] c"dummy\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__panic to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.bar, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.bar = [4 x i8] c"bar\00"
@.str = [20 x i8] c"hello world %d\0A%.0s\00"
@.str.1 = [6 x i8] c"dummy\00"
define void @bar(i32 %0) {
%2 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__panic to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.bar, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void SPICRCPolSet(unsigned long ulBase, unsigned long ulCRCPol) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ulCRCPol;
}


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

x86 assembly (clang, -O2):
<SPICRCPolSet>:
mov    %rsi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @SPICRCPolSet(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 = add i64 %6, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @SPICRCPolSet(i64 %0, i64 %1) {
%3 = add i64 %0, 16
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int bbs(int x) { return (x * x) % (11 * 19); }


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

x86 assembly (clang, -O2):
<bbs>:
mov    %edi,%eax
imul   %eax,%eax
mov    $0x9cc8e161,%ecx
imul   %rax,%rcx
shr    $0x27,%rcx
imul   $0xd1,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bbs(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = urem i32 %2, 209
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_getcwd();
int main(int argc, char **argv) {
  if (!test_getcwd())
    return 1;
  puts("OK");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_getcwd@plt>
cmp    $0x0,%eax
jne    1152 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x45>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_getcwd@plt>
test   %eax,%eax
je     113c <main+0x1c>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
jmp    1141 <main+0x21>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_getcwd()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void PrintHello(int id) { printf("Hello World! It's me, id #%d!\n", id); }


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

x86 assembly (clang, -O2):
<PrintHello>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Hello World! It's me, id #%d!\0A\00"
define void @PrintHello(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hello World! It's me, id #%d!\0A\00"
define void @PrintHello(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int g(int x) { return (x + 10) < 0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
cmp    $0xfffffff6,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp slt i32 %0, -10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ digraphs(int, char const **);
int /*<<< orphan*/ trigraphs(int, char const **);
int /*<<< orphan*/ whoFramedRogerRabbitSpolier();
int main(int argc, const char *argv[]) {
  digraphs(argc, argv);
  trigraphs(argc, argv);
  whoFramedRogerRabbitSpolier();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <digraphs@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <trigraphs@plt>
mov    $0x0,%al
call   1050 <whoFramedRogerRabbitSpolier@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <digraphs@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <trigraphs@plt>
xor    %eax,%eax
call   1050 <whoFramedRogerRabbitSpolier@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @digraphs(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @trigraphs(i32 %9, i8** %10)
%12 = call i32 (...) @whoFramedRogerRabbitSpolier()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @digraphs(i32 %0, i8** %1)
%4 = tail call i32 @trigraphs(i32 %0, i8** %1)
%5 = tail call i32 (...) @whoFramedRogerRabbitSpolier()
ret i32 0
}
/* Type definitions */
struct mem_block {
  int dummy;
};

/* Variables and functions */
struct mem_block *memory_tracker_find(size_t);
int /*<<< orphan*/ memory_tracker_lock_mutex();
int /*<<< orphan*/ memory_tracker_unlock_mutex();
struct mem_block *vpx_memory_tracker_find(size_t addr) {
  struct mem_block *p = NULL;
  if (!memory_tracker_lock_mutex()) {
    p = memory_tracker_find(addr);
    memory_tracker_unlock_mutex();
  }
  return p;
}


x86 assembly (clang, -O0):
<vpx_memory_tracker_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <memory_tracker_lock_mutex@plt>
cmp    $0x0,%eax
jne    1168 <vpx_memory_tracker_find+0x38>
mov    -0x8(%rbp),%rdi
call   1050 <memory_tracker_find@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <memory_tracker_unlock_mutex@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpx_memory_tracker_find>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <memory_tracker_lock_mutex@plt>
test   %eax,%eax
je     1143 <vpx_memory_tracker_find+0x13>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <memory_tracker_find@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <memory_tracker_unlock_mutex@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mem_block = type { i32 }
define %struct.mem_block* @vpx_memory_tracker_find(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.mem_block*
store i64 %0, i64* %2
store %struct.mem_block* null, %struct.mem_block** %3
%4 = call i32 (...) @memory_tracker_lock_mutex()
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call %struct.mem_block* @memory_tracker_find(i64 %7)
store %struct.mem_block* %8, %struct.mem_block** %3
%9 = call i32 (...) @memory_tracker_unlock_mutex()
br label %10
10: ; preds = %6, %1
%11 = load %struct.mem_block*, %struct.mem_block** %3
ret %struct.mem_block* %11
}

LLVM IR (-O2):
%struct.mem_block = type { i32 }
define %struct.mem_block* @vpx_memory_tracker_find(i64 %0) {
%2 = tail call i32 (...) @memory_tracker_lock_mutex()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call %struct.mem_block* @memory_tracker_find(i64 %0)
%6 = tail call i32 (...) @memory_tracker_unlock_mutex()
br label %7
7: ; preds = %4, %1
%8 = phi %struct.mem_block* [ null, %1 ], [ %5, %4 ]
ret %struct.mem_block* %8
}