xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void breviary_free_string(char *string) {
  if (string == NULL) {
    return;
  }
  free(string);
}


x86 assembly (clang, -O0):
<breviary_free_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <breviary_free_string+0x1c>
jmp    1135 <breviary_free_string+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<breviary_free_string>:
test   %rdi,%rdi
je     111a <breviary_free_string+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @breviary_free_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @breviary_free_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_args(int a, int b) {
  if (a != 1)
    printf("wrong2\n");
  else
    printf("okay\n");
}


x86 assembly (clang, -O0):
<get_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1139 <get_args+0x29>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1145 <get_args+0x35>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_args>:
cmp    $0x1,%edi
lea    0xee6(%rip),%rax
lea    0xee4(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"wrong2\0A\00"
@.str.1 = [6 x i8] c"okay\0A\00"
define void @get_args(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 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"okay\00"
@str.2 = [7 x i8] c"wrong2\00"
define void @get_args(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ line_buff;

/* Variables and functions */
int /*<<< orphan*/ getgrent_r(struct group *, char *, int, struct group **);
struct group *getgrent(void) {
  static char line_buff[1024];
  static struct group gr;
  struct group *result;
  getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
  return result;
}


x86 assembly (clang, -O0):
<getgrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x3321(%rip),%rdi
lea    0x2f1a(%rip),%rsi
mov    $0x400,%edx
lea    -0x8(%rbp),%rcx
call   1030 <getgrent_r@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrent>:
push   %rax
lea    0x3328(%rip),%rdi
lea    0x2f21(%rip),%rsi
mov    %rsp,%rcx
mov    $0x400,%edx
call   1030 <getgrent_r@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i32 }
@getgrent.line_buff = internal global [1024 x i8] zeroinitializer
@getgrent.gr = internal global %struct.group zeroinitializer
define %struct.group* @getgrent() {
%1 = alloca %struct.group*
%2 = call i32 @getgrent_r(%struct.group* @getgrent.gr, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getgrent.line_buff, i64 0, i64 0), i32 1024, %struct.group** %1)
%3 = load %struct.group*, %struct.group** %1
ret %struct.group* %3
}

LLVM IR (-O2):
%struct.group = type { i32 }
@getgrent.line_buff = internal global [1024 x i8] zeroinitializer
@getgrent.gr = internal global %struct.group zeroinitializer
define %struct.group* @getgrent() {
%1 = alloca %struct.group*
%2 = bitcast %struct.group** %1 to i8*
%3 = call i32 @getgrent_r(%struct.group* @getgrent.gr, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getgrent.line_buff, i64 0, i64 0), i32 1024, %struct.group** %1)
%4 = load %struct.group*, %struct.group** %1
ret %struct.group* %4
}
/* Variables and functions */
int /*<<< orphan*/ get_LED_flags(char *);
int /*<<< orphan*/ set_LED_flags(char);
void turn_off_LED(char which_LED) {
  char flags = 0;
  get_LED_flags(&flags);
  flags &= ~which_LED;
  set_LED_flags(flags);
}


