xunge/DecIR huggingface dataset:
unsigned short inswap_le16(unsigned short num) {
  return (num >> 8) | ((num & 0xff) << 8);
}


x86 assembly (clang, -O0):
<inswap_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inswap_le16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @inswap_le16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @inswap_le16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ burnstack(int);
int /*<<< orphan*/ do_x25519_base(int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ const *);
void x25519_base(uint8_t out[32], const uint8_t scalar[32]) {
  do_x25519_base(out, scalar);
  burnstack(2048);
}


x86 assembly (clang, -O0):
<x25519_base>:
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 <do_x25519_base@plt>
mov    $0x800,%edi
call   1040 <burnstack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x25519_base>:
push   %rax
call   1030 <do_x25519_base@plt>
mov    $0x800,%edi
pop    %rax
jmp    1040 <burnstack@plt>

LLVM IR (-O0):
define void @x25519_base(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 @do_x25519_base(i32* %5, i32* %6)
%8 = call i32 @burnstack(i32 2048)
ret void
}

LLVM IR (-O2):
define void @x25519_base(i32* %0, i32* %1) {
%3 = tail call i32 @do_x25519_base(i32* %0, i32* %1)
%4 = tail call i32 @burnstack(i32 2048)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello World.");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void pollen_math_Absolute_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @pollen_math_Absolute_targetInit__I() {
ret void
}
unsigned long usl_hash_partial_name(unsigned long c, unsigned long prevhash) {
  return (prevhash + (c << 4) + (c >> 4)) * 11;
}


x86 assembly (clang, -O0):
<usl_hash_partial_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
add    %rcx,%rax
imul   $0xb,%rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usl_hash_partial_name>:
mov    %rdi,%rax
shl    $0x4,%rax
add    %rsi,%rax
shr    $0x4,%rdi
add    %rax,%rdi
lea    (%rdi,%rdi,4),%rax
lea    (%rdi,%rax,2),%rax
ret

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

LLVM IR (-O2):
define i64 @usl_hash_partial_name(i64 %0, i64 %1) {
%3 = shl i64 %0, 4
%4 = add i64 %3, %1
%5 = lshr i64 %0, 4
%6 = add i64 %4, %5
%7 = mul i64 %6, 11
ret i64 %7
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_back(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x0090);
}


x86 assembly (clang, -O0):
<ieee80211_is_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x94,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_back>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x94,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_back(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 148)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_back(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 148)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rsl_dump_ext(int level) {
  while (level-- > 0)
    printf("  ");
}


x86 assembly (clang, -O0):
<rsl_dump_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <rsl_dump_ext+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <rsl_dump_ext+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsl_dump_ext>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <rsl_dump_ext+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <rsl_dump_ext+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @rsl_dump_ext(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char *);
int f_udf_arg(int mode, unsigned char **sec, float *data, unsigned int ndata,
              char *inv_out, void **local, const char *arg1, const char *arg2) {
  fatal_error("User Defined Functions are not installed", "");
  return 1;
}


