xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_stored_address();
int main(int argc, char *argv[]) {
  printf("Hello, world!\n");
  show_stored_address();
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <show_stored_address@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @show_stored_address()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @show_stored_address()
ret i32 0
}
int main() {
  int var1;
  char var2[10];
  printf("Address of a var1 variable: %x\n", &var1);
  printf("Address of a var2 variable: %x\n", &var2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    0xe(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Address of a var1 variable: %x\0A\00"
@.str.1 = [32 x i8] c"Address of a var2 variable: %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), [10 x i8]* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Address of a var1 variable: %x\0A\00"
@.str.1 = [32 x i8] c"Address of a var2 variable: %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), [10 x i8]* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
short hasAcceptableSize(FILE *file) {
  fseek(file, 0, SEEK_END);
  long fileSize = ftell(file);
  return (400000 <= fileSize && fileSize <= 600000);
}


x86 assembly (clang, -O0):
<hasAcceptableSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    $0x61a80,%ecx
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jg     116f <hasAcceptableSize+0x4f>
cmpq   $0x927c0,-0x10(%rbp)
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasAcceptableSize>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
add    $0xfffffffffff9e580,%rax
xor    %ecx,%ecx
cmp    $0x30d41,%rax
setb   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define signext i16 @hasAcceptableSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = icmp sle i64 400000, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = icmp sle i64 %12, 600000
br label %14
14: ; preds = %11, %1
%15 = phi i1 [ false, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define signext i16 @hasAcceptableSize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = add i64 %4, -400000
%6 = icmp ult i64 %5, 200001
%7 = zext i1 %6 to i16
ret i16 %7
}
void __haddock_hal_stm32f103_init(void) {}


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

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

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

LLVM IR (-O2):
define void @__haddock_hal_stm32f103_init() {
ret void
}
int test_imm_E4uint8_reg(unsigned char val) {
  return ((val) & (-0xE4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E4uint8_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, -228
%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_E4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 28
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void find_least_num(int *num, int len) {}


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

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

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

LLVM IR (-O2):
define void @find_least_num(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int u8iscyrilici(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8iscyriliccc(const char *c) { return u8iscyrilici(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8iscyriliccc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8iscyrilici@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8iscyriliccc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8iscyrilici@plt>

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

LLVM IR (-O2):
define i32 @u8iscyriliccc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8iscyrilici(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void __no_val_copy_1_print(void *c, void *k, void *v) {
  fprintf(stdout, "(%ld, %ld)\n", *(int64_t *)k, *(int64_t *)v);
}


x86 assembly (clang, -O0):
<__no_val_copy_1_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__no_val_copy_1_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%eax
mov    (%rdx),%ecx
lea    0xedc(%rip),%rsi
mov    %eax,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"(%ld, %ld)\0A\00"
define void @__no_val_copy_1_print(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"(%ld, %ld)\0A\00"
define void @__no_val_copy_1_print(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* @stdout
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %2 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int check_history_size(char *filename) {
  struct stat st;
  if (stat(filename, &st) == 0) {
    if (st.st_size < 300000)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_history_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1151 <check_history_size+0x41>
cmpl   $0x493e0,-0x18(%rbp)
jge    114c <check_history_size+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1158 <check_history_size+0x48>
jmp    1151 <check_history_size+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_history_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
setne  %al
cmpl   $0x493e0,(%rsp)
setge  %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_history_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 299999
%9 = select i1 %5, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int getIntensityFast(int R, int G, int B) {
  return (R + R + R + B + G + G + G + G) >> 3;
}


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

x86 assembly (clang, -O2):
<getIntensityFast>:
lea    (%rdi,%rdi,2),%eax
add    %edx,%eax
lea    (%rax,%rsi,4),%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @getIntensityFast(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 3
%5 = add nsw i32 %4, %2
%6 = shl i32 %1, 2
%7 = add i32 %5, %6
%8 = ashr i32 %7, 3
ret i32 %8
}
void __attribute__((
    warning("curl_easy_setopt expects a curl_off_t argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_curl_off_t(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_curl_off_t() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sieve(long long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long num;
  printf("Enter the number: ");
  scanf("%lld", &num);
  printf("Below are the prime numbers smaller than or equal to %lld \n", num);
  Sieve(num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <Sieve@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   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rsi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1030 <Sieve@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [60 x i8] c"Below are the prime numbers smaller than or equal to %lld \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %2
%8 = call i32 @Sieve(i64 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [60 x i8] c"Below are the prime numbers smaller than or equal to %lld \0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %1
%8 = call i32 @Sieve(i64 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ jump();
int main(void) {
start:
  foo();
  switch (1) {
  case 0:
    if (jump())
      goto start;
    foo();
    break;
  default:
    break;
  }
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
void test_create() {}


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

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

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

LLVM IR (-O2):
define void @test_create() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __pfcq_debug(int, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int const);
void __pfcq_fail(const char *_message, const int _errno) {
  __pfcq_debug(1, "%s: %s\n", _message, strerror(_errno));
  return;
}


x86 assembly (clang, -O0):
<__pfcq_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    $0x1,%edi
lea    0xeaf(%rip),%rsi
call   1030 <__pfcq_debug@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfcq_fail>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <strerror@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1030 <__pfcq_debug@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
define void @__pfcq_fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @strerror(i32 %6)
%8 = call i32 @__pfcq_debug(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
define void @__pfcq_fail(i8* %0, i32 %1) {
%3 = tail call i32 @strerror(i32 %1)
%4 = tail call i32 @__pfcq_debug(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
void *fopen(char *, char *);
void *dflt_open(char *f) { return fopen(f, "r"); }


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

x86 assembly (clang, -O2):
<dflt_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i8* @dflt_open(i8* nocapture %0) {
%2 = tail call i8* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ PS2_ISR();
int __builtin_rdctl(int);
int /*<<< orphan*/ interval_timer_ISR();
void interrupt_handler(void) {
  int ipending;
  do {
    ipending = __builtin_rdctl(4);
  } while (0);
  if (ipending & 0x01) {
    interval_timer_ISR();
  }
  if (ipending & 0x80) {
    PS2_ISR();
  }
  return;
}


x86 assembly (clang, -O0):
<interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <__builtin_rdctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     115b <interrupt_handler+0x2b>
mov    $0x0,%al
call   1040 <interval_timer_ISR@plt>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1173 <interrupt_handler+0x43>
mov    $0x0,%al
call   1030 <PS2_ISR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_handler>:
push   %rbx
mov    $0x4,%edi
call   1050 <__builtin_rdctl@plt>
mov    %eax,%ebx
test   $0x1,%bl
je     1149 <interrupt_handler+0x19>
xor    %eax,%eax
call   1040 <interval_timer_ISR@plt>
test   $0x80,%bl
jne    1150 <interrupt_handler+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <PS2_ISR@plt>

LLVM IR (-O0):
define void @interrupt_handler() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @__builtin_rdctl(i32 4)
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 (...) @interval_timer_ISR()
br label %10
10: ; preds = %8, %4
%11 = load i32, i32* %1
%12 = and i32 %11, 128
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @PS2_ISR()
br label %16
16: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
define void @interrupt_handler() {
%1 = tail call i32 @__builtin_rdctl(i32 4)
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @interval_timer_ISR()
br label %6
6: ; preds = %4, %0
%7 = and i32 %1, 128
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @PS2_ISR()
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testFullValues();
int /*<<< orphan*/ testIsPrime();
int /*<<< orphan*/ testPrimeValues();
void testAll() {
  testFullValues();
  testIsPrime();
  testPrimeValues();
}


x86 assembly (clang, -O0):
<testAll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <testFullValues@plt>
mov    $0x0,%al
call   1040 <testIsPrime@plt>
mov    $0x0,%al
call   1030 <testPrimeValues@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAll>:
push   %rax
xor    %eax,%eax
call   1050 <testFullValues@plt>
xor    %eax,%eax
call   1040 <testIsPrime@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <testPrimeValues@plt>

LLVM IR (-O0):
define void @testAll() {
%1 = call i32 (...) @testFullValues()
%2 = call i32 (...) @testIsPrime()
%3 = call i32 (...) @testPrimeValues()
ret void
}

LLVM IR (-O2):
define void @testAll() {
%1 = tail call i32 (...) @testFullValues()
%2 = tail call i32 (...) @testIsPrime()
%3 = tail call i32 (...) @testPrimeValues()
ret void
}
extern double flsum8(double x1, double x2, double x3, double x4, double x5,
                     double x6, double x7, double x8) {
  return (x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8);
}


x86 assembly (clang, -O0):
<flsum8>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flsum8>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
ret

LLVM IR (-O0):
define double @flsum8(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%17 = load double, double* %9
%18 = load double, double* %10
%19 = fadd double %17, %18
%20 = load double, double* %11
%21 = fadd double %19, %20
%22 = load double, double* %12
%23 = fadd double %21, %22
%24 = load double, double* %13
%25 = fadd double %23, %24
%26 = load double, double* %14
%27 = fadd double %25, %26
%28 = load double, double* %15
%29 = fadd double %27, %28
%30 = load double, double* %16
%31 = fadd double %29, %30
ret double %31
}

LLVM IR (-O2):
define double @flsum8(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = fadd double %0, %1
%10 = fadd double %9, %2
%11 = fadd double %10, %3
%12 = fadd double %11, %4
%13 = fadd double %12, %5
%14 = fadd double %13, %6
%15 = fadd double %14, %7
ret double %15
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t f2(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (~x & z); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
int mocked_int_function2() {
  ;
  return -2;
}


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

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

LLVM IR (-O0):
define i32 @mocked_int_function2() {
ret i32 -2
}

LLVM IR (-O2):
define i32 @mocked_int_function2() {
ret i32 -2
}
void RTMsgWarningV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMsgWarningV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void inthander(int s) {
  printf("Received signal %d ....waiting\n", s);
  sleep(2);
  printf("Leaving inthander");
}


x86 assembly (clang, -O0):
<inthander>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthander>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xede(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Received signal %d ....waiting\0A\00"
@.str.1 = [18 x i8] c"Leaving inthander\00"
define void @inthander(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 2)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Received signal %d ....waiting\0A\00"
@.str.1 = [18 x i8] c"Leaving inthander\00"
define void @inthander(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char c = 'a';
  while (c <= 'g') {
    printf("%c", c);
    c++;
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x67,%eax
jg     114f <main+0x3f>
movsbl -0x5(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
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
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x66,%edi
call   1030 <putchar@plt>
mov    $0x67,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 103
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8, i8* %2
%12 = add i8 %11, 1
store i8 %12, i8* %2
br label %3
13: ; preds = %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 97)
%2 = tail call i32 @putchar(i32 98)
%3 = tail call i32 @putchar(i32 99)
%4 = tail call i32 @putchar(i32 100)
%5 = tail call i32 @putchar(i32 101)
%6 = tail call i32 @putchar(i32 102)
%7 = tail call i32 @putchar(i32 103)
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
int isdigit(int c) {
  if (c == 0)
    return 0;
  if (c < 0 && c > 'A') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <isdigit+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <isdigit+0x44>
cmpl   $0x0,-0x8(%rbp)
jge    113d <isdigit+0x3d>
cmpl   $0x41,-0x8(%rbp)
jle    113d <isdigit+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <isdigit+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
int /*<<< orphan*/ syscall(int);
void dist_sync_barrier(void) {
  barrier();
  syscall(317);
  barrier();
}


x86 assembly (clang, -O0):
<dist_sync_barrier>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <barrier@plt>
mov    $0x13d,%edi
call   1040 <syscall@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_sync_barrier>:
push   %rax
xor    %eax,%eax
call   1030 <barrier@plt>
mov    $0x13d,%edi
call   1040 <syscall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <barrier@plt>

LLVM IR (-O0):
define void @dist_sync_barrier() {
%1 = call i32 (...) @barrier()
%2 = call i32 @syscall(i32 317)
%3 = call i32 (...) @barrier()
ret void
}

LLVM IR (-O2):
define void @dist_sync_barrier() {
%1 = tail call i32 (...) @barrier()
%2 = tail call i32 @syscall(i32 317)
%3 = tail call i32 (...) @barrier()
ret void
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_address_context(unsigned char const *, struct stream *);
int decode_address_context_32bit_is0(const unsigned char *pkt,
                                     struct stream *stream) {
  return decode_address_context(pkt, stream);
}


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

x86 assembly (clang, -O2):
<decode_address_context_32bit_is0>:
jmp    1030 <decode_address_context@plt>

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

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_address_context_32bit_is0(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_address_context(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __thread_mutex_lock(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ __thread_self();
int pthread_mutex_lock(pthread_mutex_t *mutex) {
  return __thread_mutex_lock(mutex, __thread_self());
}


x86 assembly (clang, -O0):
<pthread_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__thread_self@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <__thread_mutex_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_lock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__thread_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <__thread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutex_lock(i32* %0) {
%2 = tail call i32 (...) @__thread_self()
%3 = tail call i32 @__thread_mutex_lock(i32* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ppad(int pad) {
  if (pad > 0) {
    while (--pad) {
      printf(".");
    }
  }
}


x86 assembly (clang, -O0):
<ppad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1152 <ppad+0x42>
jmp    112a <ppad+0x1a>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     114d <ppad+0x3d>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <ppad+0x1a>
jmp    1152 <ppad+0x42>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppad>:
push   %rbx
test   %edi,%edi
jle    112f <ppad+0x1f>
mov    %edi,%ebx
add    $0xffffffff,%ebx
je     112f <ppad+0x1f>
nopl   0x0(%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <ppad+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ppad(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
%5 = select i1 %2, i1 true, i1 %4
br i1 %5, label %11, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %3, %1 ]
%8 = tail call i32 @putchar(i32 46)
%9 = add nsw i32 %7, -1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
ret void
}
int fun108() { return 108; }


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

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

LLVM IR (-O0):
define i32 @fun108() {
ret i32 108
}

LLVM IR (-O2):
define i32 @fun108() {
ret i32 108
}
void highlight_source(void) {}


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

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

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

LLVM IR (-O2):
define void @highlight_source() {
ret void
}
/* Type definitions */
struct per_cpu_info {
  int dummy;
};
struct blk_io_trace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ process_fmt(char *, struct per_cpu_info *,
                               struct blk_io_trace *, unsigned long long,
                               int /*<<< orphan*/, int /*<<< orphan*/ *);
void log_unplug(struct per_cpu_info *pci, struct blk_io_trace *t, char *act) {
  process_fmt(act, pci, t, -1ULL, 0, NULL);
}


x86 assembly (clang, -O0):
<log_unplug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffffffffffff,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <process_fmt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_unplug>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
mov    $0xffffffffffffffff,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <process_fmt@plt>

LLVM IR (-O0):
%struct.per_cpu_info = type { i32 }
%struct.blk_io_trace = type { i32 }
define void @log_unplug(%struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i8* %2) {
%4 = alloca %struct.per_cpu_info*
%5 = alloca %struct.blk_io_trace*
%6 = alloca i8*
store %struct.per_cpu_info* %0, %struct.per_cpu_info** %4
store %struct.blk_io_trace* %1, %struct.blk_io_trace** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load %struct.per_cpu_info*, %struct.per_cpu_info** %4
%9 = load %struct.blk_io_trace*, %struct.blk_io_trace** %5
%10 = call i32 @process_fmt(i8* %7, %struct.per_cpu_info* %8, %struct.blk_io_trace* %9, i64 -1, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
%struct.per_cpu_info = type { i32 }
%struct.blk_io_trace = type { i32 }
define void @log_unplug(%struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i8* %2) {
%4 = tail call i32 @process_fmt(i8* %2, %struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i64 -1, i32 0, i32* null)
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *GetProcAddress(void *pLibrary, const char *name) {
  return dlsym(pLibrary, name);
}


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

x86 assembly (clang, -O2):
<GetProcAddress>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @GetProcAddress(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int count_monitors();
int one_monitor(void) { return count_monitors() == 1; }


x86 assembly (clang, -O0):
<one_monitor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <count_monitors@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_monitor>:
push   %rax
xor    %eax,%eax
call   1030 <count_monitors@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @one_monitor() {
%1 = call i32 (...) @count_monitors()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @one_monitor() {
%1 = tail call i32 (...) @count_monitors()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int u_int32_t;

/* Variables and functions */
__attribute__((__pure__)) u_int32_t h2_u32(const uint8_t *const s) {
  return ((u_int32_t)s[0] << 24) | ((u_int32_t)s[1] << 16) |
         ((u_int32_t)s[2] << 8) | (u_int32_t)s[3];
}


x86 assembly (clang, -O0):
<h2_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2_u32>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @h2_u32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
char *date(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
void consoleError(const char *text) {
  char *time = date("%H:%M:%S");
  printf("\033[22;31m");
  printf("[%s] %s", time, text);
  printf("\033[0m\n");
  free(time);
}


x86 assembly (clang, -O0):
<consoleError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <date@plt>
mov    %rax,-0x10(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
call   1060 <date@plt>
mov    %rax,%rbx
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%H:%M:%S\00"
@.str.1 = [9 x i8] c"\1B[22;31m\00"
@.str.2 = [8 x i8] c"[%s] %s\00"
@.str.3 = [6 x i8] c"\1B[0m\0A\00"
define void @consoleError(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @date(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%H:%M:%S\00"
@.str.1 = [9 x i8] c"\1B[22;31m\00"
@.str.2 = [8 x i8] c"[%s] %s\00"
@str = [5 x i8] c"\1B[0m\00"
define void @consoleError(i8* %0) {
%2 = tail call i8* @date(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %2, i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int abs(int j) {
  if (j < 0) {
    return -j;
  } else {
    return j;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
struct pred1_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pred1_state *);
void Pred1Term(void *v) {
  struct pred1_state *state = (struct pred1_state *)v;
  free(state);
}


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

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

LLVM IR (-O0):
%struct.pred1_state = type { i32 }
define void @Pred1Term(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.pred1_state*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.pred1_state*
store %struct.pred1_state* %5, %struct.pred1_state** %3
%6 = load %struct.pred1_state*, %struct.pred1_state** %3
%7 = call i32 @free(%struct.pred1_state* %6)
ret void
}

LLVM IR (-O2):
%struct.pred1_state = type { i32 }
define void @Pred1Term(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.pred1_state*
%3 = tail call i32 @free(%struct.pred1_state* %2)
ret void
}