xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
void usage(const char *const argv0) {
  fprintf(
      stderr,
      "Usage: %s [-e for enable] [-d for disable] [-P <package watt limit>] "
      "[--P2 <2nd PKG watt limit>] "
      "[--w2 <2nd PKG timing window>] "
      "[-0 <PP0 watt limit>] "
      "[-w <raw window value (int)>] "
      "[-r to read values only (/tmp/rapl_clamp by default)] "
      "[-o <summary output>] "
      "[-s [<sample interval in seconds>](default 1ms)]\n"
      "Limits will be applied to all sockets.\n",
      argv0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [345 x i8] c"Usage: %s [-e for enable] [-d for disable] [-P <package watt limit>] [--P2 <2nd PKG watt limit>] [--w2 <2nd PKG timing window>] [-0 <PP0 watt limit>] [-w <raw window value (int)>] [-r to read values only (/tmp/rapl_clamp by default)] [-o <summary output>] [-s [<sample interval in seconds>](default 1ms)]\0ALimits will be applied to all sockets.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([345 x i8], [345 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [345 x i8] c"Usage: %s [-e for enable] [-d for disable] [-P <package watt limit>] [--P2 <2nd PKG watt limit>] [--w2 <2nd PKG timing window>] [-0 <PP0 watt limit>] [-w <raw window value (int)>] [-r to read values only (/tmp/rapl_clamp by default)] [-o <summary output>] [-s [<sample interval in seconds>](default 1ms)]\0ALimits will be applied to all sockets.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([345 x i8], [345 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int f(int x) { return x - 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    -0xa(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, -10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _puts(char *);
int main(void) {
  char *str;
  str = "I do not fear computers. I fear the lack of them - Isaac Asimov";
  _puts(str);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%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 = [64 x i8] c"I do not fear computers. I fear the lack of them - Isaac Asimov\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_puts(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"I do not fear computers. I fear the lack of them - Isaac Asimov\00"
define i32 @main() {
%1 = tail call i32 @_puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_equals_plainstring(struct plainstring const *,
                                                  struct plainstring const *);
int plainstring_not_equals_plainstring(const struct plainstring *this_string,
                                       const struct plainstring *ps) {
  return !plainstring_equals_plainstring(this_string, ps);
}


x86 assembly (clang, -O0):
<plainstring_not_equals_plainstring>:
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 <plainstring_equals_plainstring@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define i32 @plainstring_not_equals_plainstring(%struct.plainstring* %0, %struct.plainstring* %1) {
%3 = alloca %struct.plainstring*
%4 = alloca %struct.plainstring*
store %struct.plainstring* %0, %struct.plainstring** %3
store %struct.plainstring* %1, %struct.plainstring** %4
%5 = load %struct.plainstring*, %struct.plainstring** %3
%6 = load %struct.plainstring*, %struct.plainstring** %4
%7 = call i32 @plainstring_equals_plainstring(%struct.plainstring* %5, %struct.plainstring* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define i32 @plainstring_not_equals_plainstring(%struct.plainstring* %0, %struct.plainstring* %1) {
%3 = tail call i32 @plainstring_equals_plainstring(%struct.plainstring* %0, %struct.plainstring* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int nanddrv_initialise(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nanddrv_initialise() {
ret i32 0
}
/* Variables and functions */
int gpio_read(int);
int gpio_getsda_val(void) { return gpio_read(17); }


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

x86 assembly (clang, -O2):
<gpio_getsda_val>:
mov    $0x11,%edi
jmp    1030 <gpio_read@plt>

LLVM IR (-O0):
define i32 @gpio_getsda_val() {
%1 = call i32 @gpio_read(i32 17)
ret i32 %1
}

LLVM IR (-O2):
define i32 @gpio_getsda_val() {
%1 = tail call i32 @gpio_read(i32 17)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void __rewinddir(DIR *dirp) { __set_errno(ENOSYS); }


x86 assembly (clang, -O0):
<__rewinddir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rewinddir>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__set_errno@plt>

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define void @__rewinddir(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret void
}
unsigned long getlong(unsigned char *p) {
  return p[0] + p[1] * 256 + (p[2] + p[3] * 256) * 65536;
}


x86 assembly (clang, -O0):
<getlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
mov    -0x8(%rbp),%rdx
movzbl 0x3(%rdx),%edx
shl    $0x8,%edx
add    %edx,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlong>:
movslq (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @getlong(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = mul nsw i32 %10, 256
%12 = add nsw i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = mul nsw i32 %20, 256
%22 = add nsw i32 %16, %21
%23 = mul nsw i32 %22, 65536
%24 = add nsw i32 %12, %23
%25 = sext i32 %24 to i64
ret i64 %25
}

LLVM IR (-O2):
define i64 @getlong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw i32 %13, 24
%15 = shl nuw nsw i32 %10, 16
%16 = or i32 %7, %3
%17 = or i32 %16, %15
%18 = or i32 %17, %14
%19 = sext i32 %18 to i64
ret i64 %19
}
/* Variables and functions */
unsigned long long atoi(char *);
unsigned long long int twice(char *p) {
  unsigned long long int q = atoi(p);
  q = q * 2;
  return q;
}


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

x86 assembly (clang, -O2):
<twice>:
push   %rax
call   1030 <atoi@plt>
add    %rax,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @twice(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @atoi(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = mul i64 %6, 2
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @twice(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
%3 = shl i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mphm -m maxlen\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: mphm -m maxlen\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: mphm -m maxlen\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
char *xmalloc(size)
unsigned size;
{
  char *result = (char *)malloc(size);
  if (!result)
    fatal("virtual memory exhausted", 0);
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <xmalloc+0x20>
lea    0xec9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHorizontalBound(int roomWidth) {
  int widthcount = 0;
  printf(" ");
  while (widthcount < roomWidth) {
    printf("-");
    widthcount++;
  }
  return;
}


x86 assembly (clang, -O0):
<printHorizontalBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <printHorizontalBound+0x44>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <printHorizontalBound+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHorizontalBound>:
push   %rbx
mov    %edi,%ebx
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    113f <printHorizontalBound+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <printHorizontalBound+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printHorizontalBound(i32 %0) {
%2 = tail call i32 @putchar(i32 32)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 45)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void trim_prp_comment(char *prp) {
  char *comment = strchr(prp, '#');
  if (comment) {
    *comment = '\0';
  }
}


x86 assembly (clang, -O0):
<trim_prp_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <trim_prp_comment+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_prp_comment>:
push   %rax
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <trim_prp_comment+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @trim_prp_comment(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 35)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @trim_prp_comment(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
int test_imm_3Eint16_reg(short val) {
  return ((val) & (-0x3E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffc2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -62
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ copyToFortranString(char *, int, char *);
char *tixiGetVersion();
void tixi_get_version(char *version, int stringLength) {
  char *cVersion = NULL;
  cVersion = tixiGetVersion();
  copyToFortranString(cVersion, stringLength, version);
}


x86 assembly (clang, -O0):
<tixi_get_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <tixiGetVersion@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1040 <copyToFortranString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tixi_get_version>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <tixiGetVersion@plt>
mov    %rax,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <copyToFortranString@plt>

LLVM IR (-O0):
define void @tixi_get_version(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* null, i8** %5
%6 = call i8* (...) @tixiGetVersion()
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = call i32 @copyToFortranString(i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @tixi_get_version(i8* %0, i32 %1) {
%3 = tail call i8* (...) @tixiGetVersion()
%4 = tail call i32 @copyToFortranString(i8* %3, i32 %1, i8* %0)
ret void
}
void I2CM_I2CSaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @I2CM_I2CSaveConfig() {
ret void
}
int test_imm_8Aint8_mem(signed char *val) {
  return ((*val) & (-0x8A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Aint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff76,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -138
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
void psci_putc(char c) {}


x86 assembly (clang, -O0):
<psci_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @psci_putc(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void f(double x) { printf("hello %g\n", x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"hello %g\0A\00"
define void @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"hello %g\0A\00"
define void @f(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int sprintf_units(char *, char *, float);
int sprint_units(char *buffer, float value) {
  return sprintf_units(buffer, "%.2f %s", value);
}


x86 assembly (clang, -O0):
<sprint_units>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf_units@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_units>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf_units@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%.2f %s\00"
define i32 @sprint_units(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = call i32 @sprintf_units(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.2f %s\00"
define i32 @sprint_units(i8* %0, float %1) {
%3 = tail call i32 @sprintf_units(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Fatal(char *, int, char *);
void Finish(int errors) { Fatal("%d error%s", errors, errors == 1 ? "" : "s"); }


x86 assembly (clang, -O0):
<Finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xee1(%rip),%rdx
lea    0xedb(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
lea    0xec3(%rip),%rdi
call   1030 <Fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Finish>:
mov    %edi,%esi
cmp    $0x1,%edi
lea    0xeee(%rip),%rax
lea    0xee6(%rip),%rdx
cmove  %rax,%rdx
lea    0xed2(%rip),%rdi
jmp    1030 <Fatal@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d error%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"s\00"
define void @Finish(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @Fatal(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d error%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"s\00"
define void @Finish(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @Fatal(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
ret void
}
/* Variables and functions */
char random();
int random_letter_or_space(void) {
  int letter;
  letter = (random() % ('z' - 'a' + 2)) + 'a';
  if (letter > 'z')
    letter = ' ';
  return (letter);
}


x86 assembly (clang, -O0):
<random_letter_or_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
movsbl %al,%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %edx,-0x4(%rbp)
cmpl   $0x7a,-0x4(%rbp)
jle    1141 <random_letter_or_space+0x31>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_letter_or_space>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movsbl %al,%eax
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,2),%ecx
movzwl %cx,%edx
shr    $0x9,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
lea    (%rcx,%rcx,8),%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %cl,%al
lea    0x61(%rax),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
mov    $0x20,%ecx
cmovl  %eax,%ecx
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_letter_or_space() {
%1 = alloca i32
%2 = call signext i8 (...) @random()
%3 = sext i8 %2 to i32
%4 = srem i32 %3, 27
%5 = add nsw i32 %4, 97
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 122
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 32, i32* %1
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @random_letter_or_space() {
%1 = tail call signext i8 (...) @random()
%2 = srem i8 %1, 27
%3 = add nsw i8 %2, 97
%4 = icmp sgt i8 %2, 25
%5 = select i1 %4, i8 32, i8 %3
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
double funcAngCor_alpha0_3minus_0plus_15097_L3(double *, double *);
double sin(double);
double fitAngDist_alpha0_3minus_0plus_15097_L3(double *x, double *par) {
  double result;
  result = funcAngCor_alpha0_3minus_0plus_15097_L3(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha0_3minus_0plus_15097_L3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <funcAngCor_alpha0_3minus_0plus_15097_L3@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha0_3minus_0plus_15097_L3>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <funcAngCor_alpha0_3minus_0plus_15097_L3@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha0_3minus_0plus_15097_L3(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha0_3minus_0plus_15097_L3(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha0_3minus_0plus_15097_L3(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha0_3minus_0plus_15097_L3(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
int omap_rev();
int is_omap3503(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x3503)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap3503>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x3503,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap3503>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x35030000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap3503() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 13571
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap3503() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 889389056
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *strdup(char const *);
char *default_strdup(const char *s) { return strdup(s); }


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

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

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

LLVM IR (-O2):
define noalias i8* @default_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
double strtod(char const *, char **);
double x264_atof(const char *str, int *b_error) {
  char *end;
  double v = strtod(str, &end);
  if (end == str || *end != '\0')
    *b_error = 1;
  return v;
}


x86 assembly (clang, -O0):
<x264_atof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1150 <x264_atof+0x40>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <x264_atof+0x4a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_atof>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <strtod@plt>
mov    (%rsp),%rax
cmp    %rbx,%rax
je     1130 <x264_atof+0x20>
cmpb   $0x0,(%rax)
je     1137 <x264_atof+0x27>
movl   $0x1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define double @x264_atof(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %0, i8** %3)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 1, i32* %1
br label %12
12: ; preds = %11, %8
ret double %5
}
int libfunc() { return 3; }


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

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

LLVM IR (-O0):
define i32 @libfunc() {
ret i32 3
}

LLVM IR (-O2):
define i32 @libfunc() {
ret i32 3
}
/* Variables and functions */
double pow(double, double);
double convert_it(double x) { return pow(x, 0.25); }


x86 assembly (clang, -O0):
<convert_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_it>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 2.500000e-01)
ret double %4
}

LLVM IR (-O2):
define double @convert_it(double %0) {
%2 = tail call double @pow(double %0, double 2.500000e-01)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void uputs(char *str) {
  for (; *str != 0; str++)
    putchar(*str);
}


x86 assembly (clang, -O0):
<uputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <uputs+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uputs(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 = tail call i32 @putchar(i8 signext %5)
%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 void
}
/* Type definitions */
struct progressbar {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ progressbar_add(struct progressbar *, int);
void progressbar_inc(struct progressbar *pb) { progressbar_add(pb, 1); }


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

x86 assembly (clang, -O2):
<progressbar_inc>:
mov    $0x1,%esi
jmp    1030 <progressbar_add@plt>

LLVM IR (-O0):
%struct.progressbar = type { i32 }
define void @progressbar_inc(%struct.progressbar* %0) {
%2 = alloca %struct.progressbar*
store %struct.progressbar* %0, %struct.progressbar** %2
%3 = load %struct.progressbar*, %struct.progressbar** %2
%4 = call i32 @progressbar_add(%struct.progressbar* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.progressbar = type { i32 }
define void @progressbar_inc(%struct.progressbar* %0) {
%2 = tail call i32 @progressbar_add(%struct.progressbar* %0, i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XVisibilityEvent;

/* Variables and functions */
unsigned long get_XVisibilityEvent_window(void *_p) {
  return (unsigned long)((XVisibilityEvent *)_p)->window;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XVisibilityEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void TB_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TB_IRQHandler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pbkdf2_sha256(int /*<<< orphan*/ const *, size_t,
                                 int /*<<< orphan*/ const *, size_t,
                                 int /*<<< orphan*/, int /*<<< orphan*/ *,
                                 size_t);
void fastpbkdf2_hmac_sha256(const uint8_t *pw, size_t npw, const uint8_t *salt,
                            size_t nsalt, uint32_t iterations, uint8_t *out,
                            size_t nout) {
  pbkdf2_sha256(pw, npw, salt, nsalt, iterations, out, nout);
}


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

x86 assembly (clang, -O2):
<fastpbkdf2_hmac_sha256>:
jmp    1030 <pbkdf2_sha256@plt>

LLVM IR (-O0):
define void @fastpbkdf2_hmac_sha256(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6) {
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i64
store i32* %0, i32** %8
store i64 %1, i64* %9
store i32* %2, i32** %10
store i64 %3, i64* %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i64 %6, i64* %14
%15 = load i32*, i32** %8
%16 = load i64, i64* %9
%17 = load i32*, i32** %10
%18 = load i64, i64* %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i64, i64* %14
%22 = call i32 @pbkdf2_sha256(i32* %15, i64 %16, i32* %17, i64 %18, i32 %19, i32* %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @fastpbkdf2_hmac_sha256(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6) {
%8 = tail call i32 @pbkdf2_sha256(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t pixel64_get_r16(uint64_t pixel) { return pixel & 0xFFFF; }


x86 assembly (clang, -O0):
<pixel64_get_r16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel64_get_r16>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @pixel64_get_r16(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
int tokenizer_whitespace(int c) {
  return ((c == ' ') || (c == '\r') || (c == '\n') || (c == '\t'));
}


x86 assembly (clang, -O0):
<tokenizer_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <tokenizer_whitespace+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <tokenizer_whitespace+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <tokenizer_whitespace+0x3e>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenizer_whitespace>:
cmp    $0x20,%edi
ja     111d <tokenizer_whitespace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    111d <tokenizer_whitespace+0x1d>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @tokenizer_whitespace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 13
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 9
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @tokenizer_whitespace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 10, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int ccount(char c, char *s) {
  int i, count;
  for (i = 0, count = 0; s[i] != 0; i++)
    if (s[i] == c)
      count++;
  return count;
}


x86 assembly (clang, -O0):
<ccount>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1165 <ccount+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <ccount+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <ccount+0x57>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <ccount+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccount>:
mov    (%rsi),%cl
test   %cl,%cl
je     1126 <ccount+0x26>
add    $0x1,%rsi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %dil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <ccount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ccount(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  typedef union {
    unsigned long as_long;
    unsigned short as_short[2];
    unsigned char as_byte[4];
  } data32_t;
  data32_t wert;
  wert.as_long = 0x12345678;
  wert.as_byte[0] = 0xab;
  printf("Wert as long: %x \n", wert.as_long);
  printf("Wert as byte: %x \n", wert.as_byte[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x12345678,-0x8(%rbp)
12
movb   $0xab,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x8(%rbp),%esi
lea    0xed2(%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
mov    $0x123456ab,%esi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0xab,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.data32_t = type { i64 }
@.str = [19 x i8] c"Wert as long: %x \0A\00"
@.str.1 = [19 x i8] c"Wert as byte: %x \0A\00"
define i32 @main() {
%1 = alloca %union.data32_t
%2 = bitcast %union.data32_t* %1 to i64*
store i64 305419896, i64* %2
%3 = bitcast %union.data32_t* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 -85, i8* %4
%5 = bitcast %union.data32_t* %1 to i64*
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = bitcast %union.data32_t* %1 to [4 x i8]*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Wert as long: %x \0A\00"
@.str.1 = [19 x i8] c"Wert as byte: %x \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 305419947)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 171)
ret i32 0
}
void yy_2_TagExtension(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_TagExtension(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigfpe_handle(int signal) { exit(3); }


x86 assembly (clang, -O0):
<sigfpe_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigfpe_handle>:
push   %rax
mov    $0x3,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigfpe_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define void @sigfpe_handle(i32 %0) {
%2 = tail call i32 @exit(i32 3)
unreachable
}