xunge/DecIR huggingface dataset:
/* Variables and functions */
char *paramornull(char *s) {
  if (s == NULL || *s == '-')
    return NULL;
  return s;
}


x86 assembly (clang, -O0):
<paramornull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <paramornull+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1130 <paramornull+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1138 <paramornull+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<paramornull>:
xor    %eax,%eax
test   %rdi,%rdi
je     110e <paramornull+0xe>
cmpb   $0x2d,(%rdi)
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i8* @paramornull(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %12
11: ; preds = %6, %1
store i8* null, i8** %2
br label %14
12: ; preds = %6
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %11
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @paramornull(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
%6 = select i1 %5, i8* null, i8* %0
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ null, %1 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
void stub1(short, double);
void testClosureSDrV(void (*closure)(short, double), short a1, double a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureSDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <testClosureSDrV+0x35>
mov    -0x8(%rbp),%rax
mov    -0xa(%rbp),%cx
movsd  -0x18(%rbp),%xmm0
movswl %cx,%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureSDrV>:
test   %rdi,%rdi
je     110d <testClosureSDrV+0xd>
mov    %rdi,%rax
movswl %si,%edi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureSDrV(void (i16, double)* %0, i16 signext %1, double %2) {
%4 = alloca void (i16, double)*
%5 = alloca i16
%6 = alloca double
store void (i16, double)* %0, void (i16, double)** %4
store i16 %1, i16* %5
store double %2, double* %6
%7 = load void (i16, double)*, void (i16, double)** %4
%8 = icmp ne void (i16, double)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i16, double)*, void (i16, double)** %4
%11 = load i16, i16* %5
%12 = load double, double* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureSDrV(void (i16, double)* %0, i16 signext %1, double %2) {
%4 = icmp eq void (i16, double)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i16 signext %1, double %2)
br label %6
6: ; preds = %5, %3
ret void
}
void bwputs(char *s) {
  while (*s) {
    while (*(((volatile unsigned int *)0x101f1000) + 0x06) & 0x20)
      ;
    *((volatile unsigned int *)0x101f1000) = *s;
    s++;
  }
}


x86 assembly (clang, -O0):
<bwputs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <bwputs+0x52>
jmp    111a <bwputs+0x1a>
mov    $0x101f1000,%eax
mov    0x18(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1133 <bwputs+0x33>
jmp    111a <bwputs+0x1a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x101f1000,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <bwputs+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwputs>:
mov    (%rdi),%al
test   %al,%al
je     1133 <bwputs+0x33>
cs nopw 0x0(%rax,%rax,1)
testl  $0x20,0x101f1018
jne    1110 <bwputs+0x10>
movsbl %al,%eax
mov    %eax,0x101f1000
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <bwputs+0x10>
ret

LLVM IR (-O0):
define void @bwputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %13, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %3
br label %8
8: ; preds = %12, %7
%9 = load volatile i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 270471168 to i32*), i64 6)
%10 = and i32 %9, 32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
store volatile i32 %16, i32* inttoptr (i64 270471168 to i32*)
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @bwputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %14, %11 ], [ %2, %1 ]
%6 = phi i8* [ %13, %11 ], [ %0, %1 ]
br label %7
7: ; preds = %4, %7
%8 = load volatile i32, i32* inttoptr (i64 270471192 to i32*)
%9 = and i32 %8, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7
%12 = sext i8 %5 to i32
store volatile i32 %12, i32* inttoptr (i64 270471168 to i32*)
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %11, %1
ret void
}
/* Type definitions */
struct bitmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bitmap *);
void bitmap_free(struct bitmap *root) { free(root); }


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

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

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

LLVM IR (-O2):
%struct.bitmap = type { i32 }
define void @bitmap_free(%struct.bitmap* nocapture %0) {
%2 = tail call i32 @free(%struct.bitmap* %0)
ret void
}
int inet_addr_bin(char *ip) { return *(int *)ip; }


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

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

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

