xunge/DecIR huggingface dataset:
int class_hotplug(struct device *dev, const char *action) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @class_hotplug(%struct.device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int true_fn(struct atom *atom, struct action_data *action_data) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.atom = type opaque
%struct.action_data = type opaque
define i32 @true_fn(%struct.atom* nocapture readnone %0, %struct.action_data* nocapture readnone %1) {
ret i32 1
}
char *get_region_path(int region) {
  return region == 2 ? "wp34s-backup.dat" : "wp34s-lib.dat";
}


x86 assembly (clang, -O0):
<get_region_path>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xf00(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x2,%edx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_region_path>:
cmp    $0x2,%edi
lea    0xef6(%rip),%rcx
lea    0xf00(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"wp34s-backup.dat\00"
@.str.1 = [14 x i8] c"wp34s-lib.dat\00"
define i8* @get_region_path(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"wp34s-backup.dat\00"
@.str.1 = [14 x i8] c"wp34s-lib.dat\00"
define i8* @get_region_path(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
unsigned short int f38(unsigned short int x, unsigned long int y) {
  return (x >> y) | (x << (8 * 2 - y));
}


x86 assembly (clang, -O0):
<f38>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f38>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f38(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f38(i16 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i16
%4 = tail call i16 @llvm.fshr.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void affichageMenu() {
  printf("\tMenu\n"
         "1 - Creer un graphe\n"
         "2 - Lire un graphe\n"
         "3 - Inserer un sommet\n"
         "4 - Inserer une arete\n"
         "5 - Supprimer un sommet\n"
         "6 - Supprimer une arete\n"
         "7 - Afficher le graphe\n"
         "8 - Sauvegarder le graphe\n"
         "0 - Quitter\n");
}


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

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

LLVM IR (-O0):
@.str = [199 x i8] c"\09Menu\0A1 - Creer un graphe\0A2 - Lire un graphe\0A3 - Inserer un sommet\0A4 - Inserer une arete\0A5 - Supprimer un sommet\0A6 - Supprimer une arete\0A7 - Afficher le graphe\0A8 - Sauvegarder le graphe\0A0 - Quitter\0A\00"
define void @affichageMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [198 x i8] c"\09Menu\0A1 - Creer un graphe\0A2 - Lire un graphe\0A3 - Inserer un sommet\0A4 - Inserer une arete\0A5 - Supprimer un sommet\0A6 - Supprimer une arete\0A7 - Afficher le graphe\0A8 - Sauvegarder le graphe\0A0 - Quitter\00"
define void @affichageMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([198 x i8], [198 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_it;
void X509_CRL_free(X509_CRL *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_it);
}


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

x86 assembly (clang, -O2):
<X509_CRL_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@X509_CRL_it = global i32 0
define void @X509_CRL_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @X509_CRL_it)
ret void
}

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define void @X509_CRL_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_CRL_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void launcher_usage(char *name) {
  fprintf(
      stderr,
      "Usage: %s [-mfslrudh] [-t <msecs>]\n"
      "\t-m\tmissile launcher ["
      "/dev/launcher0"
      "]\n"
      "\t-f\tfire\n"
      "\t-s\tstop\n"
      "\t-l\tturn left\n"
      "\t-r\tturn right\n"
      "\t-u\tturn up\n"
      "\t-d\tturn down\n"
      "\t-t\tspecify duration to wait before sending STOP in milliseconds\n"
      "\t-h\tdisplay this help\n\n"
      "Notes:\n"
      "\tIt is possible to combine the directions of the two axis, e.g.\n"
      "\t'-lu' send_cmds the missile launcher up and left at the same time.\n"
      "",
      name);
  exit(1);
}


x86 assembly (clang, -O0):
<launcher_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<launcher_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [374 x i8] c"Usage: %s [-mfslrudh] [-t <msecs>]\0A\09-m\09missile launcher [/dev/launcher0]\0A\09-f\09fire\0A\09-s\09stop\0A\09-l\09turn left\0A\09-r\09turn right\0A\09-u\09turn up\0A\09-d\09turn down\0A\09-t\09specify duration to wait before sending STOP in milliseconds\0A\09-h\09display this help\0A\0ANotes:\0A\09It is possible to combine the directions of the two axis, e.g.\0A\09'-lu' send_cmds the missile launcher up and left at the same time.\0A\00"
define void @launcher_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([374 x i8], [374 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [374 x i8] c"Usage: %s [-mfslrudh] [-t <msecs>]\0A\09-m\09missile launcher [/dev/launcher0]\0A\09-f\09fire\0A\09-s\09stop\0A\09-l\09turn left\0A\09-r\09turn right\0A\09-u\09turn up\0A\09-d\09turn down\0A\09-t\09specify duration to wait before sending STOP in milliseconds\0A\09-h\09display this help\0A\0ANotes:\0A\09It is possible to combine the directions of the two axis, e.g.\0A\09'-lu' send_cmds the missile launcher up and left at the same time.\0A\00"
define void @launcher_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([374 x i8], [374 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double shl(double, int);
double dblShl(double a, int b) { return shl(a, b); }


x86 assembly (clang, -O0):
<dblShl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <shl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblShl>:
jmp    1030 <shl@plt>

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

LLVM IR (-O2):
define double @dblShl(double %0, i32 %1) {
%3 = tail call double @shl(double %0, i32 %1)
ret double %3
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_first_frag(__le16 seq_ctrl) {
  return (seq_ctrl & __cpu_to_le16(0x000F)) == 0;
}


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

x86 assembly (clang, -O2):
<ieee80211_is_first_frag>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ieee80211_is_first_frag(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 15)
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int s_bcmp(char *s1, char *s2) {
  int n;
  for (n = 0; *s1 != '\0'; s1++, s2++, n++)
    if ((*s1) != (*s2))
      return -1;
  return n;
}


x86 assembly (clang, -O0):
<s_bcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1170 <s_bcmp+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1145 <s_bcmp+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <s_bcmp+0x76>
jmp    114a <s_bcmp+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <s_bcmp+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_bcmp>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <s_bcmp+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1123 <s_bcmp+0x23>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <s_bcmp+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @s_bcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %16, %12 ], [ %3, %2 ]
%7 = phi i32 [ %15, %12 ], [ 0, %2 ]
%8 = phi i8* [ %14, %12 ], [ %1, %2 ]
%9 = phi i8* [ %13, %12 ], [ %0, %2 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %6, %10
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = add nuw nsw i32 %7, 1
%16 = load i8, i8* %13
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5, %12, %2
%19 = phi i32 [ 0, %2 ], [ %15, %12 ], [ -1, %5 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
void seekdir(DIR *dirp, long offset) {}


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

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

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

LLVM IR (-O2):
define void @seekdir(i32* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(int, unsigned int);
int uart_lsr();
void uart_send(unsigned int c) {
  while (1) {
    if (uart_lsr() & 0x20) {
      break;
    }
  }
  put32((0xFFFFFF0000000000uL + 0x3F200000uL + 0x00015040), c);
}


x86 assembly (clang, -O0):
<uart_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <uart_lsr@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     1143 <uart_send+0x23>
jmp    1148 <uart_send+0x28>
jmp    112b <uart_send+0xb>
mov    -0x4(%rbp),%esi
mov    $0x3f215040,%edi
call   1030 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <uart_lsr@plt>
test   $0x20,%al
je     1130 <uart_send+0x10>
mov    $0x3f215040,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <put32@plt>

LLVM IR (-O0):
define void @uart_send(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %8
%4 = call i32 (...) @uart_lsr()
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i32, i32* %2
%11 = call i32 @put32(i32 1059147840, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uart_send(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @uart_lsr()
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @put32(i32 1059147840, i32 %0)
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double f(double x) { return cos(x) + sin(x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = load double, double* %2
%6 = call double @sin(double %5)
%7 = fadd double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @cos(double %0)
%3 = tail call double @sin(double %0)
%4 = fadd double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float const, float const, float const,
                          float const);
void glmPrintQuaternionf(const float q[4]) {
  printf("%f + %f i + %f j + %f k\n", q[0], q[1], q[2], q[3]);
}


x86 assembly (clang, -O0):
<glmPrintQuaternionf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm3
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmPrintQuaternionf>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
movss  0xc(%rdi),%xmm3
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%f + %f i + %f j + %f k\0A\00"
define void @glmPrintQuaternionf(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 2
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 3
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %5, float %8, float %11, float %14)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%f + %f i + %f j + %f k\0A\00"
define void @glmPrintQuaternionf(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 3
%8 = load float, float* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %2, float %4, float %6, float %8)
ret void
}
int merge_possible(const int v1, const int v2) {
  return v1 == v2 - 1 || v2 == v1 - 1 ||
         ((v1 == 1 || v1 == 2) && (v2 == 1 || v2 == 2));
}


x86 assembly (clang, -O0):
<merge_possible>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
je     1174 <merge_possible+0x74>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
je     1174 <merge_possible+0x74>
cmpl   $0x1,-0x4(%rbp)
je     114f <merge_possible+0x4f>
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jne    116e <merge_possible+0x6e>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0xb(%rbp)
je     1168 <merge_possible+0x68>
cmpl   $0x2,-0x8(%rbp)
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_possible>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
cmp    %esi,%ecx
je     1122 <merge_possible+0x22>
add    $0xffffffff,%esi
cmp    %edi,%esi
je     1122 <merge_possible+0x22>
xor    %eax,%eax
cmp    $0x1,%ecx
ja     1122 <merge_possible+0x22>
xor    %eax,%eax
cmp    $0x2,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @merge_possible(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 = sub nsw i32 %6, 1
%8 = icmp eq i32 %5, %7
br i1 %8, label %30, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = icmp eq i32 %10, %12
br i1 %13, label %30, label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %28
20: ; preds = %17, %14
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 1
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 2
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ true, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17
%29 = phi i1 [ false, %17 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %9, %2
%31 = phi i1 [ true, %9 ], [ true, %2 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @merge_possible(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp eq i32 %3, %0
%5 = add i32 %0, -1
%6 = icmp eq i32 %5, %1
%7 = or i1 %6, %4
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = icmp ult i32 %3, 2
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %8, %2
%14 = phi i32 [ 1, %2 ], [ %12, %10 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, int);
int main(void) {
  double a = 0.0001;
  double b = 1.0;
  b -= 0.9999;
  printf("%lf %lf ? %d\n", a, b, a == b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
ucomisd -0x18(%rbp),%xmm2
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"%lf %lf ? %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e-04, double* %2
store double 1.000000e+00, double* %3
%4 = load double, double* %3
%5 = fsub double %4, 9.999000e-01
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = fcmp oeq double %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %6, double %7, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%lf %lf ? %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double 1.000000e-04, double 0x3F1A36E2EB1C4000, i32 0)
ret i32 0
}
char *OS_rmstr() { return ("rm"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"rm\00"
define i8* @OS_rmstr() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"rm\00"
define i8* @OS_rmstr() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ send(int, int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void cbWriteShort(int fd, uint16_t write_value) {
  write_value = htons(write_value);
  send(fd, &write_value, sizeof(uint16_t), 0);
}


x86 assembly (clang, -O0):
<cbWriteShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbWriteShort>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cbWriteShort(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @send(i32 %0, i32* %3, i32 4, i32 0)
ret void
}
int longestwordofstring(const char *str) {}


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

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

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

LLVM IR (-O2):
define i32 @longestwordofstring(i8* nocapture readnone %0) {
ret i32 undef
}
void ta_reinit() {
  ((*((volatile unsigned long *)((0xA05F8000 + 0x160)))) = (0x80000000));
}


x86 assembly (clang, -O0):
<ta_reinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa05f8160,%eax
mov    $0x80000000,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_reinit>:
mov    $0x80000000,%eax
mov    %rax,0x205f8160(%rax)
ret

LLVM IR (-O0):
define void @ta_reinit() {
store volatile i64 2147483648, i64* inttoptr (i64 2690613600 to i64*)
ret void
}

LLVM IR (-O2):
define void @ta_reinit() {
store volatile i64 2147483648, i64* inttoptr (i64 2690613600 to i64*)
ret void
}
void msm_thermal_ioctl_cleanup(void) { return; }


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

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

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

LLVM IR (-O2):
define void @msm_thermal_ioctl_cleanup() {
ret void
}
void Lcd_Port_Init(void) {
  (*(volatile unsigned *)0x56000028) = 0xffffffff;
  (*(volatile unsigned *)0x56000020) = 0xaaaa02a8;
  (*(volatile unsigned *)0x56000038) = 0xffffffff;
  (*(volatile unsigned *)0x56000030) = 0xaaaaaaaa;
}


x86 assembly (clang, -O0):
<Lcd_Port_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000028,%eax
movl   $0xffffffff,(%rax)
mov    $0x56000020,%eax
movl   $0xaaaa02a8,(%rax)
mov    $0x56000038,%eax
movl   $0xffffffff,(%rax)
mov    $0x56000030,%eax
movl   $0xaaaaaaaa,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_Port_Init>:
movl   $0xffffffff,0x56000028
ff ff ff ff
movl   $0xaaaa02a8,0x56000020
a8 02 aa aa
movl   $0xffffffff,0x56000038
ff ff ff ff
movl   $0xaaaaaaaa,0x56000030
aa aa aa aa
ret

LLVM IR (-O0):
define void @Lcd_Port_Init() {
store volatile i32 -1, i32* inttoptr (i64 1442840616 to i32*)
store volatile i32 -1431698776, i32* inttoptr (i64 1442840608 to i32*)
store volatile i32 -1, i32* inttoptr (i64 1442840632 to i32*)
store volatile i32 -1431655766, i32* inttoptr (i64 1442840624 to i32*)
ret void
}

LLVM IR (-O2):
define void @Lcd_Port_Init() {
store volatile i32 -1, i32* inttoptr (i64 1442840616 to i32*)
store volatile i32 -1431698776, i32* inttoptr (i64 1442840608 to i32*)
store volatile i32 -1, i32* inttoptr (i64 1442840632 to i32*)
store volatile i32 -1431655766, i32* inttoptr (i64 1442840624 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcscmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int ISandBox_wcscmp(wchar_t *s1, wchar_t *s2) { return wcscmp(s1, s2); }


x86 assembly (clang, -O0):
<ISandBox_wcscmp>:
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 <wcscmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISandBox_wcscmp>:
jmp    1030 <wcscmp@plt>

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

LLVM IR (-O2):
define i32 @ISandBox_wcscmp(i32* %0, i32* %1) {
%3 = tail call i32 @wcscmp(i32* %0, i32* %1)
ret i32 %3
}
int c_encrypt(char *text) {
  int c;
  while (*text != '\0') {
    c = *text + 13;
    if (c > 255) {
      c %= 255;
    }
    *text = c;
    text++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<c_encrypt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115c <c_encrypt+0x5c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xd,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jle    1140 <c_encrypt+0x40>
mov    -0xc(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <c_encrypt+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_encrypt>:
mov    (%rdi),%al
test   %al,%al
je     1120 <c_encrypt+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
add    $0xd,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <c_encrypt+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @c_encrypt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i8 %5, 13
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ brake();
int distanceTravelled();
int /*<<< orphan*/ moveForward(int);
void adjust34() {
  moveForward(-25);
  while (distanceTravelled() <= 2) {
  }
  brake();
}


x86 assembly (clang, -O0):
<adjust34>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffe7,%edi
call   1040 <moveForward@plt>
mov    $0x0,%al
call   1030 <distanceTravelled@plt>
cmp    $0x2,%eax
jg     1153 <adjust34+0x23>
jmp    113e <adjust34+0xe>
mov    $0x0,%al
call   1050 <brake@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust34>:
push   %rax
mov    $0xffffffe7,%edi
call   1040 <moveForward@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <distanceTravelled@plt>
cmp    $0x3,%eax
jl     1140 <adjust34+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1050 <brake@plt>

LLVM IR (-O0):
define void @adjust34() {
%1 = call i32 @moveForward(i32 -25)
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @distanceTravelled()
%4 = icmp sle i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = call i32 (...) @brake()
ret void
}

LLVM IR (-O2):
define void @adjust34() {
%1 = tail call i32 @moveForward(i32 -25)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @distanceTravelled()
%4 = icmp slt i32 %3, 3
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 (...) @brake()
ret void
}
double sawfn(double d) { return 1.0 - 2.0 * d; }


x86 assembly (clang, -O0):
<sawfn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xee6(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sawfn>:
addsd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sawfn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %3, double 1.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @sawfn(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double 1.000000e+00)
ret double %2
}
/* Variables and functions */
int checkParenthesis(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char exp[] = "[])";
  printf("%d\n", checkParenthesis(exp));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x295d5b,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <checkParenthesis@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.exp = [4 x i8] c"[])\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @checkParenthesis(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2710875, i32* %1
%3 = call i32 @checkParenthesis(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int foo3(int *, int *, int *);
int foo4(int *a, int *b) {
  int c = 5;
  return foo3(a, b, &c);
}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <foo3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo4>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <foo3@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @foo4(i32* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%5 = call i32 @foo3(i32* %0, i32* %1, i32* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __test_add();
int /*<<< orphan*/ __test_dec();
int /*<<< orphan*/ __test_inc();
int /*<<< orphan*/ __test_logic();
int main(int argc, char **argv) {
  __test_inc();
  __test_add();
  __test_dec();
  __test_logic();
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <__test_inc@plt>
xor    %eax,%eax
call   1050 <__test_add@plt>
xor    %eax,%eax
call   1040 <__test_dec@plt>
xor    %eax,%eax
call   1030 <__test_logic@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @__test_inc()
%4 = tail call i32 (...) @__test_add()
%5 = tail call i32 (...) @__test_dec()
%6 = tail call i32 (...) @__test_logic()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(unsigned char *, char *);
int /*<<< orphan*/ fwrite(unsigned char *, int, size_t, int /*<<< orphan*/ *);
int writeBuffertoFile(unsigned char *buffer, size_t size,
                      unsigned char *fileName) {
  FILE *fp;
  fp = fopen(fileName, "wb+");
  if (fp == NULL)
    exit(0);
  fwrite(buffer, 1, size, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<writeBuffertoFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    117a <writeBuffertoFile+0x3a>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBuffertoFile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xeae(%rip),%rsi
mov    %rdx,%rdi
call   1040 <fopen@plt>
test   %rax,%rax
je     1182 <writeBuffertoFile+0x42>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"wb+\00"
define i32 @writeBuffertoFile(i8* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %8
%11 = load i32*, i32** %8
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i32*, i32** %8
%19 = call i32 @fwrite(i8* %16, i32 1, i64 %17, i32* %18)
%20 = load i32*, i32** %8
%21 = call i32 @fclose(i32* %20)
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"wb+\00"
define i32 @writeBuffertoFile(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %3
%9 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32* %4)
%10 = tail call i32 @fclose(i32* %4)
ret i32 undef
}
int strlen2(const char *string) {
  const char *base = string;
  while (*string++)
    ;
  return string - base - 1;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen2+0x2d>
jmp    1110 <strlen2+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strlen2(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 = %10, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = sub nsw i64 %16, 1
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen2(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
int test5(long long b) {
  static void *lbls[] = {&&lbl};
  goto *b;
lbl:
  return 0;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1119 <test5+0x19>
xor    %eax,%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
@test5.lbls = internal global [1 x i8*] [i8* blockaddress(@test5, %5)]
define i32 @test5(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
br label %6
5: ; preds = %6
ret i32 0
6: ; preds = %1
%7 = phi i8* [ %4, %1 ]
indirectbr i8* %7, [label %5]
}

LLVM IR (-O2):
define i32 @test5(i64 %0) {
ret i32 0
}
void SwapUVRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @SwapUVRow_Any_AVX2() {
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *default_strdup(void *ctx, const char *src) {
  (void)ctx;
  return strdup(src);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @default_strdup(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
ret i8* %3
}
void AsicForceSleep(struct rt_rtmp_adapter *pAd) {}


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

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

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

LLVM IR (-O2):
%struct.rt_rtmp_adapter = type opaque
define void @AsicForceSleep(%struct.rt_rtmp_adapter* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ mymalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdup(char *str) {
  char *p = (char *)mymalloc(strlen(str) + 1);
  strcpy(p, str);
  return (p);
}


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

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

LLVM IR (-O0):
define i8* @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, 1
%7 = call i64 @mymalloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @mymalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
int grwfch(fd, buf, buf_len)
int *fd;
char *buf;
int buf_len;
{ return write(*fd, (void *)buf, buf_len); }


x86 assembly (clang, -O0):
<grwfch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grwfch>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @grwfch(i32* nocapture %0, i8* %1, i32 %2) {
%4 = load i32, i32* %0
%5 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %4, i8* %1, i32 %2)
ret i32 %5
}