x86 assembly (clang, -O0):
<f_udf_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec3(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <fatal_error@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_udf_arg>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <fatal_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"User Defined Functions are not installed\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f_udf_arg(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = alloca i32
%10 = alloca i8**
%11 = alloca float*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8**
%15 = alloca i8*
%16 = alloca i8*
store i32 %0, i32* %9
store i8** %1, i8*** %10
store float* %2, float** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8** %5, i8*** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%17 = call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [41 x i8] c"User Defined Functions are not installed\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f_udf_arg(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7) {
%9 = tail call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
char *str_lower(char *t) {
  char *s = t;
  while (*t) {
    if (*t >= 'A' && *t <= 'Z')
      *t = *t + 'a' - 'A';
    t++;
  }
  return s;
}


x86 assembly (clang, -O0):
<str_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <str_lower+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1152 <str_lower+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1152 <str_lower+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <str_lower+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_lower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <str_lower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <str_lower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <str_lower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <str_lower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <str_lower+0x10>
ret

LLVM IR (-O0):
define i8* @str_lower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %30
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %27
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %27
19: ; preds = %14
%20 = load i8*, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 97
%24 = sub nsw i32 %23, 65
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %2
store i8 %25, i8* %26
br label %27
27: ; preds = %19, %14, %9
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
br label %5
30: ; preds = %5
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @str_lower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  enum { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } week;
  week = 5;
  switch (week) {
  case Sunday:
  case Saturday:
    printf("You can rest today!");
    break;
  case Monday:
  case Wednesday:
  case Tuesday:
  case Thursday:
  case Friday:
    printf("Go to work!");
    break;
  default:
    printf("Not a valid day");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     115e <main+0x4e>
jmp    1139 <main+0x29>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x5,%eax
jb     116f <main+0x5f>
jmp    114d <main+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
jne    1180 <main+0x70>
jmp    115e <main+0x4e>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x7c>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x7c>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"You can rest today!\00"
@.str.1 = [12 x i8] c"Go to work!\00"
@.str.2 = [16 x i8] c"Not a valid day\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 6, label %4
i32 1, label %6
i32 3, label %6
i32 2, label %6
i32 4, label %6
i32 5, label %6
]
4: ; preds = %0, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %0, %0, %0, %0, %0
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"Go to work!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
const char *ccnxPortalAbout_Name(void) { return "CCNx Portal API"; }


x86 assembly (clang, -O0):
<ccnxPortalAbout_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnxPortalAbout_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"CCNx Portal API\00"
define i8* @ccnxPortalAbout_Name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"CCNx Portal API\00"
define i8* @ccnxPortalAbout_Name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ copysign(double, double);
int /*<<< orphan*/ copysignf(float, float);
int /*<<< orphan*/ copysignl(long double, long double);
void uninitvar_copysign(void) {
  float f1, f2;
  (void)copysignf(f1, f2);
  double d1, d2;
  (void)copysign(d1, d2);
  long double ld1, ld2;
  (void)copysignl(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_copysign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1050 <copysignf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <copysign@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <copysignl@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_copysign>:
sub    $0x28,%rsp
call   1050 <copysignf@plt>
call   1040 <copysign@plt>
call   1030 <copysignl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_copysign() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call i32 @copysignf(float %7, float %8)
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @copysign(double %10, double %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load x86_fp80, x86_fp80* %6
%15 = call i32 @copysignl(x86_fp80 %13, x86_fp80 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_copysign() {
%1 = tail call i32 @copysignf(float undef, float undef)
%2 = tail call i32 @copysign(double undef, double undef)
%3 = tail call i32 @copysignl(x86_fp80 undef, x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arg_long3(long, long, long);
void arg_long2(long a, long b) { arg_long3(a, b, b + 1); }


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

x86 assembly (clang, -O2):
<arg_long2>:
lea    0x1(%rsi),%rdx
jmp    1030 <arg_long3@plt>

LLVM IR (-O0):
define void @arg_long2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 1
%9 = call i32 @arg_long3(i64 %5, i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @arg_long2(i64 %0, i64 %1) {
%3 = add nsw i64 %1, 1
%4 = tail call i32 @arg_long3(i64 %0, i64 %1, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ index_add_arg(char *);
void cm_kindex(void) { index_add_arg("ky"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ky\00"
define void @cm_kindex() {
%1 = call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ky\00"
define void @cm_kindex() {
%1 = tail call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int write(int, char const *, size_t);
int write_to_pipe(int fd, const char *data, size_t len) {
  return write(fd, data, len);
}


x86 assembly (clang, -O0):
<write_to_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_pipe>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @write_to_pipe(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @write(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_to_pipe(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct sim_state {
  int dummy;
};
struct run_ops {
  int dummy;
};

/* Variables and functions */
int interp_step_sim(struct sim_state *, struct run_ops const *, void **,
                    void *);
int interp_run_sim(struct sim_state *s, const struct run_ops *ops,
                   void **run_data, void *ops_data) {
  int rc = 0;
  *run_data = NULL;
  do {
    rc = interp_step_sim(s, ops, run_data, ops_data);
  } while (rc > 0);
  return rc;
}


x86 assembly (clang, -O0):
<interp_run_sim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <interp_step_sim@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jg     113a <interp_run_sim+0x2a>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_run_sim>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
movq   $0x0,(%rdx)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1030 <interp_step_sim@plt>
test   %eax,%eax
jg     1130 <interp_run_sim+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.sim_state = type { i32 }
%struct.run_ops = type { i32 }
define i32 @interp_run_sim(%struct.sim_state* %0, %struct.run_ops* %1, i8** %2, i8* %3) {
%5 = alloca %struct.sim_state*
%6 = alloca %struct.run_ops*
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i32
store %struct.sim_state* %0, %struct.sim_state** %5
store %struct.run_ops* %1, %struct.run_ops** %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
store i32 0, i32* %9
%10 = load i8**, i8*** %7
store i8* null, i8** %10
br label %11
11: ; preds = %17, %4
%12 = load %struct.sim_state*, %struct.sim_state** %5
%13 = load %struct.run_ops*, %struct.run_ops** %6
%14 = load i8**, i8*** %7
%15 = load i8*, i8** %8
%16 = call i32 @interp_step_sim(%struct.sim_state* %12, %struct.run_ops* %13, i8** %14, i8* %15)
store i32 %16, i32* %9
br label %17
17: ; preds = %11
%18 = load i32, i32* %9
%19 = icmp sgt i32 %18, 0
br i1 %19, label %11, label %20
20: ; preds = %17
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
%struct.sim_state = type { i32 }
%struct.run_ops = type { i32 }
define i32 @interp_run_sim(%struct.sim_state* %0, %struct.run_ops* %1, i8** %2, i8* %3) {
store i8* null, i8** %2
br label %5
5: ; preds = %5, %4
%6 = tail call i32 @interp_step_sim(%struct.sim_state* %0, %struct.run_ops* %1, i8** %2, i8* %3)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
ret i32 %6
}
/* Variables and functions */
int foo(int);
int main(void) { return foo(0) + foo(1) + foo(13); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <foo@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0xd,%edi
call   1030 <foo@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = call i32 @foo(i32 1)
%4 = add nsw i32 %2, %3
%5 = call i32 @foo(i32 13)
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @foo(i32 13)
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
char inb(int);
char com_getc(void) {
  while ((inb(0x3f8 + 5) & 1) == 0)
    ;
  return inb(0x3f8 + 0);
}


x86 assembly (clang, -O0):
<com_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <com_getc+0x9>
mov    $0x3fd,%edi
call   1030 <inb@plt>
movsbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1137 <com_getc+0x27>
jmp    1119 <com_getc+0x9>
mov    $0x3f8,%edi
call   1030 <inb@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_getc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3fd,%edi
call   1030 <inb@plt>
test   $0x1,%al
je     1120 <com_getc+0x10>
mov    $0x3f8,%edi
pop    %rax
jmp    1030 <inb@plt>

LLVM IR (-O0):
define signext i8 @com_getc() {
br label %1
1: ; preds = %6, %0
%2 = call signext i8 @inb(i32 1021)
%3 = sext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = call signext i8 @inb(i32 1016)
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @com_getc() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 @inb(i32 1021)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call signext i8 @inb(i32 1016)
ret i8 %6
}
/* Variables and functions */
scalar_t__ log2(double);
unsigned short libmLog2(unsigned short value) {
  return (unsigned short)log2((double)value);
}


x86 assembly (clang, -O0):
<libmLog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
call   1030 <log2@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libmLog2>:
push   %rax
cvtsi2sd %edi,%xmm0
call   1030 <log2@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @libmLog2(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = uitofp i16 %3 to double
%5 = call i64 @log2(double %4)
%6 = trunc i64 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @libmLog2(i16 zeroext %0) {
%2 = uitofp i16 %0 to double
%3 = tail call i64 @log2(double %2)
%4 = trunc i64 %3 to i16
ret i16 %4
}
int func(void) {
  printf("%s\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.func = [5 x i8] c"func\00"
define i32 @func() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.func, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__func__.func = [5 x i8] c"func\00"
define i32 @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.func, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
void foo(void) {
  int x[8] __attribute__((aligned(64))) = {1, 1, 1, 1, 1, 1, 1, 1};
  bar(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffffc0,%rsp
sub    $0x40,%rsp
mov    0xedd(%rip),%rax
mov    %rax,(%rsp)
mov    0xeda(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0xed6(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0xed2(%rip),%rax
mov    %rax,0x18(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffffc0,%rsp
sub    $0x40,%rsp
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@__const.foo.x = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define void @foo() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bar(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.foo.x = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define void @foo() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bar(i32* %3)
ret void
}
int get_bit(int number, int index) { return (number & (1 << index)) != 0; }


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
void decimal_to_bin(const size_t max_size, const size_t number, size_t *bits) {
  size_t mask = max_size;
  size_t i = 0;
  while (mask >>= 1) {
    bits[i] = !!(mask & number);
    i++;
  }
}


x86 assembly (clang, -O0):
<decimal_to_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     116e <decimal_to_bin+0x6e>
mov    -0x20(%rbp),%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <decimal_to_bin+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_to_bin>:
cmp    $0x2,%rdi
jb     112b <decimal_to_bin+0x2b>
mov    %rdi,%rax
nopl   0x0(%rax)
shr    %rax
xor    %ecx,%ecx
test   %rsi,%rax
setne  %cl
mov    %rcx,(%rdx)
add    $0x8,%rdx
cmp    $0x3,%rdi
mov    %rax,%rdi
ja     1110 <decimal_to_bin+0x10>
ret

LLVM IR (-O0):
define void @decimal_to_bin(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%9 = load i64, i64* %4
store i64 %9, i64* %7
store i64 0, i64* %8
br label %10
10: ; preds = %14, %3
%11 = load i64, i64* %7
%12 = lshr i64 %11, 1
store i64 %12, i64* %7
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i64, i64* %7
%16 = load i64, i64* %5
%17 = and i64 %15, %16
%18 = icmp ne i64 %17, 0
%19 = xor i1 %18, true
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = sext i32 %21 to i64
%23 = load i64*, i64** %6
%24 = load i64, i64* %8
%25 = getelementptr inbounds i64, i64* %23, i64 %24
store i64 %22, i64* %25
%26 = load i64, i64* %8
%27 = add i64 %26, 1
store i64 %27, i64* %8
br label %10
28: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @decimal_to_bin(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = icmp ult i64 %0, 2
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %8, %5 ], [ %0, %3 ]
%7 = phi i64 [ %13, %5 ], [ 0, %3 ]
%8 = lshr i64 %6, 1
%9 = and i64 %8, %1
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = getelementptr inbounds i64, i64* %2, i64 %7
store i64 %11, i64* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp ult i64 %6, 4
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
main(int argc, char *argv[]) {
  printf("This program does nothing, and wastes a lot of space doing it!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [64 x i8] c"This program does nothing, and wastes a lot of space doing it!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [63 x i8] c"This program does nothing, and wastes a lot of space doing it!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
XSubtractRegion() {}


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

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

LLVM IR (-O0):
define i32 @XSubtractRegion() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSubtractRegion() {
ret i32 undef
}
void gdk_window_set_decorations() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_decorations() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from prog.c\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Hello from prog.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, ...);
void print_format_char(const char *format_string, char parameter) {
  printf("\"");
  printf(format_string, parameter);
  printf("\"\t");
  printf("Value = '%c', Format = \"%s\"\n", parameter, format_string);
}


x86 assembly (clang, -O0):
<print_format_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_format_char>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x22,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\22\00"
@.str.1 = [3 x i8] c"\22\09\00"
@.str.2 = [29 x i8] c"Value = '%c', Format = \22%s\22\0A\00"
define void @print_format_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* %6, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = load i8*, i8** %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"\22\09\00"
@.str.2 = [29 x i8] c"Value = '%c', Format = \22%s\22\0A\00"
define void @print_format_char(i8* %0, i8 signext %1) {
%3 = tail call i32 @putchar(i32 34)
%4 = sext i8 %1 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %4, i8* %0)
ret void
}
int vdeFun_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 44;
  return 0;
}


x86 assembly (clang, -O0):
<vdeFun_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vdeFun_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vdeFun_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vdeFun_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vdeFun_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x2c,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdeFun_work>:
test   %rdi,%rdi
je     110b <vdeFun_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vdeFun_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vdeFun_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vdeFun_work+0x2c>
movl   $0x2c,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vdeFun_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%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
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 4, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 3, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 44, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @vdeFun_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 44, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ f3();
int /*<<< orphan*/ f4();
int /*<<< orphan*/ f5();
int /*<<< orphan*/ f6();
int /*<<< orphan*/ f7();
int main(void) {
  f1();
  f2();
  f3();
  f4();
  f5();
  f6();
  f7();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
mov    $0x0,%al
call   1050 <f3@plt>
mov    $0x0,%al
call   1090 <f4@plt>
mov    $0x0,%al
call   1080 <f5@plt>
mov    $0x0,%al
call   1040 <f6@plt>
mov    $0x0,%al
call   1070 <f7@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1050 <f3@plt>
xor    %eax,%eax
call   1090 <f4@plt>
xor    %eax,%eax
call   1080 <f5@plt>
xor    %eax,%eax
call   1040 <f6@plt>
xor    %eax,%eax
call   1070 <f7@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f2()
%4 = call i32 (...) @f3()
%5 = call i32 (...) @f4()
%6 = call i32 (...) @f5()
%7 = call i32 (...) @f6()
%8 = call i32 (...) @f7()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 (...) @f3()
%4 = tail call i32 (...) @f4()
%5 = tail call i32 (...) @f5()
%6 = tail call i32 (...) @f6()
%7 = tail call i32 (...) @f7()
ret i32 0
}
choice(char **names, int *n) {
  char *nm[] = {"lv-lotka-volterra", "vdp-van der pol", "duff-duffing"};
  *n = 3;
  names[0] = nm[0];
  names[1] = nm[1];
  names[2] = nm[2];
}


x86 assembly (clang, -O0):
<choice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2d1d(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2d1a(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2d17(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<choice>:
movl   $0x3,(%rsi)
lea    0xef3(%rip),%rax
mov    %rax,(%rdi)
lea    0xefb(%rip),%rax
mov    %rax,0x8(%rdi)
lea    0xf00(%rip),%rax
mov    %rax,0x10(%rdi)
ret

LLVM IR (-O0):
@.str = [18 x i8] c"lv-lotka-volterra\00"
@.str.1 = [16 x i8] c"vdp-van der pol\00"
@.str.2 = [13 x i8] c"duff-duffing\00"
@__const.choice.nm = [3 x i8*] [i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i32 0, i32 0)]
define i32 @choice(i8** %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca [3 x i8*]
store i8** %0, i8*** %4
store i32* %1, i32** %5
%7 = bitcast [3 x i8*]* %6 to i8*
%8 = load i32*, i32** %5
store i32 3, i32* %8
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 0
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
store i8* %10, i8** %12
%13 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 1
store i8* %14, i8** %16
%17 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 2
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 2
store i8* %18, i8** %20
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [18 x i8] c"lv-lotka-volterra\00"
@.str.1 = [16 x i8] c"vdp-van der pol\00"
@.str.2 = [13 x i8] c"duff-duffing\00"
define i32 @choice(i8** nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 3, i32* %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %0
%3 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %4
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
bool stringsEqual(char *str1, char *str2) {
  int length1 = strlen(str1);
  int length2 = strlen(str2);
  if ((length1 == length2) && !strncmp(str1, str2, length1)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<stringsEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1179 <stringsEqual+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1179 <stringsEqual+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1180 <stringsEqual+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringsEqual>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebp
jne    114e <stringsEqual+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1152 <stringsEqual+0x32>
xor    %eax,%eax
jmp    1157 <stringsEqual+0x37>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @stringsEqual(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %2
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
unsigned int jent_version(void) {
  unsigned int version = 0;
  version = 2 * 1000000;
  version += 1 * 10000;
  version += 1 * 100;
  return version;
}


x86 assembly (clang, -O0):
<jent_version>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1e8480,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2710,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @jent_version() {
%1 = alloca i32
store i32 0, i32* %1
store i32 2000000, i32* %1
%2 = load i32, i32* %1
%3 = add i32 %2, 10000
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add i32 %4, 100
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @jent_version() {
ret i32 2010100
}
/* Variables and functions */
int f263(int *);
int f264(int *p) { return f263(p); }


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

x86 assembly (clang, -O2):
<f264>:
jmp    1030 <f263@plt>

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

LLVM IR (-O2):
define i32 @f264(i32* %0) {
%2 = tail call i32 @f263(i32* %0)
ret i32 %2
}
void RTRandAdvS32Ex(void) {}


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

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

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

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