LLVM IR (-O2):
define i32 @inet_addr_bin(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int psp_vdp2_reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @psp_vdp2_reset() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cwdir;

/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
char *getCurrentFolder() {
  static char cwdir[1024];
  if (getcwd(cwdir, sizeof(cwdir)) != NULL) {
    return cwdir;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<getCurrentFolder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f21(%rip),%rdi
mov    $0x400,%esi
call   1030 <getcwd@plt>
cmp    $0x0,%rax
je     1143 <getCurrentFolder+0x33>
lea    0x2f06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <getCurrentFolder+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentFolder>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <getcwd@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@getCurrentFolder.cwdir = internal global [1024 x i8] zeroinitializer
define i8* @getCurrentFolder() {
%1 = alloca i8*
%2 = call i32* @getcwd(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getCurrentFolder.cwdir, i64 0, i64 0), i32 1024)
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getCurrentFolder.cwdir, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* null, i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@getCurrentFolder.cwdir = internal global [1024 x i8] zeroinitializer
define i8* @getCurrentFolder() {
%1 = tail call i32* @getcwd(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getCurrentFolder.cwdir, i64 0, i64 0), i32 1024)
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @getCurrentFolder.cwdir, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int chdir(char *);
char *getenv(char *);
int /*<<< orphan*/ perror(char *);
void changeDirectory(char **tokens) {
  if (tokens[1] == NULL)
    chdir(getenv("HOME"));
  else if (chdir(tokens[1]) == -1)
    perror("Error");
}


x86 assembly (clang, -O0):
<changeDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1164 <changeDirectory+0x34>
lea    0xeae(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1040 <chdir@plt>
jmp    118b <changeDirectory+0x5b>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <chdir@plt>
cmp    $0xffffffff,%eax
jne    1186 <changeDirectory+0x56>
lea    0xe84(%rip),%rdi
call   1050 <perror@plt>
jmp    118b <changeDirectory+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeDirectory>:
push   %rax
mov    0x8(%rdi),%rdi
test   %rdi,%rdi
je     1146 <changeDirectory+0x16>
call   1040 <chdir@plt>
cmp    $0xffffffff,%eax
je     115b <changeDirectory+0x2b>
pop    %rax
ret
lea    0xeb3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <chdir@plt>
lea    0xea3(%rip),%rdi
pop    %rax
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [6 x i8] c"Error\00"
define void @changeDirectory(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @chdir(i8* %8)
br label %19
10: ; preds = %1
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @chdir(i8* %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
br label %19
19: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [6 x i8] c"Error\00"
define void @changeDirectory(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @chdir(i8* %6)
br label %13
8: ; preds = %1
%9 = tail call i32 @chdir(i8* %3)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %8, %11, %5
ret void
}
/* Variables and functions */
unsigned int ntohl(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          unsigned int);
void printIP(unsigned int ip) {
  ip = ntohl(ip);
  printf("%d.%d.%d.%d", ip >> 24, (ip & 0x00FF0000) >> 16,
         (ip & 0x0000FF00) >> 8, ip & 0x000000FF);
}


x86 assembly (clang, -O0):
<printIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shr    $0x18,%esi
mov    -0x4(%rbp),%edx
and    $0xff0000,%edx
shr    $0x10,%edx
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
mov    -0x4(%rbp),%r8d
and    $0xff,%r8d
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIP>:
push   %rax
call   1040 <ntohl@plt>
mov    %eax,%edx
movzbl %ah,%ecx
movzbl %al,%r8d
shr    $0x18,%eax
shr    $0x10,%edx
movzbl %dl,%edx
lea    0xec1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @printIP(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 24
%7 = load i32, i32* %2
%8 = and i32 %7, 16711680
%9 = lshr i32 %8, 16
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = lshr i32 %11, 8
%13 = load i32, i32* %2
%14 = and i32 %13, 255
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @printIP(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = lshr i32 %2, 24
%4 = lshr i32 %2, 16
%5 = and i32 %4, 255
%6 = lshr i32 %2, 8
%7 = and i32 %6, 255
%8 = and i32 %2, 255
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %8)
ret void
}
char check_leap_year(short year) {
  if ((year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <check_leap_year+0x53>
movswl -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114a <check_leap_year+0x4a>
movswl -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <check_leap_year+0x53>
movb   $0x1,-0x1(%rbp)
jmp    1157 <check_leap_year+0x57>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_leap_year>:
test   $0x3,%dil
jne    1142 <check_leap_year+0x42>
imul   $0x5c29,%edi,%eax
add    $0x51c,%eax
ror    $0x2,%ax
movzwl %ax,%ecx
mov    $0x1,%al
cmp    $0x28e,%ecx
ja     1144 <check_leap_year+0x44>
movswl %di,%ecx
imul   $0x147b,%ecx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x15,%ecx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
test   %di,%di
je     1144 <check_leap_year+0x44>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @check_leap_year(i16 signext %0) {
%2 = and i16 %0, 3
%3 = icmp eq i16 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i16 %0, 100
%6 = icmp ne i16 %5, 0
%7 = srem i16 %0, 400
%8 = icmp eq i16 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i8 [ 0, %10 ], [ 1, %4 ]
ret i8 %12
}
void platform_udc_clk_release(void) {}


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

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

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

LLVM IR (-O2):
define void @platform_udc_clk_release() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string_copy_rev(char *, char const *);
void string_copy_rev_from_commit_line(char *dst, const char *src) {
  string_copy_rev(dst, src + (sizeof("commit ") - 1));
}


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

x86 assembly (clang, -O2):
<string_copy_rev_from_commit_line>:
add    $0x7,%rsi
jmp    1030 <string_copy_rev@plt>

LLVM IR (-O0):
define void @string_copy_rev_from_commit_line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 7
%8 = call i32 @string_copy_rev(i8* %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @string_copy_rev_from_commit_line(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 7
%4 = tail call i32 @string_copy_rev(i8* %0, i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ sqrt(float const);
float mvVecLength3(const float *v) {
  return (float)sqrt((v[0] * v[0]) + (v[1] * v[1]) + (v[2] * v[2]));
}


x86 assembly (clang, -O0):
<mvVecLength3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecLength3>:
push   %rax
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mvVecLength3(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call i64 @sqrt(float %23)
%25 = sitofp i64 %24 to float
ret float %25
}

LLVM IR (-O2):
define float @mvVecLength3(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call i64 @sqrt(float %9)
%11 = sitofp i64 %10 to float
ret float %11
}
void setup_scene() {}


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

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

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

LLVM IR (-O2):
define void @setup_scene() {
ret void
}
/* Variables and functions */
unsigned int invert(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned x = invert(5, 0, 3);
  printf("%u\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @invert(i32 5, i32 0, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo(void) { printf("ala ma asa\n"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"ala ma asa\0A\00"
define i32 @foo() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [11 x i8] c"ala ma asa\00"
define i32 @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
__attribute__((always_)) int zone_to_nid(struct zone *zone) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @zone_to_nid(%struct.zone* nocapture readnone %0) {
ret i32 0
}
int test_imm_21uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x21 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_21uint64_lowword_reg>:
test   $0x21,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_21uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 33
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ HDMITX_WriteI2C_Byte(int, int);
void HDCP_ResumeRepeaterAuthenticate(void) {
  HDMITX_WriteI2C_Byte(0x22, (1 << 0));
  HDMITX_WriteI2C_Byte(0x10, (0 << 0));
}


x86 assembly (clang, -O0):
<HDCP_ResumeRepeaterAuthenticate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDCP_ResumeRepeaterAuthenticate>:
push   %rax
mov    $0x22,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x10,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <HDMITX_WriteI2C_Byte@plt>

LLVM IR (-O0):
define void @HDCP_ResumeRepeaterAuthenticate() {
%1 = call i32 @HDMITX_WriteI2C_Byte(i32 34, i32 1)
%2 = call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 0)
ret void
}

LLVM IR (-O2):
define void @HDCP_ResumeRepeaterAuthenticate() {
%1 = tail call i32 @HDMITX_WriteI2C_Byte(i32 34, i32 1)
%2 = tail call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 0)
ret void
}
/* Variables and functions */
int atoi(char const *);
int option_integer_arg(const char *zVal) { return atoi(zVal); }


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

x86 assembly (clang, -O2):
<option_integer_arg>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @option_integer_arg(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
int check_prime(int num) {
  int a;
  if (num == 1)
    return 1;
  for (a = 2; a <= num / 2; a++) {
    if (num % a == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <check_prime+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1178 <check_prime+0x78>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1171 <check_prime+0x71>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115e <check_prime+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1178 <check_prime+0x78>
jmp    1163 <check_prime+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <check_prime+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%r8d
cmp    $0x1,%edi
jne    110f <check_prime+0xf>
mov    %r8d,%eax
ret
cmp    $0x4,%edi
jge    1117 <check_prime+0x17>
xor    %eax,%eax
ret
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     110b <check_prime+0xb>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1130 <check_prime+0x30>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @check_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %25
8: ; preds = %1
store i32 2, i32* %4
br label %9
9: ; preds = %21, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %24
14: ; preds = %9
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %2
br label %25
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %9
24: ; preds = %9
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19, %7
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 4
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = lshr i32 %0, 1
br label %10
7: ; preds = %10
%8 = add nuw nsw i32 %11, 1
%9 = icmp eq i32 %11, %6
br i1 %9, label %14, label %10
10: ; preds = %5, %7
%11 = phi i32 [ %8, %7 ], [ 2, %5 ]
%12 = srem i32 %0, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %10, %7, %3, %1
%15 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %10 ], [ 0, %7 ]
ret i32 %15
}
int comma_2() {
  int a = 9, b = 7;
  int d = (a = a * 2, b = 7 * a++, a + b + 9);
  return d;
}


x86 assembly (clang, -O0):
<comma_2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x9,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
imul   $0x7,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comma_2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 9, i32* %1
store i32 7, i32* %2
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, 2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = mul nsw i32 7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = add nsw i32 %11, 9
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @comma_2() {
ret i32 154
}
/* Variables and functions */
scalar_t__ alloca(int);
void *test6a(char *);
void __attribute__((no)) * test6(void) {
  char *save = (char *)alloca(4);
  return test6a(save);
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <test6a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
push   %rax
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <test6a@plt>

LLVM IR (-O0):
define i8* @test6() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @test6a(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @test6() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @test6a(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ build_sum_segment_tree(int *, int *, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/);
scalar_t__ calloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ segment_tree_size(int);
int *get_sum_segment_tree(int *input, int size) {
  int *segment_tree = (int *)calloc(segment_tree_size(size), sizeof(int));
  puts("calling sum segment");
  build_sum_segment_tree(segment_tree, input, 0, size - 1, 0);
  return segment_tree;
}


x86 assembly (clang, -O0):
<get_sum_segment_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <segment_tree_size@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %r8d,%r8d
mov    %r8d,%edx
call   1050 <build_sum_segment_tree@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sum_segment_tree>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1060 <segment_tree_size@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%r15
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
xor    %r8d,%r8d
call   1050 <build_sum_segment_tree@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"calling sum segment\00"
define i32* @get_sum_segment_tree(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @segment_tree_size(i32 %6)
%8 = call i64 @calloc(i32 %7, i32 4)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @build_sum_segment_tree(i32* %11, i32* %12, i32 0, i32 %14, i32 0)
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [20 x i8] c"calling sum segment\00"
define i32* @get_sum_segment_tree(i32* %0, i32 %1) {
%3 = tail call i32 @segment_tree_size(i32 %1)
%4 = tail call i64 @calloc(i32 %3, i32 4)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = add nsw i32 %1, -1
%8 = tail call i32 @build_sum_segment_tree(i32* %5, i32* %0, i32 0, i32 %7, i32 0)
ret i32* %5
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int wait(int *);
void sig_chld(int signo) {
  pid_t pid;
  int stat;
  pid = wait(&stat);
  printf("child %d terminated\n", pid);
  return;
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @wait(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int **);
int main() {
  volatile int a[20];
  foo((int(*)[3]) & a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = bitcast [20 x i32]* %2 to [3 x i32]*
%4 = bitcast [3 x i32]* %3 to i32**
%5 = call i32 @foo(i32** %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = bitcast [20 x i32]* %1 to i32**
%4 = call i32 @foo(i32** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_device(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<close_device>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_device(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int do_hash(char *key_string) {
  int hash_number = 0;
  while (*key_string != '\0') {
    hash_number += *key_string++;
  }
  return (hash_number % 52);
}


x86 assembly (clang, -O0):
<do_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <do_hash+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <do_hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x34,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_hash>:
mov    (%rdi),%al
test   %al,%al
je     113d <do_hash+0x3d>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <do_hash+0x10>
movslq %ecx,%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x34,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @do_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = srem i32 %17, 52
ret i32 %18
}

LLVM IR (-O2):
define i32 @do_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nsw i32 %6, %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = srem i32 %10, 52
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
int read_char(const unsigned char *data, int offset) { return data[offset]; }


x86 assembly (clang, -O0):
<read_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_char>:
movslq %esi,%rax
movzbl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @read_char(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 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @read_char(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}
const char *get_lame_version(void) {
  static const char *const str = "LAME_MAJOR_VERSION"
                                 "."
                                 "LAME_MINOR_VERSION";
  return str;
}


x86 assembly (clang, -O0):
<get_lame_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lame_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@get_lame_version.str = internal constant i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i32 0, i32 0)
@.str = [38 x i8] c"LAME_MAJOR_VERSION.LAME_MINOR_VERSION\00"
define i8* @get_lame_version() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [38 x i8] c"LAME_MAJOR_VERSION.LAME_MINOR_VERSION\00"
define i8* @get_lame_version() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long find_next_bit(unsigned long const *, unsigned long,
                            int /*<<< orphan*/);
unsigned long find_first_bit(const unsigned long *addr, unsigned long size) {
  return find_next_bit(addr, size, 0);
}


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

x86 assembly (clang, -O2):
<find_first_bit>:
xor    %edx,%edx
jmp    1030 <find_next_bit@plt>

LLVM IR (-O0):
define i64 @find_first_bit(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 = call i64 @find_next_bit(i64* %5, i64 %6, i32 0)
ret i64 %7
}

LLVM IR (-O2):
define i64 @find_first_bit(i64* %0, i64 %1) {
%3 = tail call i64 @find_next_bit(i64* %0, i64 %1, i32 0)
ret i64 %3
}
int test_imm_8Fuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x8F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Fuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 614180323328
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ cl_kernel;
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clReleaseKernel(cl_kernel kernel) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)kernel;
  return (cl_int)syscall(325, 1039, sys_args);
}


x86 assembly (clang, -O0):
<clReleaseKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x40f,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseKernel>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x40f,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clReleaseKernel(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1039, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clReleaseKernel(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1039, i32* %5)
ret i32 %6
}
/* Variables and functions */
double exp(double);
double BFactor(double E_r, double temp) {
  double ret = exp(-E_r / (temp));
  return ret;
}


x86 assembly (clang, -O0):
<BFactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BFactor>:
xorpd  0xee8(%rip),%xmm0
divsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @BFactor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fneg double %6
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @exp(double %9)
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @BFactor(double %0, double %1) {
%3 = fneg double %0
%4 = fdiv double %3, %1
%5 = tail call double @exp(double %4)
ret double %5
}
void av_adler32_update() {}


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

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

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

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

/* Variables and functions */
void write_s24le(char *buf, int32_t x) {
  unsigned char *b = (unsigned char *)buf;
  b[0] = x;
  b[1] = x >> 8;
  b[2] = x >> 16;
}


x86 assembly (clang, -O0):
<write_s24le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_s24le>:
mov    %esi,%eax
mov    %al,(%rdi)
mov    %ah,0x1(%rdi)
shr    $0x10,%eax
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @write_s24le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 16
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
ret void
}

LLVM IR (-O2):
define void @write_s24le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
/* Variables and functions */
scalar_t__ uart0Putch(char);
const char *uart0Puts(const char *string) {
  char ch;
  while ((ch = *string)) {
    if (uart0Putch(ch) < 0)
      break;
    string++;
  }
  return string;
}


x86 assembly (clang, -O0):
<uart0Puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1156 <uart0Puts+0x46>
movsbl -0x9(%rbp),%edi
call   1030 <uart0Putch@plt>
cmp    $0x0,%rax
jge    1145 <uart0Puts+0x35>
jmp    1156 <uart0Puts+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uart0Puts+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0Puts>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <uart0Puts+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <uart0Putch@plt>
test   %rax,%rax
js     1139 <uart0Puts+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart0Puts+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @uart0Puts(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @uart0Putch(i8 signext %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %1
%14 = phi i8* [ %0, %1 ], [ %6, %4 ], [ %10, %9 ]
ret i8* %14
}