xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *p1, const void *p2) {
  char **s1 = (char **)p1;
  char **s2 = (char **)p2;
  return (strcmp(*s1, *s2));
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ digraph();
int /*<<< orphan*/ dollar();
int /*<<< orphan*/ escape();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ whitespace();
int main() {
  digraph();
  escape();
  whitespace();
  newline();
  dollar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <digraph@plt>
mov    $0x0,%al
call   1070 <escape@plt>
mov    $0x0,%al
call   1060 <whitespace@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    $0x0,%al
call   1040 <dollar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <digraph@plt>
xor    %eax,%eax
call   1070 <escape@plt>
xor    %eax,%eax
call   1060 <whitespace@plt>
xor    %eax,%eax
call   1030 <newline@plt>
xor    %eax,%eax
call   1040 <dollar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @digraph()
%3 = call i32 (...) @escape()
%4 = call i32 (...) @whitespace()
%5 = call i32 (...) @newline()
%6 = call i32 (...) @dollar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @digraph()
%2 = tail call i32 (...) @escape()
%3 = tail call i32 (...) @whitespace()
%4 = tail call i32 (...) @newline()
%5 = tail call i32 (...) @dollar()
ret i32 0
}
/* Type definitions */
struct gl_geometries {
  int dummy;
};
struct gl_cache {
  int dummy;
};

/* Variables and functions */
int gl_geometries_init_wfobj(struct gl_cache *, struct gl_geometries *,
                             char const *);
int load_wf_obj(void const *key, size_t len, void *data, void *link) {
  struct gl_geometries *geos = data;
  struct gl_cache *cache = link;
  char const *filename = key;
  (void)len;
  return gl_geometries_init_wfobj(cache, geos, filename);
}


x86 assembly (clang, -O0):
<load_wf_obj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <gl_geometries_init_wfobj@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_wf_obj>:
mov    %rdi,%rax
mov    %rcx,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <gl_geometries_init_wfobj@plt>

LLVM IR (-O0):
%struct.gl_geometries = type { i32 }
%struct.gl_cache = type { i32 }
define i32 @load_wf_obj(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.gl_geometries*
%10 = alloca %struct.gl_cache*
%11 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to %struct.gl_geometries*
store %struct.gl_geometries* %13, %struct.gl_geometries** %9
%14 = load i8*, i8** %8
%15 = bitcast i8* %14 to %struct.gl_cache*
store %struct.gl_cache* %15, %struct.gl_cache** %10
%16 = load i8*, i8** %5
store i8* %16, i8** %11
%17 = load i64, i64* %6
%18 = load %struct.gl_cache*, %struct.gl_cache** %10
%19 = load %struct.gl_geometries*, %struct.gl_geometries** %9
%20 = load i8*, i8** %11
%21 = call i32 @gl_geometries_init_wfobj(%struct.gl_cache* %18, %struct.gl_geometries* %19, i8* %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.gl_geometries = type { i32 }
%struct.gl_cache = type { i32 }
define i32 @load_wf_obj(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = bitcast i8* %2 to %struct.gl_geometries*
%6 = bitcast i8* %3 to %struct.gl_cache*
%7 = tail call i32 @gl_geometries_init_wfobj(%struct.gl_cache* %6, %struct.gl_geometries* %5, i8* %0)
ret i32 %7
}
struct s3c24x0_rtc *s3c24x0_get_base_rtc(void) {
  return (struct s3c24x0_rtc *)0x57000000;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_rtc = type opaque
define %struct.s3c24x0_rtc* @s3c24x0_get_base_rtc() {
ret %struct.s3c24x0_rtc* inttoptr (i64 1459617792 to %struct.s3c24x0_rtc*)
}

LLVM IR (-O2):
%struct.s3c24x0_rtc = type opaque
define %struct.s3c24x0_rtc* @s3c24x0_get_base_rtc() {
ret %struct.s3c24x0_rtc* inttoptr (i64 1459617792 to %struct.s3c24x0_rtc*)
}
char *sing(num, sinstr, plustr)
unsigned long num;
char *sinstr;
char *plustr;
{
  if (num == 1)
    return sinstr;
  else
    return plustr;
}


x86 assembly (clang, -O0):
<sing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1128 <sing+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <sing+0x30>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sing>:
mov    %rsi,%rax
cmp    $0x1,%rdi
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @sing(i64 %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp eq i64 %0, 1
%5 = select i1 %4, i8* %1, i8* %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void undefined_symbol(char *sym) {
  fprintf(stderr, "Undefined symbol: %s\n", sym);
}


x86 assembly (clang, -O0):
<undefined_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undefined_symbol>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Undefined symbol: %s\0A\00"
define void @undefined_symbol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Undefined symbol: %s\0A\00"
define void @undefined_symbol(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ parent;
};
struct TYPE_4__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmaprequest_parent(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmaprequest.parent;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xmaprequest_parent(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int miliseconds(struct timeval *tv) {
  return ((int)tv->tv_sec * 1000 + (int)tv->tv_usec / 1000);
}


x86 assembly (clang, -O0):
<miliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<miliseconds>:
imul   $0x3e8,0x8(%rdi),%ecx
movslq (%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @miliseconds(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @miliseconds(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ chooseYourClass();
int main() {
  chooseYourClass();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @chooseYourClass()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @chooseYourClass()
ret i32 0
}
int karakter_sayisi(const char *s) {
  int i;
  for (i = 0; s[i] != '\0'; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<karakter_sayisi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <karakter_sayisi+0x37>
jmp    1129 <karakter_sayisi+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <karakter_sayisi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<karakter_sayisi>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <karakter_sayisi+0x10>
ret

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

LLVM IR (-O2):
define i32 @karakter_sayisi(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int w4_str(int, char *);
int /*<<< orphan*/ write_n(int, char *, int);
int ms_server(int fd) {
  switch (w4_str(fd, "CLIENT")) {
  case 1:
    write_n(fd, "CLIENTSERVER", 12);
  case 2:
    return 1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<ms_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1030 <w4_str@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x1,%eax
je     115e <ms_server+0x3e>
jmp    114d <ms_server+0x2d>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1172 <ms_server+0x52>
jmp    117e <ms_server+0x5e>
mov    -0x8(%rbp),%edi
lea    0xe9f(%rip),%rsi
mov    $0xc,%edx
call   1040 <write_n@plt>
movl   $0x1,-0x4(%rbp)
jmp    1185 <ms_server+0x65>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_server>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xed4(%rip),%rsi
call   1030 <w4_str@plt>
mov    $0x1,%ebx
cmp    $0x2,%eax
je     115a <ms_server+0x3a>
cmp    $0x1,%eax
jne    1155 <ms_server+0x35>
lea    0xec0(%rip),%rsi
mov    %ebp,%edi
mov    $0xc,%edx
call   1040 <write_n@plt>
jmp    115a <ms_server+0x3a>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"CLIENT\00"
@.str.1 = [13 x i8] c"CLIENTSERVER\00"
define i32 @ms_server(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @w4_str(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %9
]
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @write_n(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
br label %9
9: ; preds = %1, %6
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"CLIENT\00"
@.str.1 = [13 x i8] c"CLIENTSERVER\00"
define i32 @ms_server(i32 %0) {
%2 = tail call i32 @w4_str(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %2, label %5 [
i32 1, label %3
i32 2, label %6
]
3: ; preds = %1
%4 = tail call i32 @write_n(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
br label %6
5: ; preds = %1
br label %6
6: ; preds = %3, %1, %5
%7 = phi i32 [ -1, %5 ], [ 1, %1 ], [ 1, %3 ]
ret i32 %7
}
int test_imm_76uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x76 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_76uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 506806140928
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_80int64_midword_reg(long long val) {
  return ((val >> 16) & (0x80 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_80int64_midword_reg>:
test   $0x800000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80int64_midword_reg(i64 %0) {
%2 = and i64 %0, 8388608
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void DoPrefetch(char *p) {
  __builtin_prefetch(p);
  __builtin_prefetch(p + 17);
}


x86 assembly (clang, -O0):
<DoPrefetch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
prefetcht0 (%rax)
mov    -0x8(%rbp),%rax
add    $0x11,%rax
prefetcht0 (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoPrefetch>:
prefetcht0 (%rdi)
prefetcht0 0x11(%rdi)
ret

LLVM IR (-O0):
define void @DoPrefetch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 17
ret void
}

LLVM IR (-O2):
define void @DoPrefetch(i8* nocapture %0) {
tail call void @llvm.prefetch.p0i8(i8* %0, i32 0, i32 3, i32 1)
%2 = getelementptr inbounds i8, i8* %0, i64 17
tail call void @llvm.prefetch.p0i8(i8* %2, i32 0, i32 3, i32 1)
ret void
}
void SteamAPI_ISteamGameServer_SetServerName(void *self,
                                             const char *pszServerName) {
  xlogf("%s(self = %p, pszServerName = %s)\n", __func__, self, pszServerName);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamGameServer_SetServerName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetServerName>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xeff(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"%s(self = %p, pszServerName = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetServerName = [40 x i8] c"SteamAPI_ISteamGameServer_SetServerName\00"
define void @SteamAPI_ISteamGameServer_SetServerName(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 i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @__func__.SteamAPI_ISteamGameServer_SetServerName, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s(self = %p, pszServerName = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetServerName = [40 x i8] c"SteamAPI_ISteamGameServer_SetServerName\00"
define void @SteamAPI_ISteamGameServer_SetServerName(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @__func__.SteamAPI_ISteamGameServer_SetServerName, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int getPowTwo(unsigned int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, unsigned int *);
int main(void) {
  unsigned int num;
  while (scanf("%u", &num) > 0) {
    printf("%d\n", getPowTwo(num));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
jle    1174 <main+0x44>
mov    -0x8(%rbp),%edi
call   1030 <getPowTwo@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jle    1193 <main+0x63>
lea    0xead(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1030 <getPowTwo@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jg     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @getPowTwo(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
int f(int n) { return n == 10; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LcdWriteData(int);
void AllRowsSelect() {
  for (int x = 0; x < 600; ++x) {
    LcdWriteData(0xFE);
  }
}


x86 assembly (clang, -O0):
<AllRowsSelect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x258,-0x4(%rbp)
jge    1144 <AllRowsSelect+0x34>
mov    $0xfe,%edi
call   1030 <LcdWriteData@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <AllRowsSelect+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AllRowsSelect>:
push   %rbx
mov    $0x258,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xfe,%edi
call   1030 <LcdWriteData@plt>
add    $0xffffffff,%ebx
jne    1120 <AllRowsSelect+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @AllRowsSelect() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 600
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @LcdWriteData(i32 254)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @AllRowsSelect() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @LcdWriteData(i32 254)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 600
br i1 %6, label %1, label %2
}
int menu_valid(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @menu_valid() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t unpack_from_be32(const void *v) {
  uint32_t u;
  memcpy(&u, v, sizeof(uint32_t));
  return be32toh(u);
}


x86 assembly (clang, -O0):
<unpack_from_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <be32toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_from_be32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <be32toh@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unpack_from_be32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be32toh(i32 %5)
ret i32 %6
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ timespecaddp(struct timespec *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void timespecadd(struct timespec *t1, const struct timespec *t2) {
  timespecaddp(t1, t2->tv_sec, t2->tv_nsec);
}


x86 assembly (clang, -O0):
<timespecadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1030 <timespecaddp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespecadd>:
mov    (%rsi),%edx
mov    0x4(%rsi),%esi
jmp    1030 <timespecaddp@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @timespecadd(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.timespec*, %struct.timespec** %4
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @timespecaddp(%struct.timespec* %5, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @timespecadd(%struct.timespec* %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @timespecaddp(%struct.timespec* %0, i32 %4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inteiro_operacao_divisao_test();
int /*<<< orphan*/ inteiro_operacao_multiplicao_test();
int /*<<< orphan*/ inteiro_operacao_soma_test();
int /*<<< orphan*/ inteiro_operacao_subtracao_test();
int main(int argc, char *argv[]) {
  inteiro_operacao_soma_test();
  inteiro_operacao_subtracao_test();
  inteiro_operacao_multiplicao_test();
  inteiro_operacao_divisao_test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <inteiro_operacao_soma_test@plt>
xor    %eax,%eax
call   1050 <inteiro_operacao_subtracao_test@plt>
xor    %eax,%eax
call   1060 <inteiro_operacao_multiplicao_test@plt>
xor    %eax,%eax
call   1030 <inteiro_operacao_divisao_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @inteiro_operacao_soma_test()
%7 = call i32 (...) @inteiro_operacao_subtracao_test()
%8 = call i32 (...) @inteiro_operacao_multiplicao_test()
%9 = call i32 (...) @inteiro_operacao_divisao_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @inteiro_operacao_soma_test()
%4 = tail call i32 (...) @inteiro_operacao_subtracao_test()
%5 = tail call i32 (...) @inteiro_operacao_multiplicao_test()
%6 = tail call i32 (...) @inteiro_operacao_divisao_test()
ret i32 0
}
void dbur_Init(void) {}


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

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

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

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

/* Variables and functions */
int print_insn_arm(u_int32_t pc, FILE *stream, u_int32_t given) { return -1; }


x86 assembly (clang, -O0):
<print_insn_arm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @print_insn_arm(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @print_insn_arm(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 -1
}
char *ft_strchr(const char *s, int c) {
  char *d;
  d = (char *)s;
  while (*d) {
    if (*d == c)
      return (d);
    d++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <ft_strchr+0x4e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <ft_strchr+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <ft_strchr+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <ft_strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <ft_strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <ft_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <ft_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
int sn3218_probe(struct i2c_client *client, const struct i2c_device_id *id) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.i2c_client = type opaque
%struct.i2c_device_id = type opaque
define i32 @sn3218_probe(%struct.i2c_client* %0, %struct.i2c_device_id* %1) {
%3 = alloca %struct.i2c_client*
%4 = alloca %struct.i2c_device_id*
store %struct.i2c_client* %0, %struct.i2c_client** %3
store %struct.i2c_device_id* %1, %struct.i2c_device_id** %4
ret i32 0
}

LLVM IR (-O2):
%struct.i2c_client = type opaque
%struct.i2c_device_id = type opaque
define i32 @sn3218_probe(%struct.i2c_client* nocapture readnone %0, %struct.i2c_device_id* nocapture readnone %1) {
ret i32 0
}
int fun699() { return 699; }


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

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

LLVM IR (-O0):
define i32 @fun699() {
ret i32 699
}

LLVM IR (-O2):
define i32 @fun699() {
ret i32 699
}
/* Type definitions */
typedef int /*<<< orphan*/ flag;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int oct_set_so_reuseaddr(int fd) {
  int flag = 1;
  int len = sizeof(flag);
  return setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &flag, len);
}


x86 assembly (clang, -O0):
<oct_set_so_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%r8d
lea    -0x8(%rbp),%rcx
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oct_set_so_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @oct_set_so_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEADDR
%8 = load i32, i32* %4
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %3, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @oct_set_so_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
void __sys_exit(const int status) {
  (void)status;
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<__sys_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <__sys_exit+0x7>

x86 assembly (clang, -O2):
<__sys_exit>:
jmp    1100 <__sys_exit>

LLVM IR (-O0):
define void @__sys_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
br label %4
}

LLVM IR (-O2):
define void @__sys_exit(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 10;
  n = 20, 30, 40;
  printf("\n%d\n", n);
  n = (50, 60, 70);
  printf("\n%d\n", n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 70)
ret i32 0
}
long long get_and_add(long long *ptr, long long val) {
  return __atomic_fetch_add(ptr, val, 5);
}


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

x86 assembly (clang, -O2):
<get_and_add>:
mov    %rsi,%rax
lock xadd %rax,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @get_and_add(i64* nocapture %0, i64 %1) {
%3 = atomicrmw add i64* %0, i64 %1 seq_cst
ret i64 %3
}
/* Type definitions */
struct XRayTraceCapture {
  int dummy;
};

/* Variables and functions */
struct XRayTraceCapture *XRayInit(int stack_size, int buffer_size,
                                  int frame_count, const char *mapfilename) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.XRayTraceCapture = type { i32 }
define %struct.XRayTraceCapture* @XRayInit(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret %struct.XRayTraceCapture* null
}

LLVM IR (-O2):
%struct.XRayTraceCapture = type { i32 }
define noalias %struct.XRayTraceCapture* @XRayInit(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
ret %struct.XRayTraceCapture* null
}
void foo386() {}


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

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

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

LLVM IR (-O2):
define void @foo386() {
ret void
}
__attribute__((no, noclone)) signed __int128 t101_5add(signed __int128 x) {
  signed __int128 r;
  if (__builtin_add_overflow(x, (signed __int128)(-1), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t101_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0xffffffffffffffff,%rdx
adc    $0xffffffffffffffff,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t101_5add+0x48>
jmp    115f <t101_5add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t101_5add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
adc    $0xffffffffffffffff,%r14
jno    112b <t101_5add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t101_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %11, i128 -1)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t101_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int _main(int, char **);
int main(int argc, char *argv[]) { return _main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ data_set(int, int);
void rem_on() { data_set(2, 1); }


x86 assembly (clang, -O0):
<rem_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <data_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rem_on>:
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <data_set@plt>

LLVM IR (-O0):
define void @rem_on() {
%1 = call i32 @data_set(i32 2, i32 1)
ret void
}

LLVM IR (-O2):
define void @rem_on() {
%1 = tail call i32 @data_set(i32 2, i32 1)
ret void
}
/* Type definitions */
struct sigevent {
  int dummy;
};
typedef scalar_t__ mqd_t;

/* Variables and functions */
int mq_notify(scalar_t__, struct sigevent *);
void test_mq_notify_prototype(void) {
  mqd_t mqdes;
  struct sigevent *notification;
  int err;
  mqdes = 0;
  notification = NULL;
  err = mq_notify(mqdes, notification);
  (void)err;
}


x86 assembly (clang, -O0):
<test_mq_notify_prototype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mq_notify@plt>
mov    %eax,-0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mq_notify_prototype>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <mq_notify@plt>

LLVM IR (-O0):
%struct.sigevent = type { i32 }
define void @test_mq_notify_prototype() {
%1 = alloca i64
%2 = alloca %struct.sigevent*
%3 = alloca i32
store i64 0, i64* %1
store %struct.sigevent* null, %struct.sigevent** %2
%4 = load i64, i64* %1
%5 = load %struct.sigevent*, %struct.sigevent** %2
%6 = call i32 @mq_notify(i64 %4, %struct.sigevent* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
%struct.sigevent = type { i32 }
define void @test_mq_notify_prototype() {
%1 = tail call i32 @mq_notify(i64 0, %struct.sigevent* null)
ret void
}
/* Variables and functions */
double log1p(double);
double filling_fraction(double x) { return (log1p(1.0 / x) - 1.0 / (1.0 + x)); }


x86 assembly (clang, -O0):
<filling_fraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <log1p@plt>
movsd  0xec9(%rip),%xmm2
addsd  -0x8(%rbp),%xmm2
movsd  0xebc(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filling_fraction>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xede(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <log1p@plt>
movsd  0xecd(%rip),%xmm1
movsd  (%rsp),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @filling_fraction(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = call double @log1p(double %4)
%6 = load double, double* %2
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @filling_fraction(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @log1p(double %2)
%4 = fadd double %0, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fsub double %3, %5
ret double %6
}