xunge/DecIR huggingface dataset:
/* Variables and functions */
void *memmem(char *, int, char *, int);
int main(int argc, char **buffer) {
  char buf[10] = "01Hello78";
  void *ptr;
  if ((ptr = memmem(buf, 10, "Hello", 5)))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0xa,%esi
lea    0xebe(%rip),%rdx
mov    $0x5,%ecx
call   1030 <memmem@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1170 <main+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1177 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x376f6c6c65483130,%rax
6c 6f 37
mov    %rax,0x8(%rsp)
movw   $0x38,0x10(%rsp)
lea    0xed9(%rip),%rdx
lea    0x8(%rsp),%rdi
mov    $0xa,%esi
mov    $0x5,%ecx
call   1030 <memmem@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.buf = [10 x i8] c"01Hello78\00"
@.str = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = call i8* @memmem(i8* %9, i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
store i8* %10, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@__const.main.buf = [10 x i8] c"01Hello78\00"
@.str = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i8* @memmem(i8* %4, i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int randf();
int irand(int bound) {
  int v = (int)(randf() * bound);
  if (v == bound)
    return (bound - 1);
  return v;
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <randf@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1143 <irand+0x33>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <irand+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <randf@plt>
imul   %ebx,%eax
lea    -0x1(%rbx),%ecx
cmp    %ebx,%eax
cmove  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @irand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @randf()
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @irand(i32 %0) {
%2 = tail call i32 (...) @randf()
%3 = mul nsw i32 %2, %0
%4 = icmp eq i32 %3, %0
%5 = add nsw i32 %0, -1
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
int test_imm_37int32_mem(int *val) {
  return ((*val) & (0x37 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_37int32_mem>:
testb  $0x37,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_37int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 55
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void I210ToAR30Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I210ToAR30Row_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_panels();
int /*<<< orphan*/ game_window_is_full_screen();
int /*<<< orphan*/ validate_world_window();
void draw_interface(void) {
  if (!game_window_is_full_screen()) {
    draw_panels();
  }
  validate_world_window();
  return;
}


x86 assembly (clang, -O0):
<draw_interface>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <game_window_is_full_screen@plt>
cmp    $0x0,%eax
jne    114b <draw_interface+0x1b>
mov    $0x0,%al
call   1040 <draw_panels@plt>
mov    $0x0,%al
call   1030 <validate_world_window@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_interface>:
push   %rax
xor    %eax,%eax
call   1050 <game_window_is_full_screen@plt>
test   %eax,%eax
jne    1143 <draw_interface+0x13>
xor    %eax,%eax
call   1040 <draw_panels@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <validate_world_window@plt>

LLVM IR (-O0):
define void @draw_interface() {
%1 = call i32 (...) @game_window_is_full_screen()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @draw_panels()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @validate_world_window()
ret void
}

LLVM IR (-O2):
define void @draw_interface() {
%1 = tail call i32 (...) @game_window_is_full_screen()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @draw_panels()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @validate_world_window()
ret void
}
/* Variables and functions */
int getch();
int ccbi_getch() { return getch(); }


x86 assembly (clang, -O0):
<ccbi_getch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getch@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ccbi_getch() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @ccbi_getch() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
long long min3ll(long long x, long long y, long long z) {
  return (z < y) ? ((z < x) ? z : x) : ((y < x) ? y : x);
}


x86 assembly (clang, -O0):
<min3ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    114e <min3ll+0x4e>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1139 <min3ll+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1141 <min3ll+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1179 <min3ll+0x79>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1169 <min3ll+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1171 <min3ll+0x71>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3ll>:
mov    %rdi,%rax
cmp    %rdi,%rdx
cmovl  %rdx,%rax
cmp    %rsi,%rax
cmovge %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min3ll(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i64, i64* %6
%12 = load i64, i64* %4
%13 = icmp slt i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i64, i64* %6
br label %18
16: ; preds = %10
%17 = load i64, i64* %4
br label %18
18: ; preds = %16, %14
%19 = phi i64 [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load i64, i64* %5
%22 = load i64, i64* %4
%23 = icmp slt i64 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i64, i64* %5
br label %28
26: ; preds = %20
%27 = load i64, i64* %4
br label %28
28: ; preds = %26, %24
%29 = phi i64 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi i64 [ %19, %18 ], [ %29, %28 ]
ret i64 %31
}

LLVM IR (-O2):
define i64 @min3ll(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %2, %0
%5 = select i1 %4, i64 %2, i64 %0
%6 = icmp slt i64 %5, %1
%7 = select i1 %6, i64 %5, i64 %1
ret i64 %7
}
/* Variables and functions */
scalar_t__ br_whable(int);
int do_need_sigen_inc(int a, int b) { return (br_whable(a) && !br_whable(b)); }


x86 assembly (clang, -O0):
<do_need_sigen_inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <br_whable@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114c <do_need_sigen_inc+0x3c>
mov    -0x8(%rbp),%edi
call   1030 <br_whable@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_need_sigen_inc>:
push   %rbx
mov    %esi,%ebx
call   1030 <br_whable@plt>
test   %rax,%rax
je     1131 <do_need_sigen_inc+0x21>
mov    %ebx,%edi
call   1030 <br_whable@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_need_sigen_inc(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 i64 @br_whable(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i64 @br_whable(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br label %13
13: ; preds = %8, %2
%14 = phi i1 [ false, %2 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @do_need_sigen_inc(i32 %0, i32 %1) {
%3 = tail call i64 @br_whable(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @br_whable(i32 %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ pthread_self();
void *thr_fn2(void *arg) {
  printf("thread 2: ID is %lu\n", pthread_self());
  pthread_exit((void *)0);
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"thread 2: ID is %lu\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @pthread_exit(i8* null)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [21 x i8] c"thread 2: ID is %lu\0A\00"
define noalias i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @pthread_exit(i8* null)
ret i8* undef
}
/* Variables and functions */
char *GetConfigValue(char const *, char const *, char *);
unsigned int strtoul(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int ConfigValueUInt(const char *blockName, const char *keyName,
                    unsigned int *ret) {
  const char *val = GetConfigValue(blockName, keyName, "");
  if (!val[0])
    return 0;
  *ret = strtoul(val, NULL, 0);
  return 1;
}


x86 assembly (clang, -O0):
<ConfigValueUInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xebd(%rip),%rdx
call   1040 <GetConfigValue@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1165 <ConfigValueUInt+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1183 <ConfigValueUInt+0x63>
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigValueUInt>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rdx
call   1040 <GetConfigValue@plt>
cmpb   $0x0,(%rax)
je     114a <ConfigValueUInt+0x2a>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @ConfigValueUInt(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* @GetConfigValue(i8* %9, i8* %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %3
store i32 0, i32* %4
br label %21
17: ; preds = %3
%18 = load i8*, i8** %8
%19 = call i32 @strtoul(i8* %18, i32* null, i32 0)
%20 = load i32*, i32** %7
store i32 %19, i32* %20
store i32 1, i32* %4
br label %21
21: ; preds = %17, %16
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @ConfigValueUInt(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @GetConfigValue(i8* %0, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @strtoul(i8* nocapture %4, i32* null, i32 0)
store i32 %8, i32* %2
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ lprcat(char *);
int /*<<< orphan*/ nap(int);
void handsfull() {
  lprcat("\nYou can't carry anything more!");
  lflush();
  nap(2200);
}


x86 assembly (clang, -O0):
<handsfull>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <lprcat@plt>
mov    $0x0,%al
call   1040 <lflush@plt>
mov    $0x898,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handsfull>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <lprcat@plt>
xor    %eax,%eax
call   1040 <lflush@plt>
mov    $0x898,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AYou can't carry anything more!\00"
define void @handsfull() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @lflush()
%3 = call i32 @nap(i32 2200)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AYou can't carry anything more!\00"
define void @handsfull() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @lflush()
%3 = tail call i32 @nap(i32 2200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int newdup(int fd) { return fcntl(fd, F_DUPFD, 0); }


x86 assembly (clang, -O0):
<newdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newdup>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @newdup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_DUPFD
%5 = call i32 @fcntl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @newdup(i32 %0) {
%2 = load i32, i32* @F_DUPFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
int fun388() { return 388; }


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

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

LLVM IR (-O0):
define i32 @fun388() {
ret i32 388
}

LLVM IR (-O2):
define i32 @fun388() {
ret i32 388
}
/* Type definitions */
typedef int /*<<< orphan*/ element_size;

/* Variables and functions */
void *malloc(int);
void *cm_nalloc_1d(void *vector, size_t x_size, size_t element_size) {
  vector = malloc(sizeof(element_size) * x_size);
  return vector;
}


x86 assembly (clang, -O0):
<cm_nalloc_1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_nalloc_1d>:
lea    0x0(,%rsi,8),%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @cm_nalloc_1d(i8* nocapture readnone %0, i64 %1, i64 %2) {
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 3
%6 = tail call i8* @malloc(i32 %5)
ret i8* %6
}
void rpdr2s_(dx, dy) short *dx, *dy;
{ rpdr2((float)*dx, (float)*dy); }


x86 assembly (clang, -O0):
<rpdr2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rpdr2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpdr2s_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
mov    $0x2,%al
jmp    1030 <rpdr2@plt>

LLVM IR (-O0):
define void @rpdr2s_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = fpext float %7 to double
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = sitofp i16 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @rpdr2 to i32 (double, double, ...)*)(double %8, double %12)
ret void
}

LLVM IR (-O2):
define void @rpdr2s_(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = sitofp i16 %3 to double
%5 = load i16, i16* %1
%6 = sitofp i16 %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rpdr2 to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
int bad3(int x) { return __builtin_constant_p(x); }


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

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

LLVM IR (-O0):
define i32 @bad3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i1 @llvm.is.constant.i32(i32 %3)
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @bad3(i32 %0) {
ret i32 0
}
void kbase_timeline_pm_l2_transition_start(struct kbase_device *kbdev) {}


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

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

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

LLVM IR (-O2):
%struct.kbase_device = type opaque
define void @kbase_timeline_pm_l2_transition_start(%struct.kbase_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
long double f_scalar_stack_4(int32_t a, int64_t b, int64_t c, long double d,
                             uint8_t e, int8_t f, uint8_t g) {
  return d;
}


x86 assembly (clang, -O0):
<f_scalar_stack_4>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
fstpt  -0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_scalar_stack_4>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @f_scalar_stack_4(i32 %0, i32 %1, i32 %2, x86_fp80 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca x86_fp80
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store x86_fp80 %3, x86_fp80* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load x86_fp80, x86_fp80* %11
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @f_scalar_stack_4(i32 %0, i32 %1, i32 %2, x86_fp80 returned %3, i32 %4, i32 %5, i32 %6) {
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() {
  int a;
#pragma omp parallel private(a)
  { sleep(1); }
#pragma omp parallel
  { sleep(1); }
#pragma omp parallel for
  for (int i = 0; i < 2; i++) {
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    115c <main+0x4c>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @sleep(i32 1)
%5 = call i32 @sleep(i32 1)
store i32 0, i32* %3
br label %6
6: ; preds = %11, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i32 @sleep(i32 1)
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %6
14: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @sleep(i32 1)
ret i32 0
}
void a2i_ASN1_INTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @a2i_ASN1_INTEGER() {
ret void
}
int is_set(int *x, int b) { return *x & (1 << b); }


x86 assembly (clang, -O0):
<is_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_set>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @is_set(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* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_set(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
ret i32 %5
}
void dropBigger(char *a, char *b) {
  char tmp;
  if (*a >= *b) {
    tmp = *a;
    *a = *b;
    *b = tmp;
  }
}


x86 assembly (clang, -O0):
<dropBigger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jl     1140 <dropBigger+0x40>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropBigger>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jl     110c <dropBigger+0xc>
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @dropBigger(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
store i8 %4, i8* %0
store i8 %3, i8* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sub();
int main() {
  sub();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sub()
ret i32 0
}
/* Variables and functions */
int execute_using_pipe(int /*<<< orphan*/, int);
int /*<<< orphan*/ string_to_command(char *);
int exec_pipe(char *command, int sleeptime) {
  return execute_using_pipe(string_to_command(command), sleeptime);
}


x86 assembly (clang, -O0):
<exec_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_to_command@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <execute_using_pipe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_pipe>:
push   %rbx
mov    %esi,%ebx
call   1040 <string_to_command@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <execute_using_pipe@plt>

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

LLVM IR (-O2):
define i32 @exec_pipe(i8* %0, i32 %1) {
%3 = tail call i32 @string_to_command(i8* %0)
%4 = tail call i32 @execute_using_pipe(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rand();
void change_random() { rand(); }


x86 assembly (clang, -O0):
<change_random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @change_random() {
%1 = call i32 (...) @rand()
ret void
}

LLVM IR (-O2):
define void @change_random() {
%1 = tail call i32 (...) @rand()
ret void
}
int foo(void) {
#pragma starpu debug_tree foo
  static int x = 2;
#pragma starpu debug_tree x
  return x;
}


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

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

LLVM IR (-O0):
@foo.x = internal global i32 2
define i32 @foo() {
%1 = load i32, i32* @foo.x
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 2
}
/* Variables and functions */
scalar_t__ is_hex(char const);
char *__skip_hex(const char *s) {
  while (is_hex(*s))
    s++;
  return (char *)s;
}


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

x86 assembly (clang, -O2):
<__skip_hex>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_hex@plt>
test   %rax,%rax
jne    1120 <__skip_hex+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__skip_hex(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_hex(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int roi_set_clean(unsigned char *buff) {
  buff[0] = (135);
  return 1;
}


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

x86 assembly (clang, -O2):
<roi_set_clean>:
movb   $0x87,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @roi_set_clean(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 -121, i8* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @roi_set_clean(i8* nocapture writeonly %0) {
store i8 -121, i8* %0
ret i32 1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int syscall_stat(char const *, struct stat *);
int stat(const char *file, struct stat *st) { return syscall_stat(file, st); }


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

x86 assembly (clang, -O2):
<stat>:
jmp    1030 <syscall_stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @syscall_stat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @syscall_stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  int counter = 1;
  while (counter < 7)
    printf("Number of counter: %d\n", counter++);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    114c <main+0x3c>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Number of counter: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
void hdmi4_cec_irq(struct hdmi_core_data *core) {}


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

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

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

LLVM IR (-O2):
%struct.hdmi_core_data = type opaque
define void @hdmi4_cec_irq(%struct.hdmi_core_data* nocapture %0) {
ret void
}
int is_opr(char in) {
  if (in == 0x21 || in == 0x26 || in == 0x3D || in == 0x3C || in == 0x3E ||
      in == 0x7C || in == 0x2B) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_opr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x21,%eax
je     1165 <is_opr+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x26,%eax
je     1165 <is_opr+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
je     1165 <is_opr+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x3c,%eax
je     1165 <is_opr+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x3e,%eax
je     1165 <is_opr+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x7c,%eax
je     1165 <is_opr+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    1171 <is_opr+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1178 <is_opr+0x78>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_opr>:
xor    %eax,%eax
cmp    $0x3e,%dil
ja     111d <is_opr+0x1d>
movzbl %dil,%ecx
movabs $0x7000084200000000,%rdx
bt     %rcx,%rdx
jae    111d <is_opr+0x1d>
ret
cmp    $0x7c,%dil
je     111c <is_opr+0x1c>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_opr(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
%6 = icmp eq i32 %5, 33
br i1 %6, label %31, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 38
br i1 %10, label %31, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 61
br i1 %14, label %31, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 60
br i1 %18, label %31, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 62
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 124
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 43
br i1 %30, label %31, label %32
31: ; preds = %27, %23, %19, %15, %11, %7, %1
store i32 0, i32* %2
br label %33
32: ; preds = %27
store i32 1, i32* %2
br label %33
33: ; preds = %32, %31
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @is_opr(i8 signext %0) {
switch i8 %0, label %2 [
i8 124, label %3
i8 62, label %3
i8 61, label %3
i8 60, label %3
i8 43, label %3
i8 38, label %3
i8 33, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
/* Type definitions */
struct udp_monoport_acq_workspace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct udp_monoport_acq_workspace *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stop_acq(struct udp_monoport_acq_workspace *);
int deinit_acq(struct udp_monoport_acq_workspace *ws) {
  stop_acq(ws);
  free(ws);
  printf("udp monoport acquisition deinitialized\n");
  return 1;
}


x86 assembly (clang, -O0):
<deinit_acq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <stop_acq@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deinit_acq>:
push   %rbx
mov    %rdi,%rbx
call   1050 <stop_acq@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.udp_monoport_acq_workspace = type { i32 }
@.str = [40 x i8] c"udp monoport acquisition deinitialized\0A\00"
define i32 @deinit_acq(%struct.udp_monoport_acq_workspace* %0) {
%2 = alloca %struct.udp_monoport_acq_workspace*
store %struct.udp_monoport_acq_workspace* %0, %struct.udp_monoport_acq_workspace** %2
%3 = load %struct.udp_monoport_acq_workspace*, %struct.udp_monoport_acq_workspace** %2
%4 = call i32 @stop_acq(%struct.udp_monoport_acq_workspace* %3)
%5 = load %struct.udp_monoport_acq_workspace*, %struct.udp_monoport_acq_workspace** %2
%6 = call i32 @free(%struct.udp_monoport_acq_workspace* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.udp_monoport_acq_workspace = type { i32 }
@str = [39 x i8] c"udp monoport acquisition deinitialized\00"
define i32 @deinit_acq(%struct.udp_monoport_acq_workspace* %0) {
%2 = tail call i32 @stop_acq(%struct.udp_monoport_acq_workspace* %0)
%3 = tail call i32 @free(%struct.udp_monoport_acq_workspace* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
int ASN1_STRING_type(const ASN1_STRING *x) { return (x->type); }


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

x86 assembly (clang, -O2):
<ASN1_STRING_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_type(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_type(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
void RTLockValidatorRecSharedCheckAndRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedCheckAndRelease() {
ret void
}
/* Type definitions */
typedef int const uint32_t;

/* Variables and functions */
uint32_t functionI(const uint32_t b, const uint32_t c, const uint32_t d) {
  return c ^ (b | ~d);
}


x86 assembly (clang, -O0):
<functionI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionI>:
mov    %edx,%eax
not    %eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @functionI(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @functionI(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %1
ret i32 %6
}
/* Type definitions */
struct linkedList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addFrontList(struct linkedList *, int);
int /*<<< orphan*/ assert(int);
void addList(struct linkedList *lst, int v) {
  assert(lst != 0);
  addFrontList(lst, v);
}


x86 assembly (clang, -O0):
<addList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <addFrontList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addList>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <addFrontList@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
define void @addList(%struct.linkedList* %0, i32 %1) {
%3 = alloca %struct.linkedList*
%4 = alloca i32
store %struct.linkedList* %0, %struct.linkedList** %3
store i32 %1, i32* %4
%5 = load %struct.linkedList*, %struct.linkedList** %3
%6 = icmp ne %struct.linkedList* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.linkedList*, %struct.linkedList** %3
%10 = load i32, i32* %4
%11 = call i32 @addFrontList(%struct.linkedList* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
define void @addList(%struct.linkedList* %0, i32 %1) {
%3 = icmp ne %struct.linkedList* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @addFrontList(%struct.linkedList* %0, i32 %1)
ret void
}
void optionEnd2RBRA() {}


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

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

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

LLVM IR (-O2):
define void @optionEnd2RBRA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void DieWithError(char *errorMessage) { perror(errorMessage); }


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

x86 assembly (clang, -O2):
<DieWithError>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @DieWithError(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
double distances_to_angle(double d01, double d02, double d12) {
  return (d12 * d12 + d01 * d01 - d02 * d02) / (2.0 * d12 * d01);
}


x86 assembly (clang, -O0):
<distances_to_angle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distances_to_angle>:
movapd %xmm2,%xmm3
addsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm0
mulsd  %xmm3,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm3
divsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @distances_to_angle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %5
%14 = load double, double* %5
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %12)
%17 = load double, double* %6
%18 = fmul double 2.000000e+00, %17
%19 = load double, double* %4
%20 = fmul double %18, %19
%21 = fdiv double %16, %20
ret double %21
}

LLVM IR (-O2):
define double @distances_to_angle(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %4)
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %5)
%8 = fmul double %2, 2.000000e+00
%9 = fmul double %8, %0
%10 = fdiv double %7, %9
ret double %10
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_expect_byte(struct cbor_buf *, int);
bool cbor_expect_false(struct cbor_buf *buf) {
  return cbor_expect_byte(buf, 0xf4);
}


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

x86 assembly (clang, -O2):
<cbor_expect_false>:
mov    $0xf4,%esi
jmp    1030 <cbor_expect_byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_expect_false(%struct.cbor_buf* %0) {
%2 = alloca %struct.cbor_buf*
store %struct.cbor_buf* %0, %struct.cbor_buf** %2
%3 = load %struct.cbor_buf*, %struct.cbor_buf** %2
%4 = call i32 @cbor_expect_byte(%struct.cbor_buf* %3, i32 244)
ret i32 %4
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_expect_false(%struct.cbor_buf* %0) {
%2 = tail call i32 @cbor_expect_byte(%struct.cbor_buf* %0, i32 244)
ret i32 %2
}