xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testMinus() { printf("%d - %d = %d\n", 10, 4, 10 - 4); }


x86 assembly (clang, -O0):
<testMinus>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x6,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMinus>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x6,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
define void @testMinus() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
define void @testMinus() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 6)
ret void
}
/* Type definitions */
struct mmpool {
  int dummy;
};

/* Variables and functions */
void *mmp_alloc(struct mmpool *, unsigned long);
void *__mmp_alloc_agent(void *alloc, unsigned long size) {
  return mmp_alloc((struct mmpool *)alloc, size);
}


x86 assembly (clang, -O0):
<__mmp_alloc_agent>:
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 <mmp_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mmp_alloc_agent>:
jmp    1030 <mmp_alloc@plt>

LLVM IR (-O0):
%struct.mmpool = type { i32 }
define i8* @__mmp_alloc_agent(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.mmpool*
%7 = load i64, i64* %4
%8 = call i8* @mmp_alloc(%struct.mmpool* %6, i64 %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.mmpool = type { i32 }
define i8* @__mmp_alloc_agent(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to %struct.mmpool*
%4 = tail call i8* @mmp_alloc(%struct.mmpool* %3, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr, "Usage: cmp [-l | -s] file1 file2\n");
  exit(2);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: cmp [-l | -s] file1 file2\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: cmp [-l | -s] file1 file2\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
int is_good(long x) {
  long y = x;
  int s = 0;
  while (x > 0) {
    s += x % 10;
    x /= 10;
  }
  if (y % s == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_good>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1151 <is_good+0x51>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
movslq -0x1c(%rbp),%rax
add    %rdx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    1117 <is_good+0x17>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1174 <is_good+0x74>
movl   $0x1,-0x4(%rbp)
jmp    117b <is_good+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_good>:
mov    %rdi,%r8
xor    %esi,%esi
test   %rdi,%rdi
jle    1142 <is_good+0x42>
movabs $0xcccccccccccccccd,%r9
cc cc cc
mov    %r8,%rcx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
mul    %r9
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edi
sub    %eax,%edi
add    %esi,%edi
movslq %edi,%rsi
cmp    $0x9,%rcx
mov    %rdx,%rcx
ja     1120 <is_good+0x20>
mov    %r8,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1158 <is_good+0x58>
mov    %r8,%rax
cqto
idiv   %rsi
jmp    115f <is_good+0x5f>
mov    %r8d,%eax
xor    %edx,%edx
div    %esi
xor    %eax,%eax
test   %rdx,%rdx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_good(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = urem i64 %5, 10
%7 = add nsw i64 %4, %6
%8 = udiv i64 %5, 10
%9 = shl i64 %7, 32
%10 = ashr exact i64 %9, 32
%11 = icmp ult i64 %5, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %10, %3 ]
%14 = srem i64 %0, %13
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void t1() {
  int a[] = {1};
  free(a);
}


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

x86 assembly (clang, -O2):
<t1>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.t1.a = [1 x i32] [i32 1]
define void @t1() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = call i32 @free(i32* %3)
ret void
}

LLVM IR (-O2):
define void @t1() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 1, i32* %3
%4 = call i32 @free(i32* %3)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int open(char const *, int, int);
int open_write(const char *filename) {
  return open(filename, O_WRONLY | O_CREAT | 0, 0644);
}


x86 assembly (clang, -O0):
<open_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
or     $0x0,%esi
mov    $0x1a4,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_write>:
mov    0x2eb9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1a4,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
define i32 @open_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = or i32 %6, 0
%8 = call i32 @open(i8* %3, i32 %7, i32 420)
ret i32 %8
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
define i32 @open_write(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 420)
ret i32 %5
}
unsigned char *char_serialize(unsigned char *buffer, char c) {
  buffer[0] = c;
  return (buffer + sizeof(char));
}


x86 assembly (clang, -O0):
<char_serialize>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_serialize>:
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @char_serialize(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
ret i8* %9
}

LLVM IR (-O2):
define i8* @char_serialize(i8* writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void stub1(char *);
void show(void (*fp)(char *), char *str) {
  (*fp)(str);
  puts(str);
}


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

x86 assembly (clang, -O2):
<show>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
call   *%rax
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @show(void (i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
void fwriteln(const char *buf, FILE *fp) {
  fputs(buf, fp);
  fputc('\n', fp);
}


x86 assembly (clang, -O0):
<fwriteln>:
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 <fputs@plt>
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwriteln>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fputs@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fputc@plt>

LLVM IR (-O0):
define void @fwriteln(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 i32 @fputs(i8* %5, i32* %6)
%8 = load i32*, i32** %4
%9 = call i32 @fputc(i8 signext 10, i32* %8)
ret void
}

LLVM IR (-O2):
define void @fwriteln(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fputs(i8* %0, i32* %1)
%4 = tail call i32 @fputc(i8 signext 10, i32* %1)
ret void
}
void ULT_Cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @ULT_Cleanup() {
ret void
}
void x_cgo_notify_runtime_init_done(void *dummy) {}


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

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

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

LLVM IR (-O2):
define void @x_cgo_notify_runtime_init_done(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showFooter(char *nom) { printf("\n***FI %s*** \n", nom); }


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

x86 assembly (clang, -O2):
<showFooter>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"\0A***FI %s*** \0A\00"
define void @showFooter(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int sysfs_gpio_init(void) { return access("/sys/class/gpio/export", F_OK); }


x86 assembly (clang, -O0):
<sysfs_gpio_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <access@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_gpio_init>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <access@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@F_OK = global i32 0
define i32 @sysfs_gpio_init() {
%1 = load i32, i32* @F_OK
%2 = call i32 @access(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@F_OK = global i32 0
define i32 @sysfs_gpio_init() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
__attribute__((always_)) int func1(int x) { return x * 23; }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x17,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
lea    (%rdi,%rdi,2),%eax
shl    $0x3,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @func1(i32 %0) {
%2 = mul nsw i32 %0, 23
ret i32 %2
}
int isspace(int c) {
  return (c == ' ' || c == '\t' || c == '\v' || c == '\f' || c == '\n' ||
          c == '\r');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 11
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 12
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 10
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 13
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 12, label %5
i32 11, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
streq(char str1[], char str2[]) {
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k] != str2[k]))
      return (0);
    k++;
  }
  return (k);
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <streq+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1151 <streq+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1165 <streq+0x65>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <streq+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <streq+0x24>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %cl,(%rdi,%rdx,1)
jne    1124 <streq+0x24>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <streq+0x10>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %7
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11
%17 = trunc i64 %12 to i32
br label %18
18: ; preds = %5, %16, %2
%19 = phi i32 [ 0, %2 ], [ %17, %16 ], [ 0, %5 ]
ret i32 %19
}
unsigned short int fuw_(unsigned short int *const uw) { return (*uw); }


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

x86 assembly (clang, -O2):
<fuw_>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @fuw_(i16* nocapture %0) {
%2 = load i16, i16* %0
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x42_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x42_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x42_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x42_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x42_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
unsigned long arm_gen_nop(void) { return 0xe1a00000; }


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

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

LLVM IR (-O0):
define i64 @arm_gen_nop() {
ret i64 3785359360
}

LLVM IR (-O2):
define i64 @arm_gen_nop() {
ret i64 3785359360
}
int os_open(const char *filename, unsigned int mode, void **data, int *fd) {
  return -1;
}


x86 assembly (clang, -O0):
<os_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @os_open(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 -1
}
int main() {
  printf("\n %s: \n", __func__);
  test(100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
mov    $0x0,%al
call   1040 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x64,%edi
xor    %eax,%eax
call   1040 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%3 = call i32 (i32, ...) bitcast (i32 (...)* @test to i32 (i32, ...)*)(i32 100)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @test to i32 (i32, ...)*)(i32 100)
ret i32 0
}
int priv_set_restore_linkdir(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @priv_set_restore_linkdir() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @priv_set_restore_linkdir() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ n;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int serializerInt(FILE *f, int n) {
  fwrite(&n, sizeof(n), 1, f);
  return sizeof(n);
}


x86 assembly (clang, -O0):
<serializerInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializerInt>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serializerInt(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
ret i32 4
}

LLVM IR (-O2):
define i32 @serializerInt(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_card_info_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_card_info_by_index"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_get_card_info_by_index>:
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):
<pa_context_get_card_info_by_index>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [50 x i8] c"NOT IMPLEMENTED:pa_context_get_card_info_by_index\00"
define i32 @pa_context_get_card_info_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int gcd(int a, int b) {
  while (a != b) {
    if (a > b)
      a = a - b;
    else
      b = b - a;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113e <gcd+0x3e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <gcd+0x30>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <gcd+0x39>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <gcd+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <gcd+0x10>
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ __fail(char *, char *, char *, int);
neverGetHere1(void) {
  __fail(
      "Shouldn't get here 1", "\"Shouldn't get here 1\"",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/atsidaev/sdcc-z80-gas/refs/heads/master/"
      "cpctelera/tools/sdcc-3.6.8-r9946/src/support/regression/tests/logic.c",
      25);
  return 0;
}


x86 assembly (clang, -O0):
<neverGetHere1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef3(%rip),%rsi
lea    0xf03(%rip),%rdx
mov    $0x19,%ecx
call   1030 <__fail@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neverGetHere1>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef6(%rip),%rsi
lea    0xf06(%rip),%rdx
mov    $0x19,%ecx
call   1030 <__fail@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Shouldn't get here 1\00"
@.str.1 = [23 x i8] c"\22Shouldn't get here 1\22\00"
@.str.2 = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/atsidaev/sdcc-z80-gas/refs/heads/master/cpctelera/tools/sdcc-3.6.8-r9946/src/support/regression/tests/logic.c\00"
define i32 @neverGetHere1() {
%1 = call i32 @__fail(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.2, i64 0, i64 0), i32 25)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Shouldn't get here 1\00"
@.str.1 = [23 x i8] c"\22Shouldn't get here 1\22\00"
@.str.2 = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/atsidaev/sdcc-z80-gas/refs/heads/master/cpctelera/tools/sdcc-3.6.8-r9946/src/support/regression/tests/logic.c\00"
define i32 @neverGetHere1() {
%1 = tail call i32 @__fail(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.2, i64 0, i64 0), i32 25)
ret i32 0
}
void __change_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % ((int)sizeof(unsigned long) * 8)));
  unsigned long *p =
      ((unsigned long *)addr) + ((nr) / ((int)sizeof(unsigned long) * 8));
  *p ^= mask;
}


x86 assembly (clang, -O0):
<__change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__change_bit>:
mov    %edi,%ecx
lea    0x3f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
and    $0xffffffc0,%edx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
sar    $0x6,%eax
cltq
xor    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @__change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 64
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 64
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = xor i64 %18, %16
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @__change_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 64
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 64
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = xor i64 %9, %5
store i64 %10, i64* %8
ret void
}
unsigned int swap32(unsigned int x) {
  unsigned char *ptr = (unsigned char *)&x;
  return (unsigned int)((unsigned int)ptr[0] << 24 |
                        (unsigned int)ptr[1] << 16 | (unsigned int)ptr[2] << 8 |
                        ptr[3]);
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %21, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ printf(char *, double, double);
int main(int argc, const char *argv[]) {
  double AV;
  AV = 0.05;
  AV = 1.0 / (AV - floor(AV));
  printf("AV = %g, AV - floor(AV) = %g\n", AV, AV - floor(AV));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <floor@plt>
movsd  -0x30(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe98(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <floor@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
subsd  %xmm2,%xmm1
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"AV = %g, AV - floor(AV) = %g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 5.000000e-02, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = call double @llvm.floor.f64(double %8)
%10 = fsub double %7, %9
%11 = fdiv double 1.000000e+00, %10
store double %11, double* %6
%12 = load double, double* %6
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @llvm.floor.f64(double %14)
%16 = fsub double %13, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %12, double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"AV = %g, AV - floor(AV) = %g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double 2.000000e+01, double 0.000000e+00)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fwarning(char *);
int nice(int);
void set_nice(int inc) {
  errno = 0;
  int rv = nice(inc);
  (void)rv;
  if (errno)
    fwarning("cannot set nice value\n");
}


x86 assembly (clang, -O0):
<set_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <nice@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpq   $0x0,(%rax)
je     1161 <set_nice+0x41>
lea    0xea4(%rip),%rdi
call   1040 <fwarning@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nice>:
push   %rbx
mov    0x2eb8(%rip),%rbx
movq   $0x0,(%rbx)
call   1030 <nice@plt>
cmpq   $0x0,(%rbx)
je     1147 <set_nice+0x27>
lea    0xebf(%rip),%rdi
pop    %rbx
jmp    1040 <fwarning@plt>
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [23 x i8] c"cannot set nice value\0A\00"
define void @set_nice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i64 0, i64* @errno
%4 = load i32, i32* %2
%5 = call i32 @nice(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @fwarning(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [23 x i8] c"cannot set nice value\0A\00"
define void @set_nice(i32 %0) {
store i64 0, i64* @errno
%2 = tail call i32 @nice(i32 %0)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fwarning(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
int main() {
  int a1 = 0, a2 = 0;
  f1(&a1, &a2);
  printf("a1[@%X]=%X\na2[@%X]=%X\n", &a1, a1, &a2, a2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <f1@plt>
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
lea    0xea6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <f1@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%r8d
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"a1[@%X]=%X\0Aa2[@%X]=%X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @f1 to i32 (i32*, i32*, ...)*)(i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %2, i32 %5, i32* %3, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"a1[@%X]=%X\0Aa2[@%X]=%X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @f1 to i32 (i32*, i32*, ...)*)(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %6, i32* %2, i32 %7)
ret i32 0
}
void inc(unsigned int *x) { *x = *x + 1; }


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @inc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Usage() {
  printf("DBoxShot (c) by Daniel Scheack <dscheack@t-online.de>\n"
         "%s\n"
         "Usage: dboxshot [-d] [-h] [-r] [-c hex] [-t n] [-o filename]\n"
         "  Options\n"
         "  -d\tDebugmodus enabled\n"
         "  -h\tprint out this message\n"
         "  -r\tenable RLE compression\n"
         "  -c\tdefine backgroundcolor in RGB-hex (e.g. -c d0d0d0)\n"
         "  -t\twait mSec. before Screenshot\n"
         "  -o\tdefine output filename (default: fbout.bmp)\n",
         "$Id: dboxshot.c,v 1.3 2006/12/23 16:19:36 stdin Exp $");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0x103a(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
lea    0xee9(%rip),%rdi
lea    0x103e(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [348 x i8] c"DBoxShot (c) by Daniel Scheack <dscheack@t-online.de>\0A%s\0AUsage: dboxshot [-d] [-h] [-r] [-c hex] [-t n] [-o filename]\0A Options\0A -d\09Debugmodus enabled\0A -h\09print out this message\0A -r\09enable RLE compression\0A -c\09define backgroundcolor in RGB-hex (e.g. -c d0d0d0)\0A -t\09wait mSec. before Screenshot\0A -o\09define output filename (default: fbout.bmp)\0A\00"
@.str.1 = [54 x i8] c"$Id: dboxshot.c,v 1.3 2006/12/23 16:19:36 stdin Exp $\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [348 x i8] c"DBoxShot (c) by Daniel Scheack <dscheack@t-online.de>\0A%s\0AUsage: dboxshot [-d] [-h] [-r] [-c hex] [-t n] [-o filename]\0A Options\0A -d\09Debugmodus enabled\0A -h\09print out this message\0A -r\09enable RLE compression\0A -c\09define backgroundcolor in RGB-hex (e.g. -c d0d0d0)\0A -t\09wait mSec. before Screenshot\0A -o\09define output filename (default: fbout.bmp)\0A\00"
@.str.1 = [54 x i8] c"$Id: dboxshot.c,v 1.3 2006/12/23 16:19:36 stdin Exp $\00"
define void @Usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_arith_hypot_u64_f(void *s, void *d, void *o) {}


x86 assembly (clang, -O0):
<g_arith_hypot_u64_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g_arith_hypot_u64_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
double dist2_d(double x1, double y1, double x2, double y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}


x86 assembly (clang, -O0):
<dist2_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @dist2_d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load double, double* %6
%16 = load double, double* %8
%17 = fsub double %15, %16
%18 = load double, double* %6
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %11, double %14, double %21)
ret double %22
}

LLVM IR (-O2):
define double @dist2_d(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
ret double %8
}
void path_011_expected_6(int a, int b) {
  switch (a) {
  case 0:
    break;
  case 1:
    break;
  }
  if (b) {
  }
}


x86 assembly (clang, -O0):
<path_011_expected_6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112e <path_011_expected_6+0x2e>
jmp    111d <path_011_expected_6+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1133 <path_011_expected_6+0x33>
jmp    1138 <path_011_expected_6+0x38>
jmp    1138 <path_011_expected_6+0x38>
jmp    1138 <path_011_expected_6+0x38>
cmpl   $0x0,-0x8(%rbp)
je     1147 <path_011_expected_6+0x47>
jmp    1147 <path_011_expected_6+0x47>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @path_011_expected_6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %8 [
i32 0, label %6
i32 1, label %7
]
6: ; preds = %2
br label %8
7: ; preds = %2
br label %8
8: ; preds = %2, %7, %6
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @path_011_expected_6(i32 %0, i32 %1) {
ret void
}