xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ readfile(char const *, int *, int const *, char *, int *,
                            int *);
void zreadfile(const char *filename, const int *m, const int *n, double *A,
               const int *ldA, int *info) {
  int cm = *m * (int)(2 * sizeof(double) / sizeof(char));
  int cldA = *ldA * (int)(2 * sizeof(double) / sizeof(char));
  readfile(filename, &cm, n, (char *)A, &cldA, info);
}


x86 assembly (clang, -O0):
<zreadfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
shl    $0x4,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r9
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%r8
call   1030 <readfile@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zreadfile>:
push   %rax
mov    (%rsi),%eax
shl    $0x4,%eax
mov    %eax,0x4(%rsp)
mov    (%r8),%eax
shl    $0x4,%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
call   1030 <readfile@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zreadfile(i8* %0, i32* %1, i32* %2, double* %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store double* %3, double** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 16
store i32 %17, i32* %13
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = mul nsw i32 %19, 16
store i32 %20, i32* %14
%21 = load i8*, i8** %7
%22 = load i32*, i32** %9
%23 = load double*, double** %10
%24 = bitcast double* %23 to i8*
%25 = load i32*, i32** %12
%26 = call i32 @readfile(i8* %21, i32* %13, i32* %22, i8* %24, i32* %14, i32* %25)
ret void
}

