xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ message(char *);
void MT_READ_ONLY(unsigned int rt) {
  static char write_to_read_only[] = "Invalid MTC0 from SR[00].";
  write_to_read_only[21] = '0' + (unsigned char)rt / 10;
  write_to_read_only[22] = '0' + (unsigned char)rt % 10;
  message(write_to_read_only);
  return;
}


x86 assembly (clang, -O0):
<MT_READ_ONLY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,0x2f13(%rip)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
mov    %al,0x2efb(%rip)
lea    0x2ede(%rip),%rdi
call   1030 <message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_READ_ONLY>:
movzbl %dil,%eax
imul   $0xcd,%eax,%ecx
shr    $0xb,%ecx
lea    0x30(%rcx),%edx
mov    %dl,0x2f1f(%rip)
lea    0x2f03(%rip),%rdi
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     $0x30,%al
mov    %al,0x2f0a(%rip)
jmp    1030 <message@plt>

LLVM IR (-O0):
@MT_READ_ONLY.write_to_read_only = internal global [26 x i8] c"Invalid MTC0 from SR[00].\00"
define void @MT_READ_ONLY(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = sdiv i32 %5, 10
%7 = add nsw i32 48, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @MT_READ_ONLY.write_to_read_only, i64 0, i64 21)
%9 = load i32, i32* %2
%10 = trunc i32 %9 to i8
%11 = zext i8 %10 to i32
%12 = srem i32 %11, 10
%13 = add nsw i32 48, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @MT_READ_ONLY.write_to_read_only, i64 0, i64 22)
%15 = call i32 @message(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @MT_READ_ONLY.write_to_read_only, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@MT_READ_ONLY.write_to_read_only = internal global [26 x i8] c"Invalid MTC0 from SR[00].\00"
define void @MT_READ_ONLY(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = udiv i8 %2, 10
%4 = add nuw nsw i8 %3, 48
store i8 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @MT_READ_ONLY.write_to_read_only, i64 0, i64 21)
%5 = urem i8 %2, 10
%6 = or i8 %5, 48
store i8 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @MT_READ_ONLY.write_to_read_only, i64 0, i64 22)
%7 = tail call i32 @message(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @MT_READ_ONLY.write_to_read_only, i64 0, i64 0))
ret void
}
int cmplt(int x, int y, int z) { return x < y; }


