xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void client_exit(int sig) {
  printf("subprocess exit\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<client_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<client_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"subprocess exit\0A\00"
@EXIT_SUCCESS = global i32 0
define void @client_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [16 x i8] c"subprocess exit\00"
define void @client_exit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, int);
int among(const char *s, int c) { return c && strchr(s, c) != NULL; }


x86 assembly (clang, -O0):
<among>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1144 <among+0x34>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<among>:
test   %esi,%esi
je     112a <among+0x1a>
push   %rax
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @among(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32* @strchr(i8* %8, i32 %9)
%11 = icmp ne i32* %10, null
br label %12
12: ; preds = %7, %2
%13 = phi i1 [ false, %2 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @among(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32* @strchr(i8* %0, i32 %1)
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void TimerIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000024))) = ui32IntFlags;
}


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

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

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

LLVM IR (-O2):
define void @TimerIntClear(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 36
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void test9_4(volatile int *ptr, int val) { __sync_fetch_and_nand(ptr, val); }


x86 assembly (clang, -O0):
<test9_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x14(%rbp)
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
test   $0x1,%cl
mov    %eax,-0x10(%rbp)
jne    1149 <test9_4+0x49>
jmp    111e <test9_4+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    %esi,%ecx
not    %ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test9_4+0x10>
ret

LLVM IR (-O0):
define void @test9_4(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = atomicrmw nand i32* %5, i32 %6 seq_cst
ret void
}

LLVM IR (-O2):
define void @test9_4(i32* nocapture %0, i32 %1) {
%3 = atomicrmw nand i32* %0, i32 %1 seq_cst
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *friendlyTimestring() {
  time_t timenow;
  timenow = time(NULL);
  return (ctime(&timenow));
}


x86 assembly (clang, -O0):
<friendlyTimestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<friendlyTimestring>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @friendlyTimestring() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @friendlyTimestring() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
void debug_blink(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_html_newline(FILE *f) { fputs("<br/>", f); }


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

x86 assembly (clang, -O2):
<print_html_newline>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<br/>\00"
define void @print_html_newline(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"<br/>\00"
define void @print_html_newline(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %0)
ret void
}
int offSet10(long x) {
  int len = 1;
  int k = 1;
  while (x - 10 * k >= 0) {
    len++;
    k = k * 10;
  }
  return len;
}


x86 assembly (clang, -O0):
<offSet10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xa,-0x10(%rbp),%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jl     1143 <offSet10+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <offSet10+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offSet10>:
mov    $0x1,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x1,%eax
cmp    %rdi,%rcx
jle    1110 <offSet10+0x10>
ret

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

LLVM IR (-O2):
define i32 @offSet10(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = phi i32 [ 1, %1 ], [ %5, %2 ]
%5 = mul nsw i32 %4, 10
%6 = zext i32 %5 to i64
%7 = icmp sgt i64 %6, %0
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
void foo296() {}


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

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

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

LLVM IR (-O2):
define void @foo296() {
ret void
}
int findfirst(const char *pathname, struct ffblk *ffblk, int attrib) {
  return 0;
}


x86 assembly (clang, -O0):
<findfirst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ffblk = type opaque
define i32 @findfirst(i8* %0, %struct.ffblk* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.ffblk*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.ffblk* %1, %struct.ffblk** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.ffblk = type opaque
define i32 @findfirst(i8* nocapture readnone %0, %struct.ffblk* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
int /*<<< orphan*/ is_asymmetric_encrypted(struct item *);
void check_is_asymmetric_encrypted(struct item *item) {
  if (!is_asymmetric_encrypted(item))
    abort_crypto_lib("Presented item is not an asymmetric encrypted item");
}


x86 assembly (clang, -O0):
<check_is_asymmetric_encrypted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_asymmetric_encrypted@plt>
cmp    $0x0,%eax
jne    114a <check_is_asymmetric_encrypted+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_asymmetric_encrypted>:
push   %rax
call   1030 <is_asymmetric_encrypted@plt>
test   %eax,%eax
je     112c <check_is_asymmetric_encrypted+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <abort_crypto_lib@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [51 x i8] c"Presented item is not an asymmetric encrypted item\00"
define void @check_is_asymmetric_encrypted(%struct.item* %0) {
%2 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%3 = load %struct.item*, %struct.item** %2
%4 = call i32 @is_asymmetric_encrypted(%struct.item* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [51 x i8] c"Presented item is not an asymmetric encrypted item\00"
define void @check_is_asymmetric_encrypted(%struct.item* %0) {
%2 = tail call i32 @is_asymmetric_encrypted(%struct.item* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void IEEE_Swap__FLT(float *rval) {
  unsigned int uval;
  (void)memcpy(&uval, rval, sizeof(int));
  uval = byte_swap_u32(uval);
  (void)memcpy(rval, &uval, sizeof(int));
}


x86 assembly (clang, -O0):
<IEEE_Swap__FLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <byte_swap_u32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IEEE_Swap__FLT>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %eax,%eax
call   1030 <byte_swap_u32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @IEEE_Swap__FLT(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
%4 = bitcast i32* %3 to i8*
%5 = load float*, float** %2
%6 = bitcast float* %5 to i8*
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @byte_swap_u32 to i32 (i32, ...)*)(i32 %7)
store i32 %8, i32* %3
%9 = load float*, float** %2
%10 = bitcast float* %9 to i8*
%11 = bitcast i32* %3 to i8*
ret void
}

LLVM IR (-O2):
define void @IEEE_Swap__FLT(float* nocapture %0) {
%2 = bitcast float* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @byte_swap_u32 to i32 (i32, ...)*)(i32 %3)
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int /*<<< orphan*/ towupper(int /*<<< orphan*/);
wint_t towupper_l(wint_t c, locale_t l) { return towupper(c); }


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

x86 assembly (clang, -O2):
<towupper_l>:
jmp    1030 <towupper@plt>

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

LLVM IR (-O2):
define i32 @towupper_l(i32 %0, i32 %1) {
%3 = tail call i32 @towupper(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void ival_to_str(int x, char *str) {
  if (x == (-999999)) {
    strcpy(str, "?");
  } else {
    sprintf(str, "%d", x);
  }
}


x86 assembly (clang, -O0):
<ival_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xfff0bdc1,-0x4(%rbp)
jne    1151 <ival_to_str+0x31>
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1164 <ival_to_str+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea3(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ival_to_str>:
mov    %rsi,%rax
cmp    $0xfff0bdc1,%edi
jne    113a <ival_to_str+0x1a>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
mov    %edi,%edx
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
@.str.1 = [3 x i8] c"%d\00"
define void @ival_to_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -999999
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i32, i32* %3
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
@.str.1 = [3 x i8] c"%d\00"
define void @ival_to_str(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, -999999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
void __attribute__((__no__)) load_gpr(long *a, long *b) {
  long c = *a;
  __asm__("# gpr, reg = %0" : "+b"(c));
  *b = c;
}


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

x86 assembly (clang, -O2):
<load_gpr>:
push   %rbx
mov    (%rdi),%rbx
mov    %rbx,(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @load_gpr(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = call i64 asm "# gpr, reg = $0", "={bx},0,~{dirflag},~{fpsr},~{flags}"(i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i64*, i64** %4
store i64 %10, i64* %11
ret void
}

LLVM IR (-O2):
define void @load_gpr(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = tail call i64 asm "# gpr, reg = $0", "={bx},0,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %1
ret void
}
double df1(double x) { return 1 / x; }


x86 assembly (clang, -O0):
<df1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df1>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @df1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @df1(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
scalar_t__ Menu_Count();
int /*<<< orphan*/ Menus_CloseAll();
int /*<<< orphan*/ trap_Cvar_Set(char *, char *);
int /*<<< orphan*/ trap_Key_ClearStates();
int trap_Key_GetCatcher();
int /*<<< orphan*/ trap_Key_SetCatcher(int);
void UI_CloseMenus_f(void) {
  if (Menu_Count() > 0) {
    trap_Key_SetCatcher(trap_Key_GetCatcher() & ~0x0002);
    trap_Key_ClearStates();
    trap_Cvar_Set("cl_paused", "0");
    Menus_CloseAll();
  }
}


x86 assembly (clang, -O0):
<UI_CloseMenus_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Menu_Count@plt>
cmp    $0x0,%rax
jle    11a7 <UI_CloseMenus_f+0x47>
mov    $0x0,%al
call   1060 <trap_Key_GetCatcher@plt>
mov    %eax,%edi
and    $0xfffffffd,%edi
call   1030 <trap_Key_SetCatcher@plt>
mov    $0x0,%al
call   1050 <trap_Key_ClearStates@plt>
lea    0xe6c(%rip),%rdi
lea    0xe6f(%rip),%rsi
call   1070 <trap_Cvar_Set@plt>
mov    $0x0,%al
call   1080 <Menus_CloseAll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_CloseMenus_f>:
push   %rax
xor    %eax,%eax
call   1040 <Menu_Count@plt>
test   %rax,%rax
jle    11a0 <UI_CloseMenus_f+0x40>
xor    %eax,%eax
call   1060 <trap_Key_GetCatcher@plt>
and    $0xfffffffd,%eax
mov    %eax,%edi
call   1030 <trap_Key_SetCatcher@plt>
xor    %eax,%eax
call   1050 <trap_Key_ClearStates@plt>
lea    0xe74(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1070 <trap_Cvar_Set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <Menus_CloseAll@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"cl_paused\00"
@.str.1 = [2 x i8] c"0\00"
define void @UI_CloseMenus_f() {
%1 = call i64 (...) @Menu_Count()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = call i32 (...) @trap_Key_GetCatcher()
%5 = and i32 %4, -3
%6 = call i32 @trap_Key_SetCatcher(i32 %5)
%7 = call i32 (...) @trap_Key_ClearStates()
%8 = call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @Menus_CloseAll()
br label %10
10: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"cl_paused\00"
@.str.1 = [2 x i8] c"0\00"
define void @UI_CloseMenus_f() {
%1 = tail call i64 (...) @Menu_Count()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 (...) @trap_Key_GetCatcher()
%5 = and i32 %4, -3
%6 = tail call i32 @trap_Key_SetCatcher(i32 %5)
%7 = tail call i32 (...) @trap_Key_ClearStates()
%8 = tail call i32 @trap_Cvar_Set(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 (...) @Menus_CloseAll()
br label %10
10: ; preds = %3, %0
ret void
}
OP(ed, fc) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ addch(char);
short strlen(char *);
void pad(char *s, short n) {
  short i;
  for (i = strlen(s); i < n; i++) {
    addch(' ');
  }
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
movswl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jge    116b <pad+0x4b>
mov    $0x20,%edi
call   1040 <addch@plt>
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    1140 <pad+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %rbx
mov    %esi,%ebx
call   1030 <strlen@plt>
cmp    %bx,%ax
jge    1140 <pad+0x20>
sub    %eax,%ebx
nop
mov    $0x20,%edi
call   1040 <addch@plt>
add    $0xffff,%bx
jne    1130 <pad+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @pad(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
%7 = call signext i16 @strlen(i8* %6)
store i16 %7, i16* %5
br label %8
8: ; preds = %16, %2
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = load i16, i16* %4
%12 = sext i16 %11 to i32
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = call i32 @addch(i8 signext 32)
br label %16
16: ; preds = %14
%17 = load i16, i16* %5
%18 = add i16 %17, 1
store i16 %18, i16* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @pad(i8* %0, i16 signext %1) {
%3 = tail call signext i16 @strlen(i8* %0)
%4 = icmp slt i16 %3, %1
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i16 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @addch(i8 signext 32)
%8 = add i16 %6, 1
%9 = icmp eq i16 %8, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
void gtk_text_iter_ends_sentence() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_ends_sentence() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *kl_malloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    die("Out of memory! (Tried to allocate %u)", size);
  }
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<kl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <kl_malloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1050 <die@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kl_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <kl_malloc+0x23>
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
call   1050 <die@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Out of memory! (Tried to allocate %u)\00"
define i8* @kl_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
%13 = load i64, i64* %2
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [38 x i8] c"Out of memory! (Tried to allocate %u)\00"
define i8* @kl_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
bool MultiFlag(uint64_t Flag) { return (Flag & (Flag - 1)) != 0 && Flag != 1; }


x86 assembly (clang, -O0):
<MultiFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     112a <MultiFlag+0x2a>
cmpl   $0x1,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MultiFlag>:
lea    -0x1(%rdi),%eax
test   %eax,%edi
setne  %al
cmp    $0x1,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @MultiFlag(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ugt i32 %2, 1
%4 = icmp ne i32 %0, 1
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned int rev4(unsigned int in) {
  __asm__("bswap %0" : "=r"(in) : "0"(in));
  return in;
}


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

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

LLVM IR (-O0):
define i32 @rev4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @rev4(i32 %0) {
%2 = tail call i32 asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @brcmf_proto_bcdc_detach_post_delif(%struct.brcmf_pub* nocapture %0) {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR9B_get(void) { return U_WMRCORENONE_get("U_WMR9B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR9B\00"
define i32 @U_WMR9B_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR9B\00"
define i32 @U_WMR9B_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, world!");
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
int __sx25_save_link_parameters(struct link_data *linkid) { return (0); }


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

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

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

LLVM IR (-O2):
%struct.link_data = type opaque
define i32 @__sx25_save_link_parameters(%struct.link_data* nocapture readnone %0) {
ret i32 0
}
int test_imm_2Buint32_reg(unsigned int val) {
  return ((val) & (0x2B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Buint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x2b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_2Buint32_reg(i32 %0) {
%2 = and i32 %0, 43
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_9Auint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x9A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Auint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 154
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *memory = 0;
  do {
    memory = malloc(size);
  } while (memory == 0);
  return memory;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1124 <safe_malloc+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     1120 <safe_malloc+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %2, label %5
5: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int sched_yield();
int __gthread_yield(void) { return sched_yield(); }


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

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

LLVM IR (-O0):
define i32 @__gthread_yield() {
%1 = call i32 (...) @sched_yield()
ret i32 %1
}

LLVM IR (-O2):
define i32 @__gthread_yield() {
%1 = tail call i32 (...) @sched_yield()
ret i32 %1
}
void g_quark_from_string() {}


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

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

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

LLVM IR (-O2):
define void @g_quark_from_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ si475x_set_property(int, int);
void si475xAMRX_mute(unsigned char mute) {
  if (mute)
    si475x_set_property(0x0301, 3);
  else
    si475x_set_property(0x0301, 0);
}


x86 assembly (clang, -O0):
<si475xAMRX_mute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113c <si475xAMRX_mute+0x2c>
mov    $0x301,%edi
mov    $0x3,%esi
call   1030 <si475x_set_property@plt>
jmp    1148 <si475xAMRX_mute+0x38>
mov    $0x301,%edi
xor    %esi,%esi
call   1030 <si475x_set_property@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xAMRX_mute>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    (%rax,%rax,2),%esi
mov    $0x301,%edi
jmp    1030 <si475x_set_property@plt>

LLVM IR (-O0):
define void @si475xAMRX_mute(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @si475x_set_property(i32 769, i32 3)
br label %9
7: ; preds = %1
%8 = call i32 @si475x_set_property(i32 769, i32 0)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @si475xAMRX_mute(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 0, i32 3
%4 = tail call i32 @si475x_set_property(i32 769, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _os_platform_do_something_else();
void _os_platform_loop() { _os_platform_do_something_else(); }


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

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

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

LLVM IR (-O2):
define void @_os_platform_loop() {
%1 = tail call i32 (...) @_os_platform_do_something_else()
ret void
}
/* Variables and functions */
void *calloc(int, int);
void *bnfa_malloc(int n, int *m) {
  void *p = calloc(1, n);
  if (p) {
    if (m) {
      m[0] += n;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<bnfa_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <bnfa_malloc+0x46>
cmpq   $0x0,-0x10(%rbp)
je     1151 <bnfa_malloc+0x41>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
jmp    1156 <bnfa_malloc+0x46>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnfa_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%edi
mov    %ebp,%esi
call   1030 <calloc@plt>
test   %rbx,%rbx
je     1130 <bnfa_malloc+0x20>
test   %rax,%rax
je     1130 <bnfa_malloc+0x20>
add    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @bnfa_malloc(i32 %0, i32* %1) {
%3 = tail call i8* @calloc(i32 1, i32 %0)
%4 = icmp ne i8* %3, null
%5 = icmp ne i32* %1, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %0
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, np;
#pragma omp parallel private(np, i)
  {
    np = omp_get_thread_num();
    printf("Soy el thread %d, antes del barrier \n", np);
#pragma omp barrier
    printf("\t\tSoy el thread %d, despues del barrier \n", np);
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Soy el thread %d, antes del barrier \0A\00"
@.str.1 = [42 x i8] c"\09\09Soy el thread %d, despues del barrier \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Soy el thread %d, antes del barrier \0A\00"
@.str.1 = [42 x i8] c"\09\09Soy el thread %d, despues del barrier \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
long test_long_2(long a, long b) { return a * b; }


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

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

LLVM IR (-O0):
define i64 @test_long_2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @test_long_2(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
double fahrenheit_to_celsius(double f) { return (f - 32) * (5.0 / 9.0); }


x86 assembly (clang, -O0):
<fahrenheit_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit_to_celsius>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fahrenheit_to_celsius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double %4, 0x3FE1C71C71C71C72
ret double %5
}

LLVM IR (-O2):
define double @fahrenheit_to_celsius(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 0x3FE1C71C71C71C72
ret double %3
}
unsigned int compare_and_swap64(volatile unsigned long long *address,
                                unsigned long old_value,
                                unsigned long new_value) {
  unsigned long prev = 0;
  __asm__ __volatile__("lock ; "
                       "cmpxchgq %1,%2"
                       : "=a"(prev)
                       : "r"(new_value), "m"(*address), "0"(old_value)
                       : "memory");
  return prev == old_value;
}


x86 assembly (clang, -O0):
<compare_and_swap64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
lock cmpxchg %rcx,(%rdx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap64>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
xor    %ecx,%ecx
cmp    %rsi,%rax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_and_swap64(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i64, i64* %6
%9 = load i64*, i64** %4
%10 = load i64, i64* %5
%11 = call i64 asm sideeffect "lock ; cmpxchgq $1,$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64* elementtype(i64) %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %5
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_and_swap64(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "lock ; cmpxchgq $1,$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %2, i64* elementtype(i64) %0, i64 %1)
%5 = icmp eq i64 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vwprintf(int /*<<< orphan*/ *, int /*<<< orphan*/);
void uninivar_vwprintf(void) {
  wchar_t *format;
  va_list arg;
  (void)vwprintf(format, arg);
}


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

x86 assembly (clang, -O2):
<uninivar_vwprintf>:
jmp    1030 <vwprintf@plt>

LLVM IR (-O0):
define void @uninivar_vwprintf() {
%1 = alloca i32*
%2 = alloca i32
%3 = load i32*, i32** %1
%4 = load i32, i32* %2
%5 = call i32 @vwprintf(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_vwprintf() {
%1 = tail call i32 @vwprintf(i32* undef, i32 undef)
ret void
}
void VUtestPause() {}


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

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

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

LLVM IR (-O2):
define void @VUtestPause() {
ret void
}
int sd_zbc_init_disk(struct scsi_disk *sdkp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.scsi_disk = type opaque
define i32 @sd_zbc_init_disk(%struct.scsi_disk* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int read_int_from_file(char *);
int cpu_therm() {
  int input = 0;
  input = read_int_from_file("/sys/class/hwmon/hwmon0/temp2_input");
  input = input * 0.001;
  return input;
}


x86 assembly (clang, -O0):
<cpu_therm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
call   1030 <read_int_from_file@plt>
mov    %eax,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_therm>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <read_int_from_file@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xed7(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"/sys/class/hwmon/hwmon0/temp2_input\00"
define i32 @cpu_therm() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @read_int_from_file(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 1.000000e-03
%6 = fptosi double %5 to i32
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [36 x i8] c"/sys/class/hwmon/hwmon0/temp2_input\00"
define i32 @cpu_therm() {
%1 = tail call i32 @read_int_from_file(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 1.000000e-03
%4 = fptosi double %3 to i32
ret i32 %4
}