xunge/DecIR huggingface dataset:
/* Variables and functions */
int is_shortopt(const char *arg) {
  return arg != NULL && arg[0] == '-' && arg[1] != '-' && arg[1] != '\0';
}


x86 assembly (clang, -O0):
<is_shortopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1154 <is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    1154 <is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
je     1154 <is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_shortopt>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <is_shortopt+0x1b>
cmpb   $0x2d,(%rdi)
jne    111b <is_shortopt+0x1b>
mov    0x1(%rdi),%cl
cmp    $0x2d,%cl
je     111b <is_shortopt+0x1b>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_shortopt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 45
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = icmp ne i8 %8, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %6, %3, %1
%14 = phi i32 [ 0, %6 ], [ 0, %3 ], [ 0, %1 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sig_chld(int signo) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <sig_chld+0x31>
jmp    111b <sig_chld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sig_chld+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sig_chld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sig_chld(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
int cnt_leading_set_bits(int f_num) {
  int i;
  int count;
  i = 0;
  count = 0;
  for (i = (8 * sizeof(void *)); i > 0; i--) {
    if (f_num & (1 << (i - 1))) {
      count++;
    } else {
      break;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<cnt_leading_set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x40,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1169 <cnt_leading_set_bits+0x69>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1151 <cnt_leading_set_bits+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <cnt_leading_set_bits+0x56>
jmp    1169 <cnt_leading_set_bits+0x69>
jmp    115b <cnt_leading_set_bits+0x5b>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <cnt_leading_set_bits+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cnt_leading_set_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 64, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = shl i32 1, %11
%13 = and i32 %9, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %19
18: ; preds = %8
br label %23
19: ; preds = %15
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %5
23: ; preds = %18, %5
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @cnt_leading_set_bits(i32 %0) {
ret i32 64
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x3f() {
  Assert_real((isgraph(63)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              320, ("isgraph should be 1 for ?"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x3f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x140,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x140,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for ?\00"
define void @t_isgraph_0x3f() {
%1 = call i32 @isgraph(i32 63)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for ?\00"
define void @t_isgraph_0x3f() {
%1 = tail call i32 @isgraph(i32 63)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo194(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo194(i32 %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
int write(void *, char *, int);
int fputs(char *str, void *f) {
  int n = strlen(str);
  return write(f, str, n) == n ? 0 : -1;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,%edx
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %ebp,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fputs(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 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = call i32 @write(i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 -1
ret i32 %15
}

LLVM IR (-O2):
define i32 @fputs(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i8* %1, i8* %0, i32 %3)
%5 = icmp ne i32 %4, %3
%6 = sext i1 %5 to i32
ret i32 %6
}
int test_19(unsigned int a, unsigned int b) { return (a ^ b) >> 31; }


x86 assembly (clang, -O0):
<test_19>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_19>:
mov    %edi,%eax
xor    %esi,%eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @test_19(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = lshr i32 %3, 31
ret i32 %4
}
int test_imm_DBint64_highword_reg(long long val) {
  return ((val >> 32) & (0xDB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DBint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 219
%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_DBint64_highword_reg(i64 %0) {
%2 = and i64 %0, 940597837824
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  char y5[5];
  char(y6)[5];
  char(y7[5]);
  char((((((y8[5]))))));
  char(y9)[5];
  int(abla) = 5, blabla = 3, ((ablaba)[3]) = {1, 2, 3};
  char *y[5];
  char(*y2)[5];
  char *(y3[5]);
  char((((*((y4[5]))))));
  char *(*y10[4]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0x3,-0x28(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x34(%rbp)
mov    0xeda(%rip),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.ablaba = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
%6 = alloca [5 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
%10 = alloca [5 x i8*]
%11 = alloca [5 x i8]*
%12 = alloca [5 x i8*]
%13 = alloca [5 x i8*]
%14 = alloca [4 x i8**]
store i32 0, i32* %1
store i32 5, i32* %7
store i32 3, i32* %8
%15 = bitcast [3 x i32]* %9 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int condition_d(char c) { return c == 'd'; }


x86 assembly (clang, -O0):
<condition_d>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x64,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_d>:
xor    %eax,%eax
cmp    $0x64,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_d(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 100
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_d(i8 signext %0) {
%2 = icmp eq i8 %0, 100
%3 = zext i1 %2 to i32
ret i32 %3
}
void initUart() {}


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

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

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

LLVM IR (-O2):
define void @initUart() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int i = 10;
  if (argc < 100) {
    i = i + argc;
    if (i > 50) {
      printf("i = %d", i);
    } else {
      i = 50;
    }
  } else {
    i = 40;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    116a <main+0x5a>
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jle    115e <main+0x4e>
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1165 <main+0x55>
movl   $0x32,-0x14(%rbp)
jmp    1171 <main+0x61>
movl   $0x28,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%esi
lea    -0x29(%rsi),%eax
cmp    $0x3a,%eax
ja     112e <main+0x1e>
push   %rax
add    $0xa,%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"i = %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %20
9: ; preds = %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp sgt i32 %13, 50
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %19
18: ; preds = %9
store i32 50, i32* %6
br label %19
19: ; preds = %18, %15
br label %21
20: ; preds = %2
store i32 40, i32* %6
br label %21
21: ; preds = %20, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"i = %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add i32 %0, -41
%4 = icmp ult i32 %3, 59
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = add nuw nsw i32 %0, 10
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %2, %5
ret i32 0
}
int cpusupport_x86_sse2_detect_1(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @cpusupport_x86_sse2_detect_1() {
ret i32 0
}
double f4_sum_float(float v) { return ((double)(v)); }


x86 assembly (clang, -O0):
<f4_sum_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_float>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @f4_sum_float(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
int atoi(char const *);
char *get_arg_value_str(int *, int, char const **, int, char const *,
                        char const *);
int parse_num(int *arg, int argc, const char **argv, int opos, const char *stag,
              const char *ltag) {
  const char *tmp_str = NULL;
  if ((tmp_str = get_arg_value_str(arg, argc, argv, opos, stag, ltag))) {
    return atoi(tmp_str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1030 <get_arg_value_str@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     1180 <parse_num+0x60>
mov    -0x40(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1187 <parse_num+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_num>:
push   %rax
call   1030 <get_arg_value_str@plt>
test   %rax,%rax
je     1134 <parse_num+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @parse_num(i32* %0, i32 %1, i8** %2, i32 %3, i8* %4, i8* %5) {
%7 = tail call i8* @get_arg_value_str(i32* %0, i32 %1, i8** %2, i32 %3, i8* %4, i8* %5)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @atoi(i8* %7)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ %10, %9 ], [ 0, %6 ]
ret i32 %12
}
int fun363() { return 363; }


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

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

LLVM IR (-O0):
define i32 @fun363() {
ret i32 363
}

LLVM IR (-O2):
define i32 @fun363() {
ret i32 363
}
int axp_set_pekopen(int pek) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<axp_set_pekopen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @axp_set_pekopen(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
char *skip_til(char *s, char *chars) {
  while ((*s != 0) && (strchr(chars, *s) == NULL))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_til>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114f <skip_til+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <skip_til+0x4f>
jmp    1170 <skip_til+0x60>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <skip_til+0x10>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_til>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113c <skip_til+0x2c>
mov    %rsi,%r14
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113c <skip_til+0x2c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_til+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @skip_til(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %18, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i32* @strchr(i8* %11, i8 signext %13)
%15 = icmp eq i32* %14, null
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %16
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @skip_til(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i32* @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ my_printf(char *, char *);
void my_putstrtab(char **tab) {
  int i;
  if (tab == NULL)
    return;
  i = -1;
  while (tab[++i] != NULL)
    my_printf("%s\n", tab[i]);
}


x86 assembly (clang, -O0):
<my_putstrtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <my_putstrtab+0x1c>
jmp    116b <my_putstrtab+0x5b>
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     116b <my_putstrtab+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <my_printf@plt>
jmp    1133 <my_putstrtab+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstrtab>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1144 <my_putstrtab+0x34>
mov    %rdi,%rbx
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <my_putstrtab+0x34>
add    $0x8,%rbx
lea    0xed1(%rip),%r14
nop
mov    %r14,%rdi
call   1030 <my_printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <my_putstrtab+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @my_putstrtab(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp eq i8** %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %23
7: ; preds = %1
store i32 -1, i32* %3
br label %8
8: ; preds = %16, %7
%9 = load i8**, i8*** %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %9, i64 %12
%14 = load i8*, i8** %13
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %23
16: ; preds = %8
%17 = load i8**, i8*** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @my_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %8
23: ; preds = %6, %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @my_putstrtab(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %12, %6 ], [ %4, %3 ]
%9 = tail call i32 @my_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
char const *get_arg_value_str(int *, int, char const **, int, char const *,
                              char const *);
const char *parse_string(int *arg, int argc, const char **argv, int opos,
                         const char *stag, const char *ltag) {
  return get_arg_value_str(arg, argc, argv, opos, stag, ltag);
}


x86 assembly (clang, -O0):
<parse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <get_arg_value_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_string>:
jmp    1030 <get_arg_value_str@plt>

LLVM IR (-O0):
define i8* @parse_string(i32* %0, i32 %1, i8** %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8** %2, i8*** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i8**, i8*** %9
%16 = load i32, i32* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @get_arg_value_str(i32* %13, i32 %14, i8** %15, i32 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @parse_string(i32* %0, i32 %1, i8** %2, i32 %3, i8* %4, i8* %5) {
%7 = tail call i8* @get_arg_value_str(i32* %0, i32 %1, i8** %2, i32 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct ethhdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_inner_mac_header(struct sk_buff const *);
struct ethhdr *rpl_inner_eth_hdr(const struct sk_buff *skb) {
  return (struct ethhdr *)skb_inner_mac_header(skb);
}


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

x86 assembly (clang, -O2):
<rpl_inner_eth_hdr>:
jmp    1030 <skb_inner_mac_header@plt>

LLVM IR (-O0):
%struct.ethhdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.ethhdr* @rpl_inner_eth_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_inner_mac_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.ethhdr*
ret %struct.ethhdr* %5
}

LLVM IR (-O2):
%struct.ethhdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.ethhdr* @rpl_inner_eth_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_inner_mac_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.ethhdr*
ret %struct.ethhdr* %3
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int get_freq_nr();
int wrap_get_freq_nr(struct activity *a) {
  int n = 0;
  if ((n = get_freq_nr()) > 0)
    return n;
  return 0;
}


x86 assembly (clang, -O0):
<wrap_get_freq_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <get_freq_nr@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    1141 <wrap_get_freq_nr+0x31>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <wrap_get_freq_nr+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_get_freq_nr>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_freq_nr@plt>
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.activity = type { i32 }
define i32 @wrap_get_freq_nr(%struct.activity* %0) {
%2 = alloca i32
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 0, i32* %4
%5 = call i32 (...) @get_freq_nr()
store i32 %5, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %4
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define i32 @wrap_get_freq_nr(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 (...) @get_freq_nr()
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int endmntent(FILE *fp) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<endmntent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endmntent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @endmntent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @endmntent(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int get_line(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse(char *, int);
int main() {
  char str[1000];
  int len = get_line(str);
  reverse(str, len);
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1050 <get_line@plt>
mov    %eax,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <get_line@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <reverse@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_line(i8* %4)
store i32 %5, i32* %3
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @reverse(i8* %6, i32 %7)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2)
%4 = call i32 @reverse(i8* %2, i32 %3)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ queue_test();
int main() {
  queue_test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <queue_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @queue_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @queue_test()
ret i32 0
}
void __prussintc_set_cmr(volatile unsigned int *pruintc_io,
                         unsigned short sysevt, unsigned short channel) {
  pruintc_io[(0x400 + (sysevt & ~(0x3))) >> 2] |=
      ((channel & 0xF) << ((sysevt & 0x3) << 3));
}


x86 assembly (clang, -O0):
<__prussintc_set_cmr>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
movzwl -0xc(%rbp),%esi
and    $0xf,%esi
movzwl -0xa(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
shl    %cl,%esi
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
and    $0xfffffffc,%ecx
add    $0x400,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
or     %esi,%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__prussintc_set_cmr>:
and    $0xf,%edx
lea    0x0(,%rsi,8),%ecx
shl    %cl,%edx
and    $0xfffffffc,%esi
or     %edx,0x400(%rsi,%rdi,1)
ret

LLVM IR (-O0):
define void @__prussintc_set_cmr(i32* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i32*
%5 = alloca i16
%6 = alloca i16
store i32* %0, i32** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = and i32 %8, 15
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = and i32 %11, 3
%13 = shl i32 %12, 3
%14 = shl i32 %9, %13
%15 = load i32*, i32** %4
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = and i32 %17, -4
%19 = add nsw i32 1024, %18
%20 = ashr i32 %19, 2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %15, i64 %21
%23 = load volatile i32, i32* %22
%24 = or i32 %23, %14
store volatile i32 %24, i32* %22
ret void
}

LLVM IR (-O2):
define void @__prussintc_set_cmr(i32* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = and i16 %2, 15
%5 = zext i16 %4 to i32
%6 = zext i16 %1 to i32
%7 = shl nuw nsw i32 %6, 3
%8 = and i32 %7, 24
%9 = shl nuw nsw i32 %5, %8
%10 = and i32 %6, 65532
%11 = add nuw nsw i32 %10, 1024
%12 = lshr exact i32 %11, 2
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load volatile i32, i32* %14
%16 = or i32 %15, %9
store volatile i32 %16, i32* %14
ret void
}
void router_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @router_cleanup() {
ret void
}
int test(union foo *F) {
  {
    union foo {
      float X;
    } A;
  }
}


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

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

LLVM IR (-O0):
%union.foo = type opaque
%union.foo.0 = type { float }
define i32 @test(%union.foo* %0) {
%2 = alloca i32
%3 = alloca %union.foo*
%4 = alloca %union.foo.0
store %union.foo* %0, %union.foo** %3
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
%union.foo = type opaque
define i32 @test(%union.foo* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
int main() {
  char buffer[31];
  scanf("%s", buffer);
  printf(strstr(buffer, "ss") == NULL ? "no hiss\n" : "hiss\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,%rcx
lea    0xea0(%rip),%rdi
lea    0xe96(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
lea    0xea6(%rip),%rax
lea    0xea2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"ss\00"
@.str.2 = [9 x i8] c"no hiss\0A\00"
@.str.3 = [6 x i8] c"hiss\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%6 = call i32* @strstr(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%10 = call i32 @printf(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"ss\00"
@.str.2 = [9 x i8] c"no hiss\0A\00"
@.str.3 = [6 x i8] c"hiss\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
void map_down(double x_in, double y_in, double *x_out, double *y_out,
              double *z_out) {
  *x_out = 1 - 2 * y_in;
  *y_out = 1 - 2 * x_in;
  *z_out = -1;
}


x86 assembly (clang, -O0):
<map_down>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xedd(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xec0(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_down>:
addsd  %xmm1,%xmm1
movsd  0xef4(%rip),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rdi)
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm2
movsd  %xmm2,(%rsi)
movabs $0xbff0000000000000,%rax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @map_down(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %7
%12 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %11, double 1.000000e+00)
%13 = load double*, double** %8
store double %12, double* %13
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %14, double 1.000000e+00)
%16 = load double*, double** %9
store double %15, double* %16
%17 = load double*, double** %10
store double -1.000000e+00, double* %17
ret void
}

LLVM IR (-O2):
define void @map_down(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double 1.000000e+00)
store double %6, double* %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double 1.000000e+00)
store double %7, double* %3
store double -1.000000e+00, double* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlacpy_(char *, int *, int *, double *, int *, double *,
                           int *);
void matcopy(int n, double *A, double *B) {
  char uplo = 'A';
  dlacpy_(&uplo, &n, &n, A, &n, B, &n);
}


x86 assembly (clang, -O0):
<matcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x41,-0x19(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r9
lea    -0x19(%rbp),%rdi
lea    -0x4(%rbp),%rax
mov    %rax,%rsi
mov    %rax,%rdx
mov    %rax,%r8
mov    %rax,(%rsp)
call   1030 <dlacpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matcopy>:
sub    $0x18,%rsp
mov    %rdx,%r9
mov    %rsi,%rcx
mov    %edi,0x14(%rsp)
movb   $0x41,0x13(%rsp)
lea    0x14(%rsp),%rdx
mov    %rdx,(%rsp)
lea    0x13(%rsp),%rdi
mov    %rdx,%rsi
mov    %rdx,%r8
call   1030 <dlacpy_@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @matcopy(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 65, i8* %5
%6 = call i32 @dlacpy_(i8* %5, i32* %4, i32* %4, double* %1, i32* %4, double* %2, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void unexpected_char(int c) {
  fprintf(stderr, "unexpected character '%c'\n", c);
  exit(1);
}


x86 assembly (clang, -O0):
<unexpected_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unexpected_char>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"unexpected character '%c'\0A\00"
define void @unexpected_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"unexpected character '%c'\0A\00"
define void @unexpected_char(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
void skip_bytes(FILE *stream, int bytes) {
  for (int i = 0; i < bytes; i++) {
    int ret = fgetc(stream);
    if (ret == EOF) {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<skip_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <skip_bytes+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%eax
jne    1155 <skip_bytes+0x45>
jmp    1168 <skip_bytes+0x58>
jmp    115a <skip_bytes+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <skip_bytes+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_bytes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <skip_bytes+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x1,%ebx
mov    0x2ebc(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%eax
je     1146 <skip_bytes+0x36>
lea    0x1(%rbx),%eax
cmp    %ebp,%ebx
mov    %eax,%ebx
jl     1130 <skip_bytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_bytes(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %11
br label %22
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_bytes(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = tail call i32 @fgetc(i32* %0)
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
%9 = add nuw nsw i32 %5, 1
%10 = icmp slt i32 %9, %1
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
int /*<<< orphan*/ readadv(size_t);
void *readin(size_t);
void bread(void *b, size_t len) {
  void *p = readin(len);
  assert(p != NULL);
  memcpy(b, p, len);
  readadv(len);
}


x86 assembly (clang, -O0):
<bread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <readin@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1060 <readadv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bread>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <readin@plt>
mov    %rax,%r15
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <readadv@plt>

LLVM IR (-O0):
define void @bread(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* @readin(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %3
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = call i32 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = load i64, i64* %4
%17 = call i32 @readadv(i64 %16)
ret void
}

LLVM IR (-O2):
define void @bread(i8* %0, i64 %1) {
%3 = tail call i8* @readin(i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @memcpy(i8* %0, i8* %3, i64 %1)
%8 = tail call i32 @readadv(i64 %1)
ret void
}