x86 assembly (clang, -O0):
<turn_off_LED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
call   1040 <get_LED_flags@plt>
movsbl -0x1(%rbp),%ecx
xor    $0xffffffff,%ecx
movsbl -0x2(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <set_LED_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_off_LED>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdi
call   1040 <get_LED_flags@plt>
not    %bl
and    0xf(%rsp),%bl
mov    %bl,0xf(%rsp)
movsbl %bl,%edi
call   1030 <set_LED_flags@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @turn_off_LED(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = call i32 @get_LED_flags(i8* %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = xor i32 %6, -1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = and i32 %9, %7
%11 = trunc i32 %10 to i8
store i8 %11, i8* %3
%12 = load i8, i8* %3
%13 = call i32 @set_LED_flags(i8 signext %12)
ret void
}

LLVM IR (-O2):
define void @turn_off_LED(i8 signext %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @get_LED_flags(i8* %2)
%4 = xor i8 %0, -1
%5 = load i8, i8* %2
%6 = and i8 %5, %4
store i8 %6, i8* %2
%7 = call i32 @set_LED_flags(i8 signext %6)
ret void
}
void foo(int k) {
  int i = 1;
  void *label;
  label = k ? &&x : &&y;
  if (k == 1)
    goto *label;
  i = 0;
  goto z;
z:
x:
  if (i)
    dont_remove();
y:;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
lea    0x32(%rip),%rcx
lea    0x41(%rip),%rax
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1154 <foo+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117c <foo+0x6c>
movl   $0x0,-0x8(%rbp)
jmp    1160 <foo+0x50>
cmpl   $0x0,-0x8(%rbp)
je     1171 <foo+0x61>
mov    $0x0,%al
call   1030 <dont_remove@plt>
jmp    1176 <foo+0x66>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x18(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
jne    111c <foo+0xc>
xor    %eax,%eax
jmp    1030 <dont_remove@plt>
ret

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* blockaddress(@foo, %15), i8* blockaddress(@foo, %21)
store i8* %8, i8** %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i8*, i8** %4
br label %22
13: ; preds = %1
store i32 0, i32* %3
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14, %22
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @dont_remove()
br label %20
20: ; preds = %18, %15
br label %21
21: ; preds = %20, %22
ret void
22: ; preds = %11
%23 = phi i8* [ %12, %11 ]
indirectbr i8* %23, [label %15, label %21]
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @dont_remove()
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long, long, long);
void output(long b, long i) {
  printf("\n%ld/%ld = 809 * %ld + %ld\n\n", b, i, i, b % i);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%r8
mov    -0x18(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     112f <output+0x1f>
mov    %rsi,%rax
cqto
idiv   %rcx
mov    %rdx,%r8
jmp    1138 <output+0x28>
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%r8d
lea    0xec1(%rip),%rdi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0A%ld/%ld = 809 * %ld + %ld\0A\0A\00"
define void @output(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = srem i64 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6, i64 %7, i64 %10)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0A%ld/%ld = 809 * %ld + %ld\0A\0A\00"
define void @output(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %1, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_dbg(int);
void test5() { __builtin_arm_dbg(16); }


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

x86 assembly (clang, -O2):
<test5>:
mov    $0x10,%edi
jmp    1030 <__builtin_arm_dbg@plt>

LLVM IR (-O0):
define void @test5() {
%1 = call i32 @__builtin_arm_dbg(i32 16)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = tail call i32 @__builtin_arm_dbg(i32 16)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseqx_set_vertical(uint8_t *p_mp2vseqx, uint8_t i_vertical) {
  p_mp2vseqx[6] &= 0x9f;
  p_mp2vseqx[6] |= (i_vertical << 5) & 0x60;
}


x86 assembly (clang, -O0):
<mp2vseqx_set_vertical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0x9f,%ecx
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
and    $0x60,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_set_vertical>:
mov    $0x9f,%eax
and    0x18(%rdi),%eax
shl    $0x5,%esi
and    $0x60,%esi
or     %eax,%esi
mov    %esi,0x18(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseqx_set_vertical(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 = getelementptr inbounds i32, i32* %5, i64 6
%7 = load i32, i32* %6
%8 = and i32 %7, 159
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 5
%11 = and i32 %10, 96
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 6
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mp2vseqx_set_vertical(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
%4 = load i32, i32* %3
%5 = and i32 %4, 159
%6 = shl i32 %1, 5
%7 = and i32 %6, 96
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
int Cyc_Callgraph_fndecl_cmp(struct Cyc_Absyn_Fndecl *fd1,
                             struct Cyc_Absyn_Fndecl *fd2) {
  return (int)fd1 - (int)fd2;
}


x86 assembly (clang, -O0):
<Cyc_Callgraph_fndecl_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Callgraph_fndecl_cmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Fndecl = type opaque
define i32 @Cyc_Callgraph_fndecl_cmp(%struct.Cyc_Absyn_Fndecl* %0, %struct.Cyc_Absyn_Fndecl* %1) {
%3 = alloca %struct.Cyc_Absyn_Fndecl*
%4 = alloca %struct.Cyc_Absyn_Fndecl*
store %struct.Cyc_Absyn_Fndecl* %0, %struct.Cyc_Absyn_Fndecl** %3
store %struct.Cyc_Absyn_Fndecl* %1, %struct.Cyc_Absyn_Fndecl** %4
%5 = load %struct.Cyc_Absyn_Fndecl*, %struct.Cyc_Absyn_Fndecl** %3
%6 = ptrtoint %struct.Cyc_Absyn_Fndecl* %5 to i32
%7 = load %struct.Cyc_Absyn_Fndecl*, %struct.Cyc_Absyn_Fndecl** %4
%8 = ptrtoint %struct.Cyc_Absyn_Fndecl* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Fndecl = type opaque
define i32 @Cyc_Callgraph_fndecl_cmp(%struct.Cyc_Absyn_Fndecl* %0, %struct.Cyc_Absyn_Fndecl* %1) {
%3 = ptrtoint %struct.Cyc_Absyn_Fndecl* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint %struct.Cyc_Absyn_Fndecl* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nums[] = {1, 2, 3, 4, 5};
  int max = -1;
  for (int i = 0; i < 5; i++) {
    if (nums[i] > max) {
      max = nums[i];
    }
  }
  printf("%d", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    1185 <main+0x75>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
jle    1172 <main+0x62>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
jmp    1177 <main+0x67>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114c <main+0x3c>
mov    -0x24(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
void swInit() {
  (*(volatile unsigned long *)(0x3FFFC000 + 0x40)) &= ~((1 << 4) | (1 << 8));
}


x86 assembly (clang, -O0):
<swInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fffc040,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffeef,%rcx
mov    $0x3fffc040,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swInit>:
andq   $0xfffffffffffffeef,0x3fffc040
3f ef fe ff ff
ret

LLVM IR (-O0):
define void @swInit() {
%1 = load volatile i64, i64* inttoptr (i64 1073725504 to i64*)
%2 = and i64 %1, -273
store volatile i64 %2, i64* inttoptr (i64 1073725504 to i64*)
ret void
}

LLVM IR (-O2):
define void @swInit() {
%1 = load volatile i64, i64* inttoptr (i64 1073725504 to i64*)
%2 = and i64 %1, -273
store volatile i64 %2, i64* inttoptr (i64 1073725504 to i64*)
ret void
}
void task_led_second_exit(void *task) {}


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

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

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

LLVM IR (-O2):
define void @task_led_second_exit(i8* nocapture %0) {
ret void
}
void RTStrFormatTypeRegister(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snansumkbn2(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snansumkbn2(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_snansumkbn2@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snansumkbn2@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snansumkbn2(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snansumkbn2(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int get_choice(void) {
  int option = 0;
  printf("Enter your option\n");
  scanf("%d", &option);
  return option;
}


x86 assembly (clang, -O0):
<get_choice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_choice>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Enter your option\00"
define i32 @get_choice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
unsigned char galois_mult_by_two(unsigned char val) {
  if ((val >> 7) & 0x1)
    return (val << 1) ^ 0x1b;
  else
    return (val << 1);
}


x86 assembly (clang, -O0):
<galois_mult_by_two>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
sar    $0x7,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112f <galois_mult_by_two+0x2f>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
xor    $0x1b,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <galois_mult_by_two+0x39>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois_mult_by_two>:
lea    (%rdi,%rdi,1),%eax
movzbl %al,%ecx
xor    $0x1b,%al
test   %dil,%dil
movzbl %al,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @galois_mult_by_two(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 7
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 1
%13 = xor i32 %12, 27
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %20
15: ; preds = %1
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %20
20: ; preds = %15, %9
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define zeroext i8 @galois_mult_by_two(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = shl i8 %0, 1
%4 = xor i8 %3, 27
%5 = select i1 %2, i8 %3, i8 %4
ret i8 %5
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_ack(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x00D0);
}


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

x86 assembly (clang, -O2):
<ieee80211_is_ack>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xd4,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ieee80211_is_ack(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 212)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *arr, int len) {
  int c;
  for (c = 0; c < len; c++) {
    printf("%2d ", arr[c]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%2d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int sync_merge(const char *name, int fd1, int fd2) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sync_merge(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @sync_merge(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int HelpItem142(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem142() {
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(float, int);
float float_linear2srgb(float value) { return (float)pow(value, 1 / 2.2); }


x86 assembly (clang, -O0):
<float_linear2srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_linear2srgb>:
push   %rax
xor    %edi,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @float_linear2srgb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @pow(float %3, i32 0)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @float_linear2srgb(float %0) {
%2 = tail call i64 @pow(float %0, i32 0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ timer;
typedef int /*<<< orphan*/ channel;

/* Variables and functions */
int /*<<< orphan*/ pwm_enable_channel(int /*<<< orphan*/, int /*<<< orphan*/);
size_t usart_in_waiting();
int /*<<< orphan*/ usart_read(int /*<<< orphan*/ *, int);
void rpc_pwm_enable_channel(void) {
  uint8_t timer;
  uint8_t channel;
  size_t argsize = sizeof(timer) + sizeof(channel);
  while (usart_in_waiting() < argsize)
    ;
  usart_read(&timer, sizeof(timer));
  usart_read(&channel, sizeof(channel));
  pwm_enable_channel(timer, channel);
}


x86 assembly (clang, -O0):
<rpc_pwm_enable_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x8,-0x10(%rbp)
mov    $0x0,%al
call   1040 <usart_in_waiting@plt>
cmp    -0x10(%rbp),%rax
jae    1156 <rpc_pwm_enable_channel+0x26>
jmp    1140 <rpc_pwm_enable_channel+0x10>
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <usart_read@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <usart_read@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <pwm_enable_channel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_pwm_enable_channel>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <usart_in_waiting@plt>
cmp    $0x8,%rax
jb     1140 <rpc_pwm_enable_channel+0x10>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <usart_read@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <usart_read@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <pwm_enable_channel@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @rpc_pwm_enable_channel() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i64 8, i64* %3
br label %4
4: ; preds = %8, %0
%5 = call i64 (...) @usart_in_waiting()
%6 = load i64, i64* %3
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = call i32 @usart_read(i32* %1, i32 4)
%11 = call i32 @usart_read(i32* %2, i32 4)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @pwm_enable_channel(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @rpc_pwm_enable_channel() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = tail call i64 (...) @usart_in_waiting()
%7 = icmp ult i64 %6, 8
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = call i32 @usart_read(i32* %1, i32 4)
%10 = call i32 @usart_read(i32* %2, i32 4)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @pwm_enable_channel(i32 %11, i32 %12)
ret void
}
void cygwin_premain1(int argc __attribute__((unused)),
                     char **argv __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @cygwin_premain1(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
unsigned int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init(unsigned m[], unsigned n) {
  unsigned i;
  srand(time(NULL));
  for (i = 0; i < n; i++)
    m[i] = rand() % n;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1186 <init+0x56>
mov    $0x0,%al
call   1050 <rand@plt>
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <init+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %r15d,%r15d
je     1179 <init+0x49>
mov    %r15d,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <rand@plt>
xor    %edx,%edx
div    %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1160 <init+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @init(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = call i32 (...) @rand()
%14 = load i32, i32* %4
%15 = urem i32 %13, %14
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %12
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @init(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp eq i32 %1, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = tail call i32 (...) @rand()
%11 = urem i32 %10, %1
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getSecond(unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long sec;
  getSecond(&sec);
  printf("the value of sec is %ld\n", sec);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <getSecond@plt>
mov    -0x8(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <getSecond@plt>
mov    (%rsp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"the value of sec is %ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = call i32 @getSecond(i64* %1)
%3 = load i64, i64* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"the value of sec is %ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @getSecond(i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
int subxy(int x, int y) {
  int z, i;
  z = 0;
  i = x;
  if (y <= 0 || x <= 0) {
    return 0;
  }
  while (i > 0) {
    i--;
    z++;
  }
  while (i < y) {
    i++;
    z--;
  }
  return z;
}


x86 assembly (clang, -O0):
<subxy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112b <subxy+0x2b>
cmpl   $0x0,-0x8(%rbp)
jg     1137 <subxy+0x37>
movl   $0x0,-0x4(%rbp)
jmp    118b <subxy+0x8b>
jmp    113c <subxy+0x3c>
cmpl   $0x0,-0x14(%rbp)
jle    115d <subxy+0x5d>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <subxy+0x3c>
jmp    1162 <subxy+0x62>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1185 <subxy+0x85>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1162 <subxy+0x62>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subxy>:
mov    %edi,%eax
sub    %esi,%eax
xor    %ecx,%ecx
test   %esi,%esi
cmovle %ecx,%eax
test   %edi,%edi
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @subxy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11, %2
store i32 0, i32* %3
br label %36
15: ; preds = %11
br label %16
16: ; preds = %19, %15
%17 = load i32, i32* %7
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %7
%21 = add nsw i32 %20, -1
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %16
24: ; preds = %16
br label %25
25: ; preds = %29, %24
%26 = load i32, i32* %7
%27 = load i32, i32* %5
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
%32 = load i32, i32* %6
%33 = add nsw i32 %32, -1
store i32 %33, i32* %6
br label %25
34: ; preds = %25
%35 = load i32, i32* %6
store i32 %35, i32* %3
br label %36
36: ; preds = %34, %14
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @subxy(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
%4 = icmp slt i32 %0, 1
%5 = or i1 %4, %3
%6 = sub nsw i32 %0, %1
%7 = select i1 %5, i32 0, i32 %6
ret i32 %7
}
void TerminalRestoreState() {}


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

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

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

LLVM IR (-O2):
define void @TerminalRestoreState() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_pi();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int counter = 0;
  if (!test_pi()) {
    printf("Pi test failed!\n");
    counter++;
  }
  printf("%d tests failed.\n", counter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_pi@plt>
cmp    $0x0,%eax
jne    118d <main+0x4d>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1060 <test_pi@plt>
test   %eax,%eax
jne    117d <main+0x2d>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xe7c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Pi test failed!\0A\00"
@.str.1 = [18 x i8] c"%d tests failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
store i32 0, i32* %2
%5 = call i32 (...) @test_pi()
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%d tests failed.\0A\00"
@str = [16 x i8] c"Pi test failed!\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @test_pi()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = phi i32 [ 0, %0 ], [ 1, %5 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int bround(int len) {
  if (len % 8 == 0)
    return len;
  return len + (8 - len % 8);
}


x86 assembly (clang, -O0):
<bround>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1126 <bround+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <bround+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bround>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    $0x8,%eax
sub    %ecx,%eax
test   %ecx,%ecx
cmove  %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bround(i32 %0) {
%2 = srem i32 %0, 8
%3 = icmp eq i32 %2, 0
%4 = sub nsw i32 8, %2
%5 = select i1 %3, i32 0, i32 %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clear_timeout_thread();
int /*<<< orphan*/ sleep(int);
void *clear_thread_handler(void *data) {
  while (1) {
    sleep(10);
    clear_timeout_thread();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<clear_thread_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1030 <clear_timeout_thread@plt>
jmp    112c <clear_thread_handler+0xc>

x86 assembly (clang, -O2):
<clear_thread_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1030 <clear_timeout_thread@plt>
jmp    1130 <clear_thread_handler+0x10>

LLVM IR (-O0):
define i8* @clear_thread_handler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 10)
%5 = call i32 (...) @clear_timeout_thread()
br label %3
}

LLVM IR (-O2):
define noalias i8* @clear_thread_handler(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 (...) @clear_timeout_thread()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fn(unsigned long long *);
void f5(void) {
  typedef unsigned long long L __attribute__((aligned(16)));
  L a;
  fn(&a);
}


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

x86 assembly (clang, -O2):
<f5>:
push   %rax
mov    %rsp,%rdi
call   1030 <fn@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f5() {
%1 = alloca i64
%2 = call i32 @fn(i64* %1)
ret void
}

LLVM IR (-O2):
define void @f5() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @fn(i64* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ on;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ Setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int const *, int);
void Setsockopt_reuseaddr(int s) {
  const int on = 1;
  Setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
}


x86 assembly (clang, -O0):
<Setsockopt_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <Setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setsockopt_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <Setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @Setsockopt_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @Setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @Setsockopt_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @Setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ isprint(char);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ putchar(char);
void putchar_safe(char c) {
  if (isprint(c))
    putchar(c);
  else
    printf("\\%03o", c);
}


x86 assembly (clang, -O0):
<putchar_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     115f <putchar_safe+0x2f>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    116f <putchar_safe+0x3f>
lea    0xe9a(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar_safe>:
push   %rbx
mov    %edi,%ebx
call   1050 <isprint@plt>
test   %rax,%rax
je     1146 <putchar_safe+0x16>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>
movsbl %bl,%esi
lea    0xeb0(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\\%03o\00"
define void @putchar_safe(i8 signext %0) {
%2 = tail call i64 @isprint(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @putchar(i8 signext %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %8
8: ; preds = %6, %4
ret void
}