x86 assembly (clang, -O0):
<cmplt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmplt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @cmplt(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmplt(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int main() {
  int x;
  x = -1;
  return x > 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ char_is_in_set(char const, char *);
bool str_is_maybe_integer(const char *s) {
  return !(s[0] == '\0' || char_is_in_set(s[0], " \f\n\r\t\v"));
}


x86 assembly (clang, -O0):
<str_is_maybe_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114e <str_is_maybe_integer+0x3e>
mov    -0x8(%rbp),%rax
lea    0xec4(%rip),%rsi
movsbl (%rax),%edi
call   1030 <char_is_in_set@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_maybe_integer>:
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1133 <str_is_maybe_integer+0x23>
movsbl %al,%edi
lea    0xedf(%rip),%rsi
call   1030 <char_is_in_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" \0C\0A\0D\09\0B\00"
define i32 @str_is_maybe_integer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = call i64 @char_is_in_set(i8 signext %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ true, %1 ], [ %13, %8 ]
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c" \0C\0A\0D\09\0B\00"
define i32 @str_is_maybe_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @char_is_in_set(i8 signext %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int read_element(int *array, int size, int index) {
  if (index < 0 || size <= index) {
    return -1;
  }
  int x = array[index];
  return x;
}


x86 assembly (clang, -O0):
<read_element>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1124 <read_element+0x24>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1130 <read_element+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <read_element+0x44>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_element>:
mov    $0xffffffff,%eax
test   %edx,%edx
js     1112 <read_element+0x12>
cmp    %edx,%esi
jle    1112 <read_element+0x12>
mov    %edx,%eax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @read_element(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, -1
%5 = icmp sgt i32 %1, %2
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = zext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ -1, %3 ]
ret i32 %12
}
signed long long f16(signed long long v_foo) {
  signed long long v_parta = v_foo << 14;
  signed long long v_partb = ((unsigned long long)v_foo) >> 50;
  signed long long v_rotl = v_parta | v_partb;
  signed long long v_and = v_rotl & 114688;
  return v_and;
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0xe,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x32,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0x1c000,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
mov    %rdi,%rax
and    $0x7,%eax
shl    $0xe,%rax
ret

LLVM IR (-O0):
define i64 @f16(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = shl i64 %7, 14
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = lshr i64 %9, 50
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = or i64 %11, %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = and i64 %14, 114688
store i64 %15, i64* %6
%16 = load i64, i64* %6
ret i64 %16
}

LLVM IR (-O2):
define i64 @f16(i64 %0) {
%2 = shl i64 %0, 14
%3 = and i64 %2, 114688
ret i64 %3
}
unsigned long f3(unsigned int x) { return __builtin_clz(x) & 63ULL; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
and    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i64 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sext i32 %4 to i64
%6 = and i64 %5, 63
ret i64 %6
}

LLVM IR (-O2):
define i64 @f3(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = zext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
char *getenv(char *);
const char *conf_get_configname(void) {
  char *name = getenv("BOZ_KCONFIG_CONFIG");
  return name ? name : ".config";
}


x86 assembly (clang, -O0):
<conf_get_configname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <conf_get_configname+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <conf_get_configname+0x40>
lea    0xecc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <conf_get_configname+0x40>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_get_configname>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xeec(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"BOZ_KCONFIG_CONFIG\00"
@.str.1 = [8 x i8] c".config\00"
define i8* @conf_get_configname() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8*, i8** %1
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [19 x i8] c"BOZ_KCONFIG_CONFIG\00"
@.str.1 = [8 x i8] c".config\00"
define i8* @conf_get_configname() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int openmpt_stream_file_seek_func(void *stream, int64_t offset, int whence) {
  FILE *f = 0;
  int fwhence = 0;
  f = (FILE *)stream;
  if (!f) {
    return -1;
  }
  switch (whence) {
  default:
    return -1;
    break;
  }
  return fseek(f, offset, fwhence) ? -1 : 0;
}


x86 assembly (clang, -O0):
<openmpt_stream_file_seek_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113c <openmpt_stream_file_seek_func+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <openmpt_stream_file_seek_func+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @openmpt_stream_file_seek_func(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* null, i32** %8
store i32 0, i32* %9
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = icmp ne i32* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i32 -1, i32* %4
br label %18
15: ; preds = %3
%16 = load i32, i32* %7
switch i32 %16, label %17 [
]
17: ; preds = %15
store i32 -1, i32* %4
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @openmpt_stream_file_seek_func(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
void rop3_82_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & *D;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_82_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_82_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
and    %sil,%cl
or     %dl,%cl
xor    %r8b,%cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_82_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_82_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %6, %4
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ errno;
scalar_t__ nice(int);
int /*<<< orphan*/ perror(char *);
int set_nice(int change) {
  errno = 0;
  if (nice(change) < 0 && errno != 0)
    perror(
        "\nWARNING: setting priority failed: operating with default.\nReason");
  return 1;
}


x86 assembly (clang, -O0):
<set_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <nice@plt>
cmp    $0x0,%rax
jge    1168 <set_nice+0x48>
mov    0x2e8e(%rip),%rax
cmpq   $0x0,(%rax)
je     1168 <set_nice+0x48>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nice>:
push   %rbx
mov    0x2eb8(%rip),%rbx
movq   $0x0,(%rbx)
call   1030 <nice@plt>
test   %rax,%rax
jns    113f <set_nice+0x1f>
cmpq   $0x0,(%rbx)
jne    1146 <set_nice+0x26>
mov    $0x1,%eax
pop    %rbx
ret
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
jmp    113f <set_nice+0x1f>

LLVM IR (-O0):
@errno = global i64 0
@.str = [66 x i8] c"\0AWARNING: setting priority failed: operating with default.\0AReason\00"
define i32 @set_nice(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i64 0, i64* @errno
%3 = load i32, i32* %2
%4 = call i64 @nice(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @perror(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6, %1
ret i32 1
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [66 x i8] c"\0AWARNING: setting priority failed: operating with default.\0AReason\00"
define i32 @set_nice(i32 %0) {
store i64 0, i64* @errno
%2 = tail call i64 @nice(i32 %0)
%3 = icmp slt i64 %2, 0
%4 = load i64, i64* @errno
%5 = icmp ne i64 %4, 0
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 1
}
int test_imm_69uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x69 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_69uint64_lowword_mem>:
testb  $0x69,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_69uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 105
%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_69uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 105
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void usage(char *program_name) {
  fprintf(stderr,
          "USAGE: %s [-s|-u|-v] [-f file]* index_filename [filename]*\n"
          "\t-f file\tfile each line containing a filename\n"
          "\t\t-f can be specified up to %d times\n"
          "\t-s\tsort index file\n"
          "\t-u\tunlink entry (remove from index only)\n"
          "\t-v\tprint version and other info then exit\n"
          "\nDesigned and implemented by Andreas W. Hauser "
          "<hauser@genzentrum.lmu.de>.\n",
          program_name, 4096);
}


x86 assembly (clang, -O0):
<usage>:
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
mov    $0x1000,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [323 x i8] c"USAGE: %s [-s|-u|-v] [-f file]* index_filename [filename]*\0A\09-f file\09file each line containing a filename\0A\09\09-f can be specified up to %d times\0A\09-s\09sort index file\0A\09-u\09unlink entry (remove from index only)\0A\09-v\09print version and other info then exit\0A\0ADesigned and implemented by Andreas W. Hauser <hauser@genzentrum.lmu.de>.\0A\00"
define void @usage(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 ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i8* %4, i32 4096)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [323 x i8] c"USAGE: %s [-s|-u|-v] [-f file]* index_filename [filename]*\0A\09-f file\09file each line containing a filename\0A\09\09-f can be specified up to %d times\0A\09-s\09sort index file\0A\09-u\09unlink entry (remove from index only)\0A\09-v\09print version and other info then exit\0A\0ADesigned and implemented by Andreas W. Hauser <hauser@genzentrum.lmu.de>.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i8* %0, i32 4096)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rollnd(int *, int, int);
void rolln(int *r, int n) { rollnd(r, n, 6); }


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

x86 assembly (clang, -O2):
<rolln>:
mov    $0x6,%edx
jmp    1030 <rollnd@plt>

LLVM IR (-O0):
define void @rolln(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 = call i32 @rollnd(i32* %5, i32 %6, i32 6)
ret void
}

LLVM IR (-O2):
define void @rolln(i32* %0, i32 %1) {
%3 = tail call i32 @rollnd(i32* %0, i32 %1, i32 6)
ret void
}
double fmod(double x, double y) {
  int imod;
  if (y == 0.0)
    return (0.0);
  imod = x / y;
  return ((double)x - ((double)imod * y));
}


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1133 <fmod+0x33>
jp     1133 <fmod+0x33>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1177 <fmod+0x77>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1110 <fmod+0x10>
jp     1110 <fmod+0x10>
xorps  %xmm0,%xmm0
ret
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %21
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fdiv double %11, %12
%14 = fptosi double %13 to i32
store i32 %14, i32* %6
%15 = load double, double* %4
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = load double, double* %5
%19 = fneg double %17
%20 = call double @llvm.fmuladd.f64(double %19, double %18, double %15)
store double %20, double* %3
br label %21
21: ; preds = %10, %9
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = fdiv double %0, %1
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = fneg double %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %1, double %0)
br label %10
10: ; preds = %2, %4
%11 = phi double [ %9, %4 ], [ 0.000000e+00, %2 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void __except_bug(char *file, int line) {
  fprintf(stderr,
          "%s:%i: BUG detected: Check that you are not using "
          "break, continue, return or goto from within an "
          "exception block.\n",
          file, line);
  exit(-1);
}


x86 assembly (clang, -O0):
<__except_bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__except_bug>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [115 x i8] c"%s:%i: BUG detected: Check that you are not using break, continue, return or goto from within an exception block.\0A\00"
define void @__except_bug(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [115 x i8] c"%s:%i: BUG detected: Check that you are not using break, continue, return or goto from within an exception block.\0A\00"
define void @__except_bug(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void debug_report() {}


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

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

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

LLVM IR (-O2):
define void @debug_report() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utf8_tounicode(char const *, int *);
int utf8_index(const char *str, int index) {
  const char *s = str;
  while (index--) {
    int c;
    s += utf8_tounicode(s, &c);
  }
  return s - str;
}


x86 assembly (clang, -O0):
<utf8_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115d <utf8_index+0x4d>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <utf8_tounicode@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <utf8_index+0x17>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_index>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
test   %esi,%esi
je     1145 <utf8_index+0x35>
mov    %esi,%ebp
lea    0x4(%rsp),%r15
mov    %r14,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <utf8_tounicode@plt>
cltq
add    %rax,%rbx
add    $0xffffffff,%ebp
jne    1130 <utf8_index+0x20>
sub    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @utf8_index(i8* %0, i32 %1) {
%3 = alloca i32
%4 = icmp eq i32 %1, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %5, %7
%8 = phi i8* [ %0, %5 ], [ %13, %7 ]
%9 = phi i32 [ %1, %5 ], [ %10, %7 ]
%10 = add nsw i32 %9, -1
%11 = call i32 @utf8_tounicode(i8* %8, i32* %3)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
%14 = icmp eq i32 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = phi i8* [ %0, %2 ], [ %13, %7 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char string[100];
  int stringLength;
  printf("Enter a string : \n");
  scanf("%s", string);
  stringLength = strlen(string);
  printf("Length of %s is %d.\n", string, stringLength);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
mov    -0x74(%rbp),%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter a string : \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [21 x i8] c"Length of %s is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [21 x i8] c"Length of %s is %d.\0A\00"
@str = [18 x i8] c"Enter a string : \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ myclock();
int main(int argc, char **argv __attribute__((unused))) {
  if (argc > 1)
    return 1;
  while (1) {
    myclock();
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jle    113b <main+0x2b>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1140 <main+0x30>
mov    $0x0,%al
call   1030 <myclock@plt>
jmp    1140 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1120 <main+0x10>
mov    $0x1,%eax
pop    %rcx
ret
nopl   (%rax)
xor    %eax,%eax
call   1030 <myclock@plt>
jmp    1120 <main+0x10>

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 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
ret i32 1
9: ; preds = %2
br label %10
10: ; preds = %9, %10
%11 = call i32 (...) @myclock()
br label %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %5
4: ; preds = %2
ret i32 1
5: ; preds = %2, %5
%6 = tail call i32 (...) @myclock()
br label %5
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
char *slower(char *str) {
  int i;
  for (i = 0; i < strlen(str); ++i) {
    str[i] = tolower(str[i]);
  }
  return str;
}


x86 assembly (clang, -O0):
<slower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <slower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <slower+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <slower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <slower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @slower(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i8* %0
}
void tophat_drive_follow_right() {}


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

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

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

LLVM IR (-O2):
define void @tophat_drive_follow_right() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
main() {
  long i, sum;
  sum = 0;
  for (i = 0; i <= 100000000; ++i) {
    sum = sum + i;
  }
  printf("%ld\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x5f5e100,-0x10(%rbp)
05
jg     115a <main+0x4a>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <main+0x1f>
mov    -0x18(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5000000050000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stuff(int);
void hooray_2() { stuff(1); }


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

x86 assembly (clang, -O2):
<hooray_2>:
mov    $0x1,%edi
jmp    1030 <stuff@plt>

LLVM IR (-O0):
define void @hooray_2() {
%1 = call i32 @stuff(i32 1)
ret void
}

LLVM IR (-O2):
define void @hooray_2() {
%1 = tail call i32 @stuff(i32 1)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll45(struct __test_metadata *);
void wrapper_epoll45(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll45(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll45>:
jmp    1030 <epoll45@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll45(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll45(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll45(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll45(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ se_list_cmp(void *, void *);
int se_list_equal(void *va, void *vb) { return !(se_list_cmp(va, vb)); }


x86 assembly (clang, -O0):
<se_list_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <se_list_cmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_list_equal>:
push   %rax
call   1030 <se_list_cmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @se_list_equal(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 @se_list_cmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @se_list_equal(i8* %0, i8* %1) {
%3 = tail call i32 @se_list_cmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double slp_dtime(void) {
  struct timeval tv;
  gettimeofday(&tv, (struct timezone *)0);
  return ((double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0));
}


x86 assembly (clang, -O0):
<slp_dtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slp_dtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @slp_dtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @slp_dtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
div3(signed char x, signed char y) { return x / y; }


x86 assembly (clang, -O0):
<div3>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<div3>:
mov    %edi,%eax
cwtd
idiv   %si
cwtl
ret

LLVM IR (-O0):
define i32 @div3(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sdiv i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @div3(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = sdiv i16 %3, %4
%6 = sext i16 %5 to i32
ret i32 %6
}
int rc_cpt_entry(int blk) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rc_cpt_entry(i32 %0) {
ret i32 0
}
int test_imm_98int64_lowword_mem(long long *val) {
  return ((*val) & (0x98 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_98int64_lowword_mem>:
testb  $0x98,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_98int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 152
%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_98int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
int pthread_yield(void) {
  sched_yield();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_yield() {
%1 = tail call i32 (...) @sched_yield()
ret i32 0
}
/* Variables and functions */
int rand();
int k2_random_int(int min, int max_inclusive) {
  int range = max_inclusive - min + 1;
  int val = rand() % range;
  return val + min;
}


x86 assembly (clang, -O0):
<k2_random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k2_random_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @k2_random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = call i32 (...) @rand()
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @k2_random_int(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %4
%7 = add nsw i32 %6, %0
ret i32 %7
}