LLVM IR (-O2):
define void @zreadfile(i8* %0, i32* nocapture %1, i32* %2, double* %3, i32* nocapture %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %7 to i8*
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 4
store i32 %11, i32* %7
%12 = bitcast i32* %8 to i8*
%13 = load i32, i32* %4
%14 = shl nsw i32 %13, 4
store i32 %14, i32* %8
%15 = bitcast double* %3 to i8*
%16 = call i32 @readfile(i8* %0, i32* %7, i32* %2, i8* %15, i32* %8, i32* %5)
ret void
}
/* Variables and functions */
void a_loop(int *buf, size_t size) {
  size_t i;
  for (i = 0; i < size; ++i)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<a_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1142 <a_loop+0x42>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <a_loop+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_loop>:
test   %rsi,%rsi
je     1128 <a_loop+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @a_loop(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @a_loop(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = shl nuw i64 %1, 2
br label %7
7: ; preds = %4, %2
ret void
}
unsigned BitFind(unsigned long Val) {
  unsigned long Mask;
  unsigned Bit;
  Mask = 1;
  Bit = 0;
  while (1) {
    if (Val & Mask) {
      return Bit;
    }
    Mask <<= 1;
    ++Bit;
  }
}


x86 assembly (clang, -O0):
<BitFind>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     112e <BitFind+0x2e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <BitFind+0x17>

x86 assembly (clang, -O2):
<BitFind>:
xor    %eax,%eax
test   $0x1,%dil
jne    111b <BitFind+0x1b>
mov    $0x1,%ecx
xor    %eax,%eax
nop
add    %rcx,%rcx
add    $0x1,%eax
test   %rdi,%rcx
je     1110 <BitFind+0x10>
ret

LLVM IR (-O0):
define i32 @BitFind(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
store i64 1, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %1, %12
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = and i64 %6, %7
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = load i32, i32* %4
ret i32 %11
12: ; preds = %5
%13 = load i64, i64* %3
%14 = shl i64 %13, 1
store i64 %14, i64* %3
%15 = load i32, i32* %4
%16 = add i32 %15, 1
store i32 %16, i32* %4
br label %5
}

LLVM IR (-O2):
define i32 @BitFind(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %10, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ 0, %1 ]
%8 = phi i64 [ %9, %6 ], [ 1, %1 ]
%9 = shl i64 %8, 1
%10 = add i32 %7, 1
%11 = and i64 %9, %0
%12 = icmp eq i64 %11, 0
br i1 %12, label %6, label %4
}
/* Variables and functions */
char *strrchr(char const *, char);
char *FIND_LAST_DIRSEP(const char *_the_path) {
  return strrchr(_the_path, '/');
}


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

x86 assembly (clang, -O2):
<FIND_LAST_DIRSEP>:
mov    $0x2f,%esi
jmp    1030 <strrchr@plt>

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

LLVM IR (-O2):
define i8* @FIND_LAST_DIRSEP(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
ret i8* %2
}
/* Variables and functions */
int getLowestEmptySpace(int **, int);
void makeMove(int grid[6][7], int move, int column) {
  int lowest;
  lowest = getLowestEmptySpace(grid, column);
  if (lowest != -1)
    grid[lowest][column] = move;
}


x86 assembly (clang, -O0):
<makeMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <getLowestEmptySpace@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1154 <makeMove+0x44>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x1c,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeMove>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <getLowestEmptySpace@plt>
cmp    $0xffffffff,%eax
je     113f <makeMove+0x2f>
cltq
movslq %ebp,%rcx
lea    (%rax,%rax,8),%rdx
lea    (%rdx,%rdx,2),%rdx
add    %rax,%rdx
add    %rdx,%rbx
mov    %r14d,(%rbx,%rcx,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @makeMove([7 x i32]* %0, i32 %1, i32 %2) {
%4 = bitcast [7 x i32]* %0 to i32**
%5 = tail call i32 @getLowestEmptySpace(i32** %4, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %0, i64 %8, i64 %9
store i32 %1, i32* %10
br label %11
11: ; preds = %7, %3
ret void
}
/* Variables and functions */
size_t __attribute__((unused)) strlen(const char *s) {
  size_t len = 0;
  while (*s++)
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i64, i64* %3
%11 = add i64 %10, 1
store i64 %11, i64* %3
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @strlen(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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ add_attribute_raw(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                     int);
void add_attribute_u16(uint16_t attribute, uint16_t value) {
  add_attribute_raw(attribute, &value, sizeof(uint16_t));
}


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

x86 assembly (clang, -O2):
<add_attribute_u16>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <add_attribute_raw@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @add_attribute_u16(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @add_attribute_raw(i32 %0, i32* %3, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ y;
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
main() {
  int x[10];
  int y[10] = {1, 2, 3, 0};
  print_array(x, sizeof(x) / sizeof(int));
  print_array(&y[0], sizeof(y) / sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x60(%rbp)
movl   $0x2,-0x5c(%rbp)
movl   $0x3,-0x58(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_array@plt>
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movabs $0x200000001,%rax
mov    %rax,(%rsp)
movl   $0x3,0x8(%rsp)
lea    0x30(%rsp),%rdi
mov    $0xa,%esi
call   1030 <print_array@plt>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %3 to i8*
%5 = bitcast i8* %4 to [10 x i32]*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 0
store i32 1, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 1
store i32 2, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 2
store i32 3, i32* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @print_array(i32* %9, i32 10)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%12 = call i32 @print_array(i32* %11, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32 2, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
store i32 3, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = call i32 @print_array(i32* %8, i32 10)
%10 = call i32 @print_array(i32* %5, i32 10)
ret i32 0
}
void foo168(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo168(i32 %0) {
ret void
}
int ispunct(int c) {
  return (('!' <= c && c <= '/') || (':' <= c && c <= '@') ||
          ('[' <= c && c <= '1') || ('{' <= c && c <= '~'));
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x21,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <ispunct+0x24>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1181 <ispunct+0x81>
mov    $0x3a,%eax
cmp    -0x4(%rbp),%eax
jg     1141 <ispunct+0x41>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1181 <ispunct+0x81>
mov    $0x5b,%eax
cmp    -0x4(%rbp),%eax
jg     115e <ispunct+0x5e>
mov    $0x1,%al
cmpl   $0x31,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1181 <ispunct+0x81>
xor    %eax,%eax
mov    $0x7b,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     117b <ispunct+0x7b>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
lea    -0x21(%rdi),%eax
cmp    $0xf,%eax
setb   %al
lea    -0x3a(%rdi),%ecx
cmp    $0x7,%ecx
setb   %cl
or     %al,%cl
add    $0xffffff85,%edi
cmp    $0x4,%edi
setb   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 33, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %28, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 58, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sle i32 91, %15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 49
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sle i32 123, %21
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11, %5
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 15
%4 = add i32 %0, -58
%5 = icmp ult i32 %4, 7
%6 = or i1 %3, %5
%7 = add i32 %0, -123
%8 = icmp ult i32 %7, 4
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
void option_unset_unit2MODIF_MULTILINE() {}


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

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

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

LLVM IR (-O2):
define void @option_unset_unit2MODIF_MULTILINE() {
ret void
}
mvaddstr(row, col, str) char *str;
{
  move(row, col);
  addstr(str);
}


x86 assembly (clang, -O0):
<mvaddstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <move@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <addstr@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvaddstr>:
push   %rbx
mov    %rdx,%rbx
xor    %eax,%eax
call   1040 <move@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <addstr@plt>

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

LLVM IR (-O2):
define i32 @mvaddstr(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @addstr to i32 (i8*, ...)*)(i8* %2)
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
int qualify_message(char *mess) {
  if (strlen(mess) > 67) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<qualify_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x43,%eax
jle    113a <qualify_message+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qualify_message+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qualify_message>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x44,%eax
setge  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @qualify_message(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp sgt i32 %5, 67
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @qualify_message(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 67
%4 = sext i1 %3 to i32
ret i32 %4
}
int break_here(int val) { return val; }


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

x86 assembly (clang, -O2):
<break_here>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @break_here(i32 returned %0) {
ret i32 %0
}
void av_hwframe_ctx_create_derived() {}


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

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

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

LLVM IR (-O2):
define void @av_hwframe_ctx_create_derived() {
ret void
}
void outb(unsigned int port, unsigned char value) {
  asm volatile("outb %%al,%%dx" : : "d"(port), "a"(value));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x5(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outb(i32 %0, i8 zeroext %1) {
tail call void asm sideeffect "outb %al,%dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void getServiceInput(int port, char *msg) {
  strncpy(msg, "randomdata\r\n\r\n", 22);
}


x86 assembly (clang, -O0):
<getServiceInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x16,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getServiceInput>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
mov    $0x16,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"randomdata\0D\0A\0D\0A\00"
define void @getServiceInput(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 22)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"randomdata\0D\0A\0D\0A\00"
define void @getServiceInput(i32 %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 22)
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ sigaction(int, struct sigaction *, struct sigaction *);
void esigaction(int signo, struct sigaction *act, struct sigaction *oact) {
  if (sigaction(signo, act, oact) < 0)
    error("sigaction");
}


x86 assembly (clang, -O0):
<esigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigaction@plt>
cmp    $0x0,%rax
jge    1159 <esigaction+0x39>
lea    0xeac(%rip),%rdi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esigaction>:
push   %rax
call   1030 <sigaction@plt>
test   %rax,%rax
js     112d <esigaction+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

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

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@.str = [10 x i8] c"sigaction\00"
define void @esigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = tail call i64 @sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *ADup(const void *data, size_t size) {
  void *p = malloc(size);
  if (p != NULL) {
    memcpy(p, data, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<ADup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <ADup+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <ADup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ADup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @ADup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int dataCheck();
int /*<<< orphan*/ disp();
int /*<<< orphan*/ getData();
int /*<<< orphan*/ printf(char *);
int main() {
  getData();
  int status = dataCheck();
  if (status == 0)
    printf("Incorrect \n");
  else
    disp();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getData@plt>
mov    $0x0,%al
call   1030 <dataCheck@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    117b <main+0x3b>
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
jmp    1182 <main+0x42>
mov    $0x0,%al
call   1060 <disp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getData@plt>
xor    %eax,%eax
call   1030 <dataCheck@plt>
test   %eax,%eax
je     115c <main+0x1c>
xor    %eax,%eax
call   1060 <disp@plt>
jmp    1168 <main+0x28>
lea    0xe9d(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [11 x i8] c"Incorrect \00"
define i32 @main() {
%1 = tail call i32 (...) @getData()
%2 = tail call i32 (...) @dataCheck()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @disp()
br label %8
8: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int open_device(void) {
  int fd = -1;
  fd = open("/dev/gpio_irq_driver", O_RDWR);
  if (fd == -1)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<open_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x8(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114d <open_device+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <open_device+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_device>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"/dev/gpio_irq_driver\00"
@O_RDWR = global i32 0
define i32 @open_device() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %2
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"/dev/gpio_irq_driver\00"
@O_RDWR = global i32 0
define i32 @open_device() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
void g_io_channel_init() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_init() {
ret void
}
float test_rintf(float x) { return __builtin_rintf(x); }


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

x86 assembly (clang, -O2):
<test_rintf>:
jmp    1030 <rintf@plt>

LLVM IR (-O0):
define float @test_rintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.rint.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test_rintf(float %0) {
%2 = tail call float @llvm.rint.f32(float %0)
ret float %2
}
/* Variables and functions */
int invert(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", invert(121, 1, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x79,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <invert@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x79,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <invert@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @invert(i32 121, i32 1, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
long double __qexp(long double);
long double intr_wrap_041(long double p1) { return __qexp(p1); }


x86 assembly (clang, -O0):
<intr_wrap_041>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qexp@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_041>:
jmp    1030 <__qexp@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_041(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qexp(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int errno;
int py_errno() { return errno; }


x86 assembly (clang, -O0):
<py_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<py_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @py_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @py_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
float fast_cbrtf(float x) {
  union {
    int ix;
    float x;
  } v;
  v.x = x;
  v.ix = v.ix / 4 + v.ix / 16;
  v.ix = v.ix + v.ix / 16;
  v.ix = v.ix + v.ix / 256;
  v.ix = 0x2a511cd0 + v.ix;
  return v.x;
}


x86 assembly (clang, -O0):
<fast_cbrtf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2a511cd0,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_cbrtf>:
movd   %xmm0,%eax
lea    0x3(%rax),%ecx
lea    0xf(%rax),%edx
test   %eax,%eax
cmovns %eax,%ecx
cmovns %eax,%edx
sar    $0x2,%ecx
sar    $0x4,%edx
lea    (%rcx,%rdx,1),%eax
add    $0xf,%eax
add    %edx,%ecx
cmovns %ecx,%eax
sar    $0x4,%eax
lea    (%rax,%rcx,1),%edx
add    $0xff,%edx
add    %ecx,%eax
cmovns %eax,%edx
sar    $0x8,%edx
add    %edx,%eax
add    $0x2a511cd0,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @fast_cbrtf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 4
%9 = bitcast %union.anon* %3 to i32*
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 16
%12 = add nsw i32 %8, %11
%13 = bitcast %union.anon* %3 to i32*
store i32 %12, i32* %13
%14 = bitcast %union.anon* %3 to i32*
%15 = load i32, i32* %14
%16 = bitcast %union.anon* %3 to i32*
%17 = load i32, i32* %16
%18 = sdiv i32 %17, 16
%19 = add nsw i32 %15, %18
%20 = bitcast %union.anon* %3 to i32*
store i32 %19, i32* %20
%21 = bitcast %union.anon* %3 to i32*
%22 = load i32, i32* %21
%23 = bitcast %union.anon* %3 to i32*
%24 = load i32, i32* %23
%25 = sdiv i32 %24, 256
%26 = add nsw i32 %22, %25
%27 = bitcast %union.anon* %3 to i32*
store i32 %26, i32* %27
%28 = bitcast %union.anon* %3 to i32*
%29 = load i32, i32* %28
%30 = add nsw i32 709958864, %29
%31 = bitcast %union.anon* %3 to i32*
store i32 %30, i32* %31
%32 = bitcast %union.anon* %3 to float*
%33 = load float, float* %32
ret float %33
}

LLVM IR (-O2):
define float @fast_cbrtf(float %0) {
%2 = bitcast float %0 to i32
%3 = sdiv i32 %2, 4
%4 = sdiv i32 %2, 16
%5 = add nsw i32 %3, %4
%6 = sdiv i32 %5, 16
%7 = add nsw i32 %6, %5
%8 = sdiv i32 %7, 256
%9 = add nsw i32 %7, 709958864
%10 = add nsw i32 %9, %8
%11 = bitcast i32 %10 to float
ret float %11
}
int test_imm_F0uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F0uint64_highword_reg>:
movabs $0xf000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F0uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1030792151040
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int somefunc(void) { return 1984; }


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

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

LLVM IR (-O0):
define i32 @somefunc() {
ret i32 1984
}

LLVM IR (-O2):
define i32 @somefunc() {
ret i32 1984
}
/* Variables and functions */
scalar_t__ lc_ALL();
int Ada_lc_ALL() {
  int jresult;
  int result;
  result = (int)lc_ALL();
  jresult = result;
  return jresult;
}


x86 assembly (clang, -O0):
<Ada_lc_ALL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lc_ALL@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ada_lc_ALL>:
xor    %eax,%eax
jmp    1030 <lc_ALL@plt>

LLVM IR (-O0):
define i32 @Ada_lc_ALL() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @lc_ALL()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @Ada_lc_ALL() {
%1 = tail call i64 (...) @lc_ALL()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msim_printNewLine() { printf("\n"); }


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

x86 assembly (clang, -O2):
<msim_printNewLine>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @msim_printNewLine() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
void event_spacing(n, m) int n, m;
{}


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

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

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

LLVM IR (-O2):
define void @event_spacing(i32 %0, i32 %1) {
ret void
}
void Android420ToARGBMatrix() {}


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

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

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

LLVM IR (-O2):
define void @Android420ToARGBMatrix() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ht_destructor_free(void *obj) { free(obj); }


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

x86 assembly (clang, -O2):
<ht_destructor_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ht_destructor_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int uds_request_transfer_exit() { return 1; }


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

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

LLVM IR (-O0):
define i32 @uds_request_transfer_exit() {
ret i32 1
}

LLVM IR (-O2):
define i32 @uds_request_transfer_exit() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, unsigned int);
void f1() {
  int size = 12;
  char src[12] = "helloworld";
  char dest[12];
  memmove(dest, src, (unsigned)size);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1030 <memmove@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
store i32 12, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %1
%8 = call i32 @memmove(i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @memmove(i8* %4, i8* %3, i32 12)
ret void
}
short foo(long long x, long long y) { return x / y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <foo+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define signext i16 @foo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sdiv i64 %5, %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @foo(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = trunc i64 %3 to i16
ret i16 %4
}
unsigned precedenceLevel(char operator) {
  switch (operator) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
  case '^':
    return 3;
  case 's':
  case 'c':
    return 4;
  }
}


x86 assembly (clang, -O0):
<precedenceLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     1191 <precedenceLevel+0x91>
jmp    111f <precedenceLevel+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1185 <precedenceLevel+0x85>
jmp    1130 <precedenceLevel+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1185 <precedenceLevel+0x85>
jmp    1141 <precedenceLevel+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1191 <precedenceLevel+0x91>
jmp    1152 <precedenceLevel+0x52>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     1191 <precedenceLevel+0x91>
jmp    1163 <precedenceLevel+0x63>
mov    -0xc(%rbp),%eax
sub    $0x63,%eax
je     119d <precedenceLevel+0x9d>
jmp    1174 <precedenceLevel+0x74>
mov    -0xc(%rbp),%eax
sub    $0x73,%eax
je     119d <precedenceLevel+0x9d>
jmp    11a4 <precedenceLevel+0xa4>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <precedenceLevel+0xa4>
movl   $0x3,-0x4(%rbp)
jmp    11a4 <precedenceLevel+0xa4>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedenceLevel>:
mov    $0x1,%eax
cmp    $0x5d,%edi
jle    111a <precedenceLevel+0x1a>
cmp    $0x73,%edi
je     112a <precedenceLevel+0x2a>
cmp    $0x63,%edi
je     112a <precedenceLevel+0x2a>
cmp    $0x5e,%edi
je     1124 <precedenceLevel+0x24>
ret
cmp    $0x2a,%edi
je     1124 <precedenceLevel+0x24>
cmp    $0x2f,%edi
jne    1119 <precedenceLevel+0x19>
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @precedenceLevel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 94, label %7
i32 115, label %8
i32 99, label %8
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1, %1, %1
store i32 3, i32* %2
br label %9
8: ; preds = %1, %1
store i32 4, i32* %2
br label %9
9: ; preds = %6, %7, %8, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @precedenceLevel(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 99, label %4
i32 115, label %4
i32 42, label %3
i32 47, label %3
i32 94, label %3
]
3: ; preds = %1, %1, %1
br label %5
4: ; preds = %1, %1
br label %5
5: ; preds = %3, %4, %1
%6 = phi i32 [ 4, %4 ], [ 3, %3 ], [ 1, %1 ]
ret i32 %6
}
int GetPointerExpressionSize(void) {
  char val = 3;
  return sizeof(&val);
}


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

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

LLVM IR (-O0):
define i32 @GetPointerExpressionSize() {
%1 = alloca i8
store i8 3, i8* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @GetPointerExpressionSize() {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ die(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *xfopen(char *filename, char *mode) {
  FILE *fp = fopen(filename, mode);
  if (fp == NULL)
    die("File %s: cannot open\n", filename);
  return fp;
}


x86 assembly (clang, -O0):
<xfopen>:
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   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <xfopen+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xfopen+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"File %s: cannot open\0A\00"
define i32* @xfopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32*, i32** %5
ret i32* %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"File %s: cannot open\0A\00"
define noalias i32* @xfopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}