xunge/DecIR huggingface dataset:
int main() {
  char string1[] = "a[b]c";
  char string2[] = "} abc {";
  char string3[] = "<ok string [good]>";
  char string4[] = "DEF ]<>";
  char string5[] = "Open but not close (///";
  char string6[] = "a[b[c<def>m{n]pq}]()";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xee9(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xee0(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee9(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xee1(%rip),%al
mov    %al,-0x1e(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x60(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x5c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.string1 = [6 x i8] c"a[b]c\00"
@__const.main.string2 = [8 x i8] c"} abc {\00"
@__const.main.string3 = [19 x i8] c"<ok string [good]>\00"
@__const.main.string4 = [8 x i8] c"DEF ]<>\00"
@__const.main.string5 = [24 x i8] c"Open but not close (///\00"
@__const.main.string6 = [21 x i8] c"a[b[c<def>m{n]pq}]()\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [8 x i8]
%4 = alloca [19 x i8]
%5 = alloca [8 x i8]
%6 = alloca [24 x i8]
%7 = alloca [21 x i8]
store i32 0, i32* %1
%8 = bitcast [6 x i8]* %2 to i8*
%9 = bitcast [8 x i8]* %3 to i8*
%10 = bitcast [19 x i8]* %4 to i8*
%11 = bitcast [8 x i8]* %5 to i8*
%12 = bitcast [24 x i8]* %6 to i8*
%13 = bitcast [21 x i8]* %7 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int stack_push(int *stack, int num) {
  if (stack[0] == 6)
    return 0;
  stack[0]++;
  stack[stack[0]] = num;
  return 1;
}


x86 assembly (clang, -O0):
<stack_push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x6,(%rax)
jne    1124 <stack_push+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1147 <stack_push+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_push>:
movslq (%rdi),%rcx
xor    %eax,%eax
cmp    $0x6,%rcx
je     111a <stack_push+0x1a>
lea    0x1(%rcx),%rax
mov    %eax,(%rdi)
mov    %esi,0x4(%rdi,%rcx,4)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @stack_push(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 6
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = add nsw i32 %3, 1
store i32 %6, i32* %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %1, i32* %8
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int main(void) {
  struct stat buf;
  stat("tata", &buf);
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"tata\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"tata\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ prints(char *);
int screen_clear() { prints("[H[J"); }


x86 assembly (clang, -O0):
<screen_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <prints@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define i32 @screen_clear() {
%1 = alloca i32
%2 = call i32 @prints(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define i32 @screen_clear() {
%1 = tail call i32 @prints(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void mykeysig(sf, mi) int sf, mi;
{
  prtime();
  printf("KeySig %d %s\n", (sf > 127 ? sf - 256 : sf),
         (mi ? "minor" : "major"));
}


x86 assembly (clang, -O0):
<mykeysig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
cmpl   $0x7f,-0x4(%rbp)
jle    114f <mykeysig+0x2f>
mov    -0x4(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <mykeysig+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xeb2(%rip),%rdx
lea    0xea5(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mykeysig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
lea    -0x100(%rbx),%esi
cmp    $0x7f,%ebx
cmovle %ebx,%esi
test   %ebp,%ebp
lea    0xed1(%rip),%rax
lea    0xec4(%rip),%rdx
cmove  %rax,%rdx
lea    0xeab(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"KeySig %d %s\0A\00"
@.str.1 = [6 x i8] c"minor\00"
@.str.2 = [6 x i8] c"major\00"
define void @mykeysig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @prtime()
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 127
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 256
br label %13
11: ; preds = %2
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"KeySig %d %s\0A\00"
@.str.1 = [6 x i8] c"minor\00"
@.str.2 = [6 x i8] c"major\00"
define void @mykeysig(i32 %0, i32 %1) {
%3 = tail call i32 (...) @prtime()
%4 = icmp sgt i32 %0, 127
%5 = add nsw i32 %0, -256
%6 = select i1 %4, i32 %5, i32 %0
%7 = icmp eq i32 %1, 0
%8 = select i1 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %8)
ret void
}
void c_pomp_workshare_exit_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_workshare_exit_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_extract_si64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((__target__("sse4a")))
mm_extract_si64_wrap(__m128i x, __m128i y) {
  return _mm_extract_si64(x, y);
}


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

x86 assembly (clang, -O2):
<mm_extract_si64_wrap>:
jmp    1030 <_mm_extract_si64@plt>

LLVM IR (-O0):
define i32 @mm_extract_si64_wrap(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 @_mm_extract_si64(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mm_extract_si64_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_extract_si64(i32 %0, i32 %1)
ret i32 %3
}
unsigned short test5(unsigned short a) {
  a ^= 0x8002;
  a >>= 1;
  a |= 0x8001;
  return a;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
xor    $0x8002,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
or     $0x8001,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
mov    %edi,%eax
shr    %eax
or     $0xffff8001,%eax
xor    $0x4000,%eax
ret

LLVM IR (-O0):
define zeroext i16 @test5(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = xor i32 %4, 32770
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = trunc i32 %9 to i16
store i16 %10, i16* %2
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = or i32 %12, 32769
%14 = trunc i32 %13 to i16
store i16 %14, i16* %2
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @test5(i16 zeroext %0) {
%2 = lshr i16 %0, 1
%3 = or i16 %2, -32767
%4 = xor i16 %3, 16384
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ fini_helper(int);
void ljmm_fini(void) { fini_helper(1); }


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

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

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

LLVM IR (-O2):
define void @ljmm_fini() {
%1 = tail call i32 @fini_helper(i32 1)
ret void
}
int loaderGetShort(char *src) {
  int i;
  i = ((src[1] & 255) << 8) + (src[0] & 255);
  return i;
}


x86 assembly (clang, -O0):
<loaderGetShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loaderGetShort>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @loaderGetShort(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = and i32 %13, 255
%15 = add nsw i32 %9, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @loaderGetShort(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void REPORT(const char *x) {
  fprintf(stderr, "Report '%s' to zhanxw@umich.edu\n", x);
}


x86 assembly (clang, -O0):
<REPORT>:
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):
<REPORT>:
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 = [33 x i8] c"Report '%s' to zhanxw@umich.edu\0A\00"
define void @REPORT(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 ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Report '%s' to zhanxw@umich.edu\0A\00"
define void @REPORT(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void write_int_(int fd, int n) {
  if (n > 0) {
    write_int_(fd, n / 10);
    int rem = n % 10;
    char c = '0' + rem;
    write(fd, &c, 1);
  }
}


x86 assembly (clang, -O0):
<write_int_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1175 <write_int_+0x55>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1040 <write_int_@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int_>:
test   %esi,%esi
jle    1171 <write_int_+0x51>
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %edi,%r14d
mov    %esi,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%esi
call   1040 <write_int_@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
or     $0x30,%bpl
mov    %bpl,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    %r14d,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @write_int_(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 10
%13 = load i32, i32* %4
%14 = srem i32 %13, 10
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %6
%18 = load i32, i32* %3
%19 = call i32 @write(i32 %18, i8* %6, i32 1)
br label %20
20: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @write_int_(i32 %0, i32 %1) {
%3 = alloca i8
%4 = icmp sgt i32 %1, 0
br i1 %4, label %6, label %5
5: ; preds = %2, %6
ret void
6: ; preds = %2
%7 = udiv i32 %1, 10
tail call void @write_int_(i32 %0, i32 %7)
%8 = urem i32 %1, 10
%9 = trunc i32 %8 to i8
%10 = or i8 %9, 48
store i8 %10, i8* %3
%11 = call i32 @write(i32 %0, i8* %3, i32 1)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) libx1_loaded(void) {
  printf("Libx1: loaded\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Libx1: loaded\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libx1_loaded, i8* null }]
define void @libx1_loaded() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libx1_loaded, i8* null }]
@str = [14 x i8] c"Libx1: loaded\00"
define void @libx1_loaded() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
double hourAngle(double t, double p) {
  double h;
  h = 6.283185307 * t / p;
  printf("hourAngle: %.4g %.4g %.4g\n", t, p, h);
  return (h);
}


x86 assembly (clang, -O0):
<hourAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hourAngle>:
push   %rax
movsd  0xee7(%rip),%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"hourAngle: %.4g %.4g %.4g\0A\00"
define double @hourAngle(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fmul double 0x401921FB54411744, %6
%8 = load double, double* %4
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %10, double %11, double %12)
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
@.str = [27 x i8] c"hourAngle: %.4g %.4g %.4g\0A\00"
define double @hourAngle(double %0, double %1) {
%3 = fmul double %0, 0x401921FB54411744
%4 = fdiv double %3, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %4)
ret double %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void mp2vseq_set_vertical(uint8_t *p_mp2vseq, uint16_t i_vertical) {
  p_mp2vseq[5] &= 0xf0;
  p_mp2vseq[5] |= (i_vertical >> 8) & 0xf;
  p_mp2vseq[6] = i_vertical & 0xff;
}


x86 assembly (clang, -O0):
<mp2vseq_set_vertical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xf0,%ecx
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xf,%ecx
mov    -0x8(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_set_vertical>:
mov    $0xf0,%eax
and    0x14(%rdi),%eax
movzbl %sil,%ecx
shr    $0x8,%esi
and    $0xf,%esi
or     %eax,%esi
mov    %esi,0x14(%rdi)
mov    %ecx,0x18(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseq_set_vertical(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 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
%8 = and i32 %7, 240
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 15
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 5
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32, i32* %4
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 6
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @mp2vseq_set_vertical(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
%4 = load i32, i32* %3
%5 = and i32 %4, 240
%6 = lshr i32 %1, 8
%7 = and i32 %6, 15
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = and i32 %1, 255
%10 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %9, i32* %10
ret void
}
/* Variables and functions */
char *my_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *my_strdup(char *str) {
  char *x = my_malloc(strlen(str) + 3);
  strcpy(x, str);
  return x;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x3,%rdi
call   1030 <my_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x3(%rax),%rdi
call   1030 <my_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 3
%7 = call i8* @my_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 3
%4 = tail call i8* @my_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void noop(void *unused, ...) {
  if (unused) {
    (void)0;
  }
}


x86 assembly (clang, -O0):
<noop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <noop+0x18>
jmp    1118 <noop+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @noop(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @noop(i8* nocapture %0, ...) {
ret void
}
void SetField32(unsigned *A, register unsigned index, register unsigned x) {
  A[index] = x;
}


x86 assembly (clang, -O0):
<SetField32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetField32>:
mov    %esi,%eax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @SetField32(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* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @SetField32(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int random();
int __VERIFIER_nondet_int() { return random() % 1000; }


x86 assembly (clang, -O0):
<__VERIFIER_nondet_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_nondet_int>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_int() {
%1 = call i32 (...) @random()
%2 = srem i32 %1, 1000
ret i32 %2
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_int() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 1000
ret i32 %2
}
void foo230() {}


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

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

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

LLVM IR (-O2):
define void @foo230() {
ret void
}
int ld_ge_mm2(long double *a1, long double *a2) { return !(((*a1) >= (*a2))); }


x86 assembly (clang, -O0):
<ld_ge_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ge_mm2>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_ge_mm2(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp oge x86_fp80 %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @ld_ge_mm2(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp ult x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
float sqrtf(float);
float vec3_dot(struct vec3 const *, struct vec3 const *);
float vec3_len(const struct vec3 *v) {
  float dot_val = vec3_dot(v, v);
  return (dot_val > 0.0f) ? sqrtf(dot_val) : 0.0f;
}


x86 assembly (clang, -O0):
<vec3_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec3_dot@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1163 <vec3_len+0x43>
movss  -0xc(%rbp),%xmm0
call   1040 <sqrtf@plt>
movss  %xmm0,-0x10(%rbp)
jmp    1170 <vec3_len+0x50>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1170 <vec3_len+0x50>
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_len>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3_dot@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1140 <vec3_len+0x20>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1145 <vec3_len+0x25>
xorps  %xmm1,%xmm1
sqrtss %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrtf@plt>

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define float @vec3_len(%struct.vec3* %0) {
%2 = alloca %struct.vec3*
%3 = alloca float
store %struct.vec3* %0, %struct.vec3** %2
%4 = load %struct.vec3*, %struct.vec3** %2
%5 = load %struct.vec3*, %struct.vec3** %2
%6 = call float @vec3_dot(%struct.vec3* %4, %struct.vec3* %5)
store float %6, float* %3
%7 = load float, float* %3
%8 = fcmp ogt float %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load float, float* %3
%11 = call float @sqrtf(float %10)
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %9
%14 = phi float [ %11, %9 ], [ 0.000000e+00, %12 ]
ret float %14
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define float @vec3_len(%struct.vec3* %0) {
%2 = tail call float @vec3_dot(%struct.vec3* %0, %struct.vec3* %0)
%3 = fcmp ogt float %2, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call float @sqrtf(float %2)
br label %6
6: ; preds = %1, %4
%7 = phi float [ %5, %4 ], [ 0.000000e+00, %1 ]
ret float %7
}
/* Variables and functions */
int myProduct(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  int y = 7;
  printf(" 5 x 7 = %d\n", myProduct(x, y));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c" 5 x 7 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @myProduct(i32 5, i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void handle_HUP(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_HUP(i32 %0) {
ret void
}
/* Variables and functions */
int __ocml_ilogb_f32(float);
int ilogbf(float x) { return __ocml_ilogb_f32(x); }


x86 assembly (clang, -O0):
<ilogbf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_ilogb_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilogbf>:
jmp    1030 <__ocml_ilogb_f32@plt>

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

LLVM IR (-O2):
define i32 @ilogbf(float %0) {
%2 = tail call i32 @__ocml_ilogb_f32(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ AcknowledgeInterrupt(unsigned int);
int /*<<< orphan*/ EnableInterrupts();
int /*<<< orphan*/ cprintf(char *, unsigned int);
void stubHandler(unsigned int nIRQ, void *pParam) {
  cprintf("stubHandler IRQ %d\n", nIRQ);
  AcknowledgeInterrupt(nIRQ);
  EnableInterrupts();
  return;
}


x86 assembly (clang, -O0):
<stubHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <cprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <AcknowledgeInterrupt@plt>
mov    $0x0,%al
call   1050 <EnableInterrupts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stubHandler>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1040 <cprintf@plt>
mov    %ebx,%edi
call   1030 <AcknowledgeInterrupt@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <EnableInterrupts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"stubHandler IRQ %d\0A\00"
define void @stubHandler(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @cprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @AcknowledgeInterrupt(i32 %7)
%9 = call i32 (...) @EnableInterrupts()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"stubHandler IRQ %d\0A\00"
define void @stubHandler(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @cprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @AcknowledgeInterrupt(i32 %0)
%5 = tail call i32 (...) @EnableInterrupts()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver16p_getbox(int, int, int, int, void *, int);
void __svgalib_driver16p_getboxpart(int x, int y, int w, int h, int ow, int oh,
                                    void *b, int xo, int yo) {
  __svgalib_driver16p_getbox(x, y, w, h, b + yo * ow + xo, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver16p_getboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
add    %rax,%r8
movslq 0x18(%rbp),%rax
add    %rax,%r8
mov    -0x14(%rbp),%r9d
call   1030 <__svgalib_driver16p_getbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver16p_getboxpart>:
mov    %r8d,%r9d
movslq 0x10(%rsp),%r10
mov    0x18(%rsp),%eax
imul   %r8d,%eax
movslq %eax,%r8
add    0x8(%rsp),%r8
add    %r10,%r8
jmp    1030 <__svgalib_driver16p_getbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver16p_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i8*, i8** %16
%24 = load i32, i32* %18
%25 = load i32, i32* %14
%26 = mul nsw i32 %24, %25
%27 = sext i32 %26 to i64
%28 = getelementptr i8, i8* %23, i64 %27
%29 = load i32, i32* %17
%30 = sext i32 %29 to i64
%31 = getelementptr i8, i8* %28, i64 %30
%32 = load i32, i32* %14
%33 = call i32 @__svgalib_driver16p_getbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %31, i32 %32)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver16p_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = mul nsw i32 %8, %4
%11 = sext i32 %10 to i64
%12 = getelementptr i8, i8* %6, i64 %11
%13 = sext i32 %7 to i64
%14 = getelementptr i8, i8* %12, i64 %13
%15 = tail call i32 @__svgalib_driver16p_getbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %14, i32 %4)
ret void
}
int bang(int x) { return ((x | ((~x) + 1)) >> 31) + 1; }


x86 assembly (clang, -O0):
<bang>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
or     %ecx,%eax
sar    $0x1f,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bang>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @bang(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
extern void libvampsdk_v_2_0_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_0_present() {
ret void
}
void MP_semaset(int VV_sema, int VV_value) {}


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

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

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

LLVM IR (-O2):
define void @MP_semaset(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ maaltid();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  maaltid();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <maaltid@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <maaltid@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @maaltid()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @maaltid()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void ff_hevc_put_hevc_uni_qpel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v8_8_sse4() {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int ilog2(int);
int ilog2_32(int);
int64_t rld_delta_enc1(uint64_t x, int *width) {
  int y = ilog2(x);
  int z = ilog2_32(y + 1);
  *width = (z << 1) + 1 + y;
  return (x ^ (uint64_t)1 << y) | (uint64_t)(y + 1) << y;
}


x86 assembly (clang, -O0):
<rld_delta_enc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ilog2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <ilog2_32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
add    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    -0x14(%rbp),%edx
add    $0x1,%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rld_delta_enc1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r15d
call   1030 <ilog2@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%ebp
mov    %ebp,%edi
call   1040 <ilog2_32@plt>
lea    (%rbx,%rax,2),%eax
add    $0x1,%eax
mov    %eax,(%r14)
btc    %ebx,%r15d
mov    %ebx,%ecx
shl    %cl,%ebp
or     %r15d,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rld_delta_enc1(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* %3
%8 = call i32 @ilog2(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = call i32 @ilog2_32(i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = shl i32 %12, 1
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = shl i32 1, %19
%21 = xor i32 %18, %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %5
%25 = shl i32 %23, %24
%26 = or i32 %21, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @rld_delta_enc1(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @ilog2(i32 %0)
%4 = add i32 %3, 1
%5 = tail call i32 @ilog2_32(i32 %4)
%6 = shl i32 %5, 1
%7 = add i32 %4, %6
store i32 %7, i32* %1
%8 = shl nuw i32 1, %3
%9 = xor i32 %8, %0
%10 = shl i32 %4, %3
%11 = or i32 %9, %10
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ led_mode;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
int get_XKeyboardControl_led_mode(void *_p) {
  return (int)((XKeyboardControl *)_p)->led_mode;
}


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

x86 assembly (clang, -O2):
<get_XKeyboardControl_led_mode>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XKeyboardControl_led_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endSPI(int);
void endSRAM() { endSPI(1); }


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

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

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

LLVM IR (-O2):
define void @endSRAM() {
%1 = tail call i32 @endSPI(i32 1)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int, struct sockaddr const *, int);
int errno;
int os_bind(int s, const struct sockaddr *name, int namelen) {
  int retval;
  retval = bind(s, name, namelen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    114c <os_bind+0x3c>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_bind>:
push   %rax
call   1030 <bind@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @bind(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @errno
%16 = sub nsw i32 0, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
double my_abs(double x) {
  if (x < 0)
    x = -x;
  else
    x = x;
  return x;
}


x86 assembly (clang, -O0):
<my_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <my_abs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <my_abs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @my_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %10
8: ; preds = %1
%9 = load double, double* %2
store double %9, double* %2
br label %10
10: ; preds = %8, %5
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @my_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RST(int);
void do0xD7() { _I8080_RST(2); }


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

x86 assembly (clang, -O2):
<do0xD7>:
mov    $0x2,%edi
jmp    1030 <_I8080_RST@plt>

LLVM IR (-O0):
define void @do0xD7() {
%1 = call i32 @_I8080_RST(i32 2)
ret void
}

LLVM IR (-O2):
define void @do0xD7() {
%1 = tail call i32 @_I8080_RST(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gsc_styled_string(int, char const *);
void gsc_header_string(const char *message) { gsc_styled_string((3), message); }


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

x86 assembly (clang, -O2):
<gsc_header_string>:
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <gsc_styled_string@plt>

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

LLVM IR (-O2):
define void @gsc_header_string(i8* %0) {
%2 = tail call i32 @gsc_styled_string(i32 3, i8* %0)
ret void
}
double(_floor)(double x) { return ((long)x); }


x86 assembly (clang, -O0):
<_floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_floor>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @_floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @_floor(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
void Decrypt_Init() {}


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

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

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

LLVM IR (-O2):
define void @Decrypt_Init() {
ret void
}