xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isJMP(const char *comm) { return strcmp(comm, "jmp") == 0; }


x86 assembly (clang, -O0):
<isJMP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isJMP>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"jmp\00"
define i32 @isJMP(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"jmp\00"
define i32 @isJMP(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *argv0) {
  printf("\n"
         "   Usage: %s <in-filename> <out-filename> <present if normalization "
         "desired>\n"
         "\n"
         "      Reads image file <in-filename> and then:\n"
         "      (1) Converts it to grayscale\n"
         "      (2) Normalizes if <present...> is present\n"
         "      (3) Writes (normalized) image to <out-filename>\n"
         "      File format is determined by extension, required in {ee264,bmp}"
         "\n",
         basename(argv0));
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
call   1040 <basename@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [334 x i8] c"\0A Usage: %s <in-filename> <out-filename> <present if normalization desired>\0A\0A Reads image file <in-filename> and then:\0A (1) Converts it to grayscale\0A (2) Normalizes if <present...> is present\0A (3) Writes (normalized) image to <out-filename>\0A File format is determined by extension, required in {ee264,bmp}\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @basename(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([334 x i8], [334 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [334 x i8] c"\0A Usage: %s <in-filename> <out-filename> <present if normalization desired>\0A\0A Reads image file <in-filename> and then:\0A (1) Converts it to grayscale\0A (2) Normalizes if <present...> is present\0A (3) Writes (normalized) image to <out-filename>\0A File format is determined by extension, required in {ee264,bmp}\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([334 x i8], [334 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
void foo();
int main(int argc, const char *args[]) {
  0 ? foo() : ((void)0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int wait(int *);
int bad_wait(void *addr) { return wait((int *)addr); }


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

x86 assembly (clang, -O2):
<bad_wait>:
jmp    1030 <wait@plt>

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

LLVM IR (-O2):
define i32 @bad_wait(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @wait(i32* %2)
ret i32 %3
}
void glDeleteQueries(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteQueries() {
ret void
}
gmatch(s, p) register char *s, *p;
{
  if (*s == '.' && *p != '.')
    return (0);
  return amatch(s, p);
}


x86 assembly (clang, -O0):
<gmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    114c <gmatch+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     114c <gmatch+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115e <gmatch+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <amatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmatch>:
cmpb   $0x2e,(%rdi)
jne    111a <gmatch+0xa>
cmpb   $0x2e,(%rsi)
jne    1121 <gmatch+0x11>
xor    %eax,%eax
jmp    1030 <amatch@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @gmatch(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @amatch to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void F_FatalError(int x, char *y, int z) { fprintf(stderr, "Bang!\n"); }


x86 assembly (clang, -O0):
<F_FatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_FatalError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"Bang!\0A\00"
define void @F_FatalError(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"Bang!\0A\00"
define void @F_FatalError(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ magic_index(int *, int /*<<< orphan*/, int);
int test_magic_index_at_start() {
  int array[] = {0, 5, 7, 10, 13};
  return 0 == magic_index(array, 0, 4);
}


x86 assembly (clang, -O0):
<test_magic_index_at_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <magic_index@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_magic_index_at_start>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <magic_index@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_magic_index_at_start.array = [5 x i32] [i32 0, i32 5, i32 7, i32 10, i32 13]
define i32 @test_magic_index_at_start() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i64 @magic_index(i32* %3, i32 0, i32 4)
%5 = icmp eq i64 0, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_magic_index_at_start.array = [5 x i32] [i32 0, i32 5, i32 7, i32 10, i32 13]
define i32 @test_magic_index_at_start() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i64 @magic_index(i32* %3, i32 0, i32 4)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int bitmap_size(int nbits) { return ((((nbits)-1) >> 3) + 1); }


x86 assembly (clang, -O0):
<bitmap_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sar    $0x3,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_size>:
lea    -0x1(%rdi),%eax
sar    $0x3,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitmap_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = ashr i32 %4, 3
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @bitmap_size(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 3
%4 = add nsw i32 %3, 1
ret i32 %4
}
void foo009(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo009(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void memset22_array() {
  int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  clang_analyzer_eval(array[1] == 2);
  memset(array, 0, sizeof(array));
  clang_analyzer_eval(array[1] == 0);
}


x86 assembly (clang, -O0):
<memset22_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
cmpl   $0x2,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
cmpl   $0x0,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset22_array>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x1,%edi
call   1040 <clang_analyzer_eval@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1030 <memset@plt>
xor    %edi,%edi
cmpl   $0x0,0x4(%rsp)
sete   %dil
call   1040 <clang_analyzer_eval@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.memset22_array.array = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @memset22_array() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 1
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%9 = call i32 @memset(i32* %8, i32 0, i32 36)
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
ret void
}

LLVM IR (-O2):
@__const.memset22_array.array = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @memset22_array() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 1
%4 = tail call i32 @clang_analyzer_eval(i32 1)
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = call i32 @memset(i32* %5, i32 0, i32 36)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @clang_analyzer_eval(i32 %9)
ret void
}
void nand_select(void) {
  (*((volatile unsigned long *)0x70200004)) &= ~(1 << 1);
}


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

x86 assembly (clang, -O2):
<nand_select>:
andq   $0xfffffffffffffffd,0x70200004
70 fd
ret

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

LLVM IR (-O2):
define void @nand_select() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}
/* Variables and functions */
double centsToDollar(int);
int sprintf(char *, char *, double);
int printReportTotal(char *text, int total) {
  return sprintf(text, "\nTotal $%.02f\n", centsToDollar(total));
}


x86 assembly (clang, -O0):
<printReportTotal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <centsToDollar@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printReportTotal>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <centsToDollar@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0ATotal $%.02f\0A\00"
define i32 @printReportTotal(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 = call double @centsToDollar(i32 %6)
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0ATotal $%.02f\0A\00"
define i32 @printReportTotal(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call double @centsToDollar(i32 %1)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 %4
}
long xtell(void *fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @xtell(i8* nocapture readnone %0) {
ret i64 0
}
fadd(float a, float b, float c, float d) { return a + b + c + d; }


x86 assembly (clang, -O0):
<fadd>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fadd>:
addss  %xmm1,%xmm0
addss  %xmm2,%xmm0
addss  %xmm3,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fadd(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fadd float %9, %10
%12 = load float, float* %7
%13 = fadd float %11, %12
%14 = load float, float* %8
%15 = fadd float %13, %14
%16 = fptosi float %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @fadd(float %0, float %1, float %2, float %3) {
%5 = fadd float %0, %1
%6 = fadd float %5, %2
%7 = fadd float %6, %3
%8 = fptosi float %7 to i32
ret i32 %8
}
/* Variables and functions */
int f3(int);
int f2(int i) { return f3(i) - i; }


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

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %edi,%ebx
call   1030 <f3@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f3(i32 %3)
%5 = load i32, i32* %2
%6 = sub nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = tail call i32 @f3(i32 %0)
%3 = sub nsw i32 %2, %0
ret i32 %3
}
int((facility_ind_transmit))(struct ss7 *ss7, struct isup_call *c,
                             int messagetype, unsigned char *parm, int len) {
  parm[0] = 0x10;
  return 1;
}


x86 assembly (clang, -O0):
<facility_ind_transmit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x10,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<facility_ind_transmit>:
movb   $0x10,(%rcx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @facility_ind_transmit(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %9
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 16, i8* %12
ret i32 1
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @facility_ind_transmit(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture writeonly %3, i32 %4) {
store i8 16, i8* %3
ret i32 1
}
float am2315_compute_temperature(unsigned char msb, unsigned char lsb) {
  int temperature_h, temperature_l;
  float tmp;
  temperature_h = msb & 0x7F;
  temperature_l = lsb;
  tmp = (temperature_h << 8) + temperature_l;
  tmp /= 10.0;
  if (msb & 0x80)
    tmp *= -1;
  return tmp;
}


x86 assembly (clang, -O0):
<am2315_compute_temperature>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1175 <am2315_compute_temperature+0x75>
movss  0xe9d(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<am2315_compute_temperature>:
mov    %edi,%eax
and    $0x7f,%eax
shl    $0x8,%eax
or     %esi,%eax
cvtsi2ss %eax,%xmm0
divss  0xeea(%rip),%xmm0
test   $0x80,%edi
je     1125 <am2315_compute_temperature+0x25>
xorps  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define float @am2315_compute_temperature(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = and i32 %9, 127
store i32 %10, i32* %5
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = shl i32 %13, 8
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = sitofp i32 %16 to float
store float %17, float* %7
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = fdiv double %19, 1.000000e+01
%21 = fptrunc double %20 to float
store float %21, float* %7
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = and i32 %23, 128
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = load float, float* %7
%28 = fmul float %27, -1.000000e+00
store float %28, float* %7
br label %29
29: ; preds = %26, %2
%30 = load float, float* %7
ret float %30
}

LLVM IR (-O2):
define float @am2315_compute_temperature(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = shl nuw nsw i32 %3, 8
%6 = and i32 %5, 32512
%7 = or i32 %6, %4
%8 = sitofp i32 %7 to float
%9 = fdiv float %8, 1.000000e+01
%10 = and i32 %3, 128
%11 = icmp eq i32 %10, 0
%12 = fneg float %9
%13 = select i1 %11, float %9, float %12
ret float %13
}
void g_value_set_int64() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_int64() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t get_16(const uint8_t **pp) {
  uint16_t v = *(const uint16_t *)(*pp);
  (*pp) += 2;
  return v;
}


x86 assembly (clang, -O0):
<get_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_16>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x8,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get_16(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32* %9, i32** %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_16(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %2, i64 2
store i32* %4, i32** %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ to_point(int, int /*<<< orphan*/);
int /*<<< orphan*/ turn(int /*<<< orphan*/);
int turn_left() {
  turn(to_point(-1, 0));
  return 1;
}


x86 assembly (clang, -O0):
<turn_left>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_left>:
push   %rax
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @turn_left() {
%1 = call i32 @to_point(i32 -1, i32 0)
%2 = call i32 @turn(i32 %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @turn_left() {
%1 = tail call i32 @to_point(i32 -1, i32 0)
%2 = tail call i32 @turn(i32 %1)
ret i32 1
}
/* Variables and functions */
char *frob();
int /*<<< orphan*/ oof();
void test_2(int code) {
  char *temp = frob();
  int rotate = (code == 22);
  if (!rotate && temp == 0)
    oof();
}


x86 assembly (clang, -O0):
<test_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <frob@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x16,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1161 <test_2+0x41>
cmpq   $0x0,-0x10(%rbp)
jne    1161 <test_2+0x41>
mov    $0x0,%al
call   1030 <oof@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <frob@plt>
cmp    $0x16,%ebx
je     113c <test_2+0x1c>
test   %rax,%rax
jne    113c <test_2+0x1c>
xor    %eax,%eax
pop    %rbx
jmp    1030 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i8* (...) @frob()
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 22
%8 = zext i1 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @oof()
br label %16
16: ; preds = %14, %11, %1
ret void
}

LLVM IR (-O2):
define void @test_2(i32 %0) {
%2 = tail call i8* (...) @frob()
%3 = icmp ne i32 %0, 22
%4 = icmp eq i8* %2, null
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *role_primary_where(char *role_name) {
  static char where[128];
  sprintf(where, "role = '%s'", role_name);
  return where;
}


x86 assembly (clang, -O0):
<role_primary_where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<role_primary_where>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@role_primary_where.where = internal global [128 x i8] zeroinitializer
@.str = [12 x i8] c"role = '%s'\00"
define i8* @role_primary_where(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @role_primary_where.where, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @role_primary_where.where, i64 0, i64 0)
}

LLVM IR (-O2):
@role_primary_where.where = internal global [128 x i8] zeroinitializer
@.str = [12 x i8] c"role = '%s'\00"
define i8* @role_primary_where(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @role_primary_where.where, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @role_primary_where.where, i64 0, i64 0)
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
void reg8_write_masked(volatile uint8_t *reg, uint8_t mask, uint8_t value) {
  *reg = (*reg & (~mask)) | (value & mask);
}


x86 assembly (clang, -O0):
<reg8_write_masked>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%edx
and    %edx,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg8_write_masked>:
mov    %esi,-0x8(%rsp)
mov    %edx,-0x4(%rsp)
mov    (%rdi),%eax
mov    -0x8(%rsp),%ecx
not    %ecx
and    %eax,%ecx
mov    -0x4(%rsp),%eax
and    -0x8(%rsp),%eax
or     %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @reg8_write_masked(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store volatile i32 %1, i32* %5
store volatile i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load volatile i32, i32* %7
%9 = load volatile i32, i32* %5
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = load volatile i32, i32* %6
%13 = load volatile i32, i32* %5
%14 = and i32 %12, %13
%15 = or i32 %11, %14
%16 = load i32*, i32** %4
store volatile i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @reg8_write_masked(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store volatile i32 %1, i32* %4
store volatile i32 %2, i32* %5
%6 = load volatile i32, i32* %0
%7 = load volatile i32, i32* %4
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
%10 = load volatile i32, i32* %5
%11 = load volatile i32, i32* %4
%12 = and i32 %11, %10
%13 = or i32 %12, %9
store volatile i32 %13, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zero(int **);
void testZero(int *a) {
  zero(&a);
  *a = 1;
}


x86 assembly (clang, -O0):
<testZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <zero@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testZero>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <zero@plt>
mov    (%rsp),%rax
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @testZero(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @zero(i32** %2)
%4 = load i32*, i32** %2
store i32 1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parent_handler(int errno) { printf("parent caught SIGUSR2\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"parent caught SIGUSR2\0A\00"
define void @parent_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"parent caught SIGUSR2\00"
define void @parent_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int *);
void handler(int signo) {
  printf("SIGCHLD handler\n");
  int state;
  wait(&state);
}


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

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"SIGCHLD handler\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = bitcast i32* %2 to i8*
%5 = call i32 @wait(i32* %2)
ret void
}
int fn9(int i, int j, int k) {
  if (i > 0 && j > 0 && k > 0)
    return -999;
  else if (i > 0 && j > 0 && k > 0)
    return 999;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fn9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <fn9+0x37>
cmpl   $0x0,-0xc(%rbp)
jle    1137 <fn9+0x37>
cmpl   $0x0,-0x10(%rbp)
jle    1137 <fn9+0x37>
movl   $0xfffffc19,-0x4(%rbp)
jmp    1168 <fn9+0x68>
cmpl   $0x0,-0x8(%rbp)
jle    1161 <fn9+0x61>
cmpl   $0x0,-0xc(%rbp)
jle    1161 <fn9+0x61>
cmpl   $0x0,-0x10(%rbp)
jle    1161 <fn9+0x61>
movl   $0x3e7,-0x4(%rbp)
jmp    1168 <fn9+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn9>:
xor    %ecx,%ecx
test   %edx,%edx
mov    $0xfffffc19,%eax
cmovle %ecx,%eax
test   %esi,%esi
cmovle %ecx,%eax
test   %edi,%edi
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fn9(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
%5 = icmp sgt i32 %1, 0
%6 = and i1 %4, %5
%7 = icmp sgt i32 %2, 0
%8 = and i1 %6, %7
%9 = select i1 %8, i32 -999, i32 0
ret i32 %9
}
/* Variables and functions */
scalar_t__ random();
int get_random_fd() {
  int fd;
  while (1) {
    fd = ((int)random()) % 128;
    if (fd > 2)
      return fd;
  }
}


x86 assembly (clang, -O0):
<get_random_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    113d <get_random_fd+0x2d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <get_random_fd+0x8>

x86 assembly (clang, -O2):
<get_random_fd>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff80,%ecx
sub    %ecx,%eax
cmp    $0x3,%eax
jl     1120 <get_random_fd+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random_fd() {
%1 = alloca i32
br label %2
2: ; preds = %0, %10
%3 = call i64 (...) @random()
%4 = trunc i64 %3 to i32
%5 = srem i32 %4, 128
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %1
ret i32 %9
10: ; preds = %2
br label %2
}

LLVM IR (-O2):
define i32 @get_random_fd() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @random()
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, 128
%5 = icmp sgt i32 %4, 2
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int __write2(const char *s) { return write(2, s, strlen(s)); }


x86 assembly (clang, -O0):
<__write2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__write2>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @__write2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__write2(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ arc4random_buf(unsigned char *, int);
int RAND_pseudo_bytes(unsigned char *buf, int num) {
  if (num > 0)
    arc4random_buf(buf, num);
  return 1;
}


x86 assembly (clang, -O0):
<RAND_pseudo_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1135 <RAND_pseudo_bytes+0x25>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <arc4random_buf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_pseudo_bytes>:
test   %esi,%esi
jle    111e <RAND_pseudo_bytes+0xe>
push   %rax
call   1030 <arc4random_buf@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @RAND_pseudo_bytes(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @arc4random_buf(i8* %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fake_a_rnd(int, int, int);
long sd_nation(long skip_count) {
  long li;
  for (li = 1L; li <= skip_count; li++)
    fake_a_rnd((int)(72 * 0.4), (int)(72 * 1.6), 41);
  return (0);
}


x86 assembly (clang, -O0):
<sd_nation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1157 <sd_nation+0x47>
mov    $0x1c,%edi
mov    $0x73,%esi
mov    $0x29,%edx
call   1030 <fake_a_rnd@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <sd_nation+0x14>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_nation>:
push   %rbx
test   %rdi,%rdi
jle    113a <sd_nation+0x2a>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1c,%edi
mov    $0x73,%esi
mov    $0x29,%edx
call   1030 <fake_a_rnd@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <sd_nation+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @sd_nation(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @fake_a_rnd(i32 28, i32 115, i32 41)
br label %10
10: ; preds = %8
%11 = load i64, i64* %3
%12 = add nsw i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
ret i64 0
}

LLVM IR (-O2):
define i64 @sd_nation(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @fake_a_rnd(i32 28, i32 115, i32 41)
%6 = add nuw i64 %4, 1
%7 = icmp eq i64 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char *, int);
void bar() {
  char array[1000];
  char *endptr = &array[sizeof array];
  foo(array, endptr, 23);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x3f0(%rbp),%rax
add    $0x3e8,%rax
mov    %rax,-0x3f8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x3f8(%rbp),%rsi
mov    $0x17,%edx
call   1030 <foo@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x3e8,%rsp
lea    0x3e8(%rsp),%rsi
mov    %rsp,%rdi
mov    $0x17,%edx
call   1030 <foo@plt>
add    $0x3e8,%rsp
ret

LLVM IR (-O0):
define void @bar() {
%1 = alloca [1000 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 1000
store i8* %3, i8** %2
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @foo(i8* %4, i8* %5, i32 23)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 1000
%4 = call i32 @foo(i8* %2, i8* %3, i32 23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int matchstr(const void *key1, const void *key2) {
  return !strcmp((const char *)key1, (const char *)key2);
}


x86 assembly (clang, -O0):
<matchstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchstr>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @matchstr(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 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @matchstr(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndirectE0(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op92E0M0(void) { STA16(DirectIndirectE0(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op92E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <DirectIndirectE0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op92E0M0>:
push   %rax
mov    $0x2,%edi
call   1030 <DirectIndirectE0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op92E0M0() {
%1 = call i32 @DirectIndirectE0(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op92E0M0() {
%1 = tail call i32 @DirectIndirectE0(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
alpha(c) int c;
{ return ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z'); }


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <alpha+0x24>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1147 <alpha+0x47>
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     1141 <alpha+0x41>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @alpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 65, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @alpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void av_strlcatf() {}


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

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

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

LLVM IR (-O2):
define void @av_strlcatf() {
ret void
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
struct link *list_front(struct link *);
int /*<<< orphan*/ list_take(struct link *);
struct link *list_take_front(struct link *__restrict list) {
  struct link *link;
  link = list_front(list);
  list_take(link);
  return link;
}


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

x86 assembly (clang, -O2):
<list_take_front>:
push   %rbx
call   1030 <list_front@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <list_take@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.link = type { i32 }
define %struct.link* @list_take_front(%struct.link* noalias %0) {
%2 = alloca %struct.link*
%3 = alloca %struct.link*
store %struct.link* %0, %struct.link** %2
%4 = load %struct.link*, %struct.link** %2
%5 = call %struct.link* @list_front(%struct.link* %4)
store %struct.link* %5, %struct.link** %3
%6 = load %struct.link*, %struct.link** %3
%7 = call i32 @list_take(%struct.link* %6)
%8 = load %struct.link*, %struct.link** %3
ret %struct.link* %8
}

LLVM IR (-O2):
%struct.link = type { i32 }
define %struct.link* @list_take_front(%struct.link* noalias %0) {
%2 = tail call %struct.link* @list_front(%struct.link* %0)
%3 = tail call i32 @list_take(%struct.link* %2)
ret %struct.link* %2
}
void g_cclosure_new_object_swap() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_new_object_swap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ sig_unblock(int /*<<< orphan*/);
extern void sig_hup_unblock(void) { sig_unblock(SIGHUP); }


x86 assembly (clang, -O0):
<sig_hup_unblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_unblock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_hup_unblock>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_unblock@plt>

LLVM IR (-O0):
@SIGHUP = global i32 0
define void @sig_hup_unblock() {
%1 = load i32, i32* @SIGHUP
%2 = call i32 @sig_unblock(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGHUP = global i32 0
define void @sig_hup_unblock() {
%1 = load i32, i32* @SIGHUP
%2 = tail call i32 @sig_unblock(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwprintf(int /*<<< orphan*/ *, char *, long);
void writeCellId_HashTableFile(FILE *fp, long int id) {
  fwprintf(fp, L"::%ld\n", id);
}


x86 assembly (clang, -O0):
<writeCellId_HashTableFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fwprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCellId_HashTableFile>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fwprintf@plt>

LLVM IR (-O0):
@.str = [7 x i32] [i32 58, i32 58, i32 37, i32 108, i32 100, i32 10, i32 0]
define void @writeCellId_HashTableFile(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @fwprintf(i32* %5, i8* bitcast ([7 x i32]* @.str to i8*), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i32] [i32 58, i32 58, i32 37, i32 108, i32 100, i32 10, i32 0]
define void @writeCellId_HashTableFile(i32* %0, i64 %1) {
%3 = tail call i32 @fwprintf(i32* %0, i8* bitcast ([7 x i32]* @.str to i8*), i64 %1)
ret void
}