xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
main() {
  char t[] = "the test\\tstring\\nshould print\\tescape \\nsequences\\n";
  char s[1000];
  printf("%s\n", t);
  escape(s, t);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
lea    -0x40(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x35,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    -0x430(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <escape@plt>
lea    -0x430(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x430,%rsp
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x6e5c7365636e65,%rax
mov    %rax,0x2d(%rsp)
lea    0xed0(%rip),%r14
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <escape@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.t = [53 x i8] c"the test\\tstring\\nshould print\\tescape \\nsequences\\n\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [53 x i8]
%2 = alloca [1000 x i8]
%3 = bitcast [53 x i8]* %1 to i8*
%4 = getelementptr inbounds [53 x i8], [53 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [53 x i8], [53 x i8]* %1, i64 0, i64 0
%8 = call i32 @escape(i8* %6, i8* %7)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.t = [53 x i8] c"the test\\tstring\\nshould print\\tescape \\nsequences\\n\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [53 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [53 x i8], [53 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @escape(i8* %4, i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL)
    err(1, "Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  sleep(1000);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
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
%6 = call i32 @sleep(i32 1000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 1000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void telaAjuda2() { printf("f2"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"f2\00"
define void @telaAjuda2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"f2\00"
define void @telaAjuda2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_04(unsigned int a) { return a <= 0x7FFFFFFF; }


x86 assembly (clang, -O0):
<test_04>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7fffffff,-0x4(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_04>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test_04(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 2147483647
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_04(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
const char *form_field_getstr_default(const char *str, void *arg) {
  return str;
}


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

x86 assembly (clang, -O2):
<form_field_getstr_default>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @form_field_getstr_default(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @form_field_getstr_default(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int /*<<< orphan*/ stdout;
int testLibFunction(int par1, int par2, int par3, int par4) {
  printf("LibFunction called: %d %d %d %d\n", par1, par2, par3, par4);
  fflush(stdout);
  return par1 + par2 + par3 + par4;
}


x86 assembly (clang, -O0):
<testLibFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLibFunction>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    %ebp,%ebx
add    %r15d,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"LibFunction called: %d %d %d %d\0A\00"
@stdout = global i32 0
define i32 @testLibFunction(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %8
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@.str = [33 x i8] c"LibFunction called: %d %d %d %d\0A\00"
@stdout = global i32 0
define i32 @testLibFunction(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = add nsw i32 %1, %0
%9 = add nsw i32 %8, %2
%10 = add nsw i32 %9, %3
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
void fopen_s(FILE **f, const char *fileName, const char *mode) {
  *f = fopen(fileName, mode);
}


x86 assembly (clang, -O0):
<fopen_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_s>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <fopen@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fopen_s(i32** %0, i8* %1, i8* %2) {
%4 = alloca i32**
%5 = alloca i8*
%6 = alloca i8*
store i32** %0, i32*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i32* @fopen(i8* %7, i8* %8)
%10 = load i32**, i32*** %4
store i32* %9, i32** %10
ret void
}

LLVM IR (-O2):
define void @fopen_s(i32** nocapture writeonly %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %1, i8* %2)
store i32* %4, i32** %0
ret void
}
/* Variables and functions */
size_t CHAR_BIT;
int _get_bit(const char *s, size_t s_len, size_t bit_pos) {
  return bit_pos / CHAR_BIT >= s_len
             ? 0
             : s[bit_pos >> 3] & (1 << (7 - (bit_pos & 7)));
}


x86 assembly (clang, -O0):
<_get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2ec5(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
cmp    -0x10(%rbp),%rax
jb     1134 <_get_bit+0x34>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1162 <_get_bit+0x62>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rdx
and    $0x7,%rdx
mov    $0x7,%ecx
sub    %rdx,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_bit>:
mov    %rdx,%rcx
mov    0x2ed6(%rip),%rax
mov    (%rax),%r8
mov    %rdx,%rax
or     %r8,%rax
shr    $0x20,%rax
je     1126 <_get_bit+0x26>
mov    %rcx,%rax
xor    %edx,%edx
div    %r8
mov    %rax,%rdx
jmp    112f <_get_bit+0x2f>
mov    %ecx,%eax
xor    %edx,%edx
div    %r8d
mov    %eax,%edx
xor    %eax,%eax
cmp    %rsi,%rdx
jae    114f <_get_bit+0x4f>
mov    %rcx,%rax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%edx
not    %cl
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i64 0
define i32 @_get_bit(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* @CHAR_BIT
%9 = udiv i64 %7, %8
%10 = load i64, i64* %5
%11 = icmp uge i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %3
br label %26
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i64, i64* %6
%16 = lshr i64 %15, 3
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i64, i64* %6
%21 = and i64 %20, 7
%22 = sub i64 7, %21
%23 = trunc i64 %22 to i32
%24 = shl i32 1, %23
%25 = and i32 %19, %24
br label %26
26: ; preds = %13, %12
%27 = phi i32 [ 0, %12 ], [ %25, %13 ]
ret i32 %27
}

LLVM IR (-O2):
@CHAR_BIT = global i64 0
define i32 @_get_bit(i8* nocapture %0, i64 %1, i64 %2) {
%4 = load i64, i64* @CHAR_BIT
%5 = udiv i64 %2, %4
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = lshr i64 %2, 3
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = trunc i64 %2 to i32
%13 = and i32 %12, 7
%14 = xor i32 %13, 7
%15 = shl nuw i32 1, %14
%16 = and i32 %15, %11
br label %17
17: ; preds = %3, %7
%18 = phi i32 [ %16, %7 ], [ 0, %3 ]
ret i32 %18
}
const char *cApiDeviceModel() {}


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

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

LLVM IR (-O0):
define i8* @cApiDeviceModel() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @cApiDeviceModel() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_set_git_version(char *value) {
  printf("tags: git_version:%s\n", value);
}


x86 assembly (clang, -O0):
<test_set_git_version>:
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):
<test_set_git_version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"tags: git_version:%s\0A\00"
define void @test_set_git_version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void swap(void *i, void *j, size_t size) {
  void *tmp = malloc(size);
  memcpy(tmp, i, size);
  memcpy(i, j, size);
  memcpy(j, tmp, size);
  free(tmp);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i64 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fact, n = 4;
  fact = factorial(n);
  printf("Factorial of n is %d\n", fact);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Factorial of n is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @factorial(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Factorial of n is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gfx_clear_line(int, int);
void status_clear(void) { gfx_clear_line(23, 1); }


x86 assembly (clang, -O0):
<status_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
mov    $0x1,%esi
call   1030 <gfx_clear_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_clear>:
mov    $0x17,%edi
mov    $0x1,%esi
jmp    1030 <gfx_clear_line@plt>

LLVM IR (-O0):
define void @status_clear() {
%1 = call i32 @gfx_clear_line(i32 23, i32 1)
ret void
}

LLVM IR (-O2):
define void @status_clear() {
%1 = tail call i32 @gfx_clear_line(i32 23, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcAbs8(void) { sbc8(readmem65816(absolute())); }


x86 assembly (clang, -O0):
<sbcAbs8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolute@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcAbs8>:
push   %rax
xor    %eax,%eax
call   1040 <absolute@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sbc8@plt>

LLVM IR (-O0):
define void @sbcAbs8() {
%1 = call i32 (...) @absolute()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcAbs8() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
void gtk_tree_view_tree_to_widget_coords() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_tree_to_widget_coords() {
ret void
}
void disable_watch_dog() { (*(volatile unsigned long *)0x53000000) = 0; }


x86 assembly (clang, -O0):
<disable_watch_dog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53000000,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_watch_dog>:
movq   $0x0,0x53000000
ret

LLVM IR (-O0):
define void @disable_watch_dog() {
store volatile i64 0, i64* inttoptr (i64 1392508928 to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_watch_dog() {
store volatile i64 0, i64* inttoptr (i64 1392508928 to i64*)
ret void
}
/* Type definitions */
struct confctl {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ confctl_root(struct confctl *);
int /*<<< orphan*/ cv_write(struct confctl *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int);
void confctl_write(struct confctl *cc, FILE *fp) {
  cv_write(cc, confctl_root(cc), fp, false);
}


x86 assembly (clang, -O0):
<confctl_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <confctl_root@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <cv_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confctl_write>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <confctl_root@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cv_write@plt>

LLVM IR (-O0):
%struct.confctl = type { i32 }
define void @confctl_write(%struct.confctl* %0, i32* %1) {
%3 = alloca %struct.confctl*
%4 = alloca i32*
store %struct.confctl* %0, %struct.confctl** %3
store i32* %1, i32** %4
%5 = load %struct.confctl*, %struct.confctl** %3
%6 = load %struct.confctl*, %struct.confctl** %3
%7 = call i32 @confctl_root(%struct.confctl* %6)
%8 = load i32*, i32** %4
%9 = call i32 @cv_write(%struct.confctl* %5, i32 %7, i32* %8, i32 0)
ret void
}

LLVM IR (-O2):
%struct.confctl = type { i32 }
define void @confctl_write(%struct.confctl* %0, i32* %1) {
%3 = tail call i32 @confctl_root(%struct.confctl* %0)
%4 = tail call i32 @cv_write(%struct.confctl* %0, i32 %3, i32* %1, i32 0)
ret void
}
void MUSIC_SetContext(int context) {}


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

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

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

LLVM IR (-O2):
define void @MUSIC_SetContext(i32 %0) {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t n;
  for (n = 0; s[n]; n++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, void *);
char *argsforperl(void *arg) {
  char *my_arg;
  my_arg = malloc(sizeof(void *) / 4 + 3);
  sprintf(my_arg, "%8p", arg);
  return my_arg;
}


x86 assembly (clang, -O0):
<argsforperl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argsforperl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x5,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec5(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%8p\00"
define i8* @argsforperl(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 5)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%8p\00"
define noalias i8* @argsforperl(i8* %0) {
%2 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void GPIOIntDisable(uint32_t ui32Port, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Port + 0x00000410))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<GPIOIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x410(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x410(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x410(%rcx)
ret

LLVM IR (-O0):
define void @GPIOIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 1040
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIOIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 1040
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Bug:\t%d\n", sizeof("Gish uses" + 1) * 12 + 66);
  printf("No Bug:\t%d\n", sizeof("Gish uses") * 12 + 66);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xedd(%rip),%rdi
mov    $0xa2,%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0xba,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Bug:\09%d\0A\00"
@.str.1 = [12 x i8] c"No Bug:\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 162)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 186)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Bug:\09%d\0A\00"
@.str.1 = [12 x i8] c"No Bug:\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 162)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 186)
ret i32 0
}
/* Type definitions */
struct iax_session {
  int dummy;
};

/* Variables and functions */
int send_command(struct iax_session *, int, int /*<<< orphan*/,
                 int /*<<< orphan*/, unsigned char *, scalar_t__, int);
scalar_t__ strlen(char *);
int iax_send_text(struct iax_session *session, char *text) {
  return send_command(session, 7, 0, 0, (unsigned char *)text, strlen(text) + 1,
                      -1);
}


x86 assembly (clang, -O0):
<iax_send_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%r8
mov    %rax,%r9
add    $0x1,%r9
mov    $0x7,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
movl   $0xffffffff,(%rsp)
call   1040 <send_command@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iax_send_text>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%r9
movl   $0xffffffff,(%rsp)
mov    %r14,%rdi
mov    $0x7,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1040 <send_command@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.iax_session = type { i32 }
define i32 @iax_send_text(%struct.iax_session* %0, i8* %1) {
%3 = alloca %struct.iax_session*
%4 = alloca i8*
store %struct.iax_session* %0, %struct.iax_session** %3
store i8* %1, i8** %4
%5 = load %struct.iax_session*, %struct.iax_session** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @send_command(%struct.iax_session* %5, i32 7, i32 0, i32 0, i8* %6, i64 %9, i32 -1)
ret i32 %10
}

LLVM IR (-O2):
%struct.iax_session = type { i32 }
define i32 @iax_send_text(%struct.iax_session* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @send_command(%struct.iax_session* %0, i32 7, i32 0, i32 0, i8* %1, i64 %4, i32 -1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HelloWorld() { printf("Hello World\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define void @HelloWorld() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define void @HelloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int _sasl_locate_entry(void *library, const char *entryname,
                       void **entry_point) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @_sasl_locate_entry(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 i32 -1
}

LLVM IR (-O2):
define i32 @_sasl_locate_entry(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void usage(char *prog) {
  printf("usage: %s [-c CHANNEL] INPUTFILE\n"
         "       %s [-c CHANNEL] (reads from stdin)\n",
         prog, prog);
}


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

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

LLVM IR (-O0):
@.str = [76 x i8] c"usage: %s [-c CHANNEL] INPUTFILE\0A %s [-c CHANNEL] (reads from stdin)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"usage: %s [-c CHANNEL] INPUTFILE\0A %s [-c CHANNEL] (reads from stdin)\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
int gconfi_() {}


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

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

LLVM IR (-O0):
define i32 @gconfi_() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @gconfi_() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int pthread_detach(int /*<<< orphan*/);
void Pthread_detach(pthread_t th) {
  int retval;
  retval = pthread_detach(th);
  if (retval != 0)
    Sys_failure("pthread_detach");
}


x86 assembly (clang, -O0):
<Pthread_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pthread_detach@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <Pthread_detach+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_detach>:
push   %rax
call   1030 <pthread_detach@plt>
test   %eax,%eax
je     1137 <Pthread_detach+0x17>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <Sys_failure@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"pthread_detach\00"
define void @Pthread_detach(i32 %0) {
%2 = tail call i32 @pthread_detach(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int event_on_off(int on_off) {
  (void)on_off;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @event_on_off(i32 %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ IsLedOutOfBounds(int);
int /*<<< orphan*/ clearLedImageBit(int);
int /*<<< orphan*/ updateHardware();
void LedDriver_TurnOff(int ledNumber) {
  if (IsLedOutOfBounds(ledNumber))
    return;
  clearLedImageBit(ledNumber);
  updateHardware();
}


x86 assembly (clang, -O0):
<LedDriver_TurnOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <IsLedOutOfBounds@plt>
cmp    $0x0,%rax
je     1152 <LedDriver_TurnOff+0x22>
jmp    1161 <LedDriver_TurnOff+0x31>
mov    -0x4(%rbp),%edi
call   1040 <clearLedImageBit@plt>
mov    $0x0,%al
call   1050 <updateHardware@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedDriver_TurnOff>:
push   %rbx
mov    %edi,%ebx
call   1030 <IsLedOutOfBounds@plt>
test   %rax,%rax
je     113f <LedDriver_TurnOff+0xf>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <clearLedImageBit@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <updateHardware@plt>

LLVM IR (-O0):
define void @LedDriver_TurnOff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @IsLedOutOfBounds(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @clearLedImageBit(i32 %8)
%10 = call i32 (...) @updateHardware()
br label %11
11: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @LedDriver_TurnOff(i32 %0) {
%2 = tail call i64 @IsLedOutOfBounds(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @clearLedImageBit(i32 %0)
%6 = tail call i32 (...) @updateHardware()
br label %7
7: ; preds = %1, %4
ret void
}
unsigned char answer_3(unsigned char arg0, int arg1) { return 0; }


x86 assembly (clang, -O0):
<answer_3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @answer_3(i8 zeroext %0, i32 %1) {
ret i8 0
}
unsigned parse_u16(const unsigned char *p) {
  return (unsigned)p[0] << 0 | (unsigned)p[1] << 8;
}


x86 assembly (clang, -O0):
<parse_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parse_u16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 0
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @parse_u16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printPgmString(char *);
void report_init_message() {
  printPgmString("\r\nGrbl "
                 "0.9a"
                 " ['$' for help]\r\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"\0D\0AGrbl 0.9a ['$' for help]\0D\0A\00"
define void @report_init_message() {
%1 = call i32 @printPgmString(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0D\0AGrbl 0.9a ['$' for help]\0D\0A\00"
define void @report_init_message() {
%1 = tail call i32 @printPgmString(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t sigref_cal_to_accumid(int32_t sr, int32_t cal) {
  return (cal | (sr << 1)) ^ 0x3;
}


x86 assembly (clang, -O0):
<sigref_cal_to_accumid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
xor    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigref_cal_to_accumid>:
lea    (%rdi,%rdi,1),%eax
or     %esi,%eax
xor    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @sigref_cal_to_accumid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 %6, 1
%8 = or i32 %5, %7
%9 = xor i32 %8, 3
ret i32 %9
}

LLVM IR (-O2):
define i32 @sigref_cal_to_accumid(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = or i32 %3, %1
%5 = xor i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int main() {
  const char *msg = "Hello world via write()\n";
  write(1, msg, strlen(msg));
  printf("Hello world via printf(), %i\n", 1234);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xea7(%rip),%rdi
mov    $0x4d2,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec3(%rip),%rdi
mov    $0x4d2,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Hello world via write()\0A\00"
@.str.1 = [30 x i8] c"Hello world via printf(), %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 1234)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Hello world via write()\0A\00"
@.str.1 = [30 x i8] c"Hello world via printf(), %i\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 1234)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int writeTo(int fd, char *string) { return write(fd, string, strlen(string)); }


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

x86 assembly (clang, -O2):
<writeTo>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @writeTo(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
int test_imm_AEint8_mem(signed char *val) {
  return ((*val) & (-0xAE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AEint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff52,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AEint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -174
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int adis16080_probe_trigger(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @adis16080_probe_trigger(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
int test_csneg32_condasn1(int w0, int w1, int w2, int w3) {
  int w4;
  w4 = (w0 == w1) ? -w3 : w2;
  return w4;
}


x86 assembly (clang, -O0):
<test_csneg32_condasn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1129 <test_csneg32_condasn1+0x29>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    112f <test_csneg32_condasn1+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csneg32_condasn1>:
mov    %ecx,%eax
neg    %eax
cmp    %esi,%edi
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_csneg32_condasn1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = sub nsw i32 0, %3
%7 = select i1 %5, i32 %6, i32 %2
ret i32 %7
}
/* Variables and functions */
_Bool wrap(_Bool);
_Bool bar(_Bool f) { return wrap(f); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <wrap@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <wrap@plt>

LLVM IR (-O0):
define zeroext i1 @bar(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = call zeroext i1 @wrap(i1 zeroext %5)
ret i1 %6
}

LLVM IR (-O2):
define zeroext i1 @bar(i1 zeroext %0) {
%2 = tail call zeroext i1 @wrap(i1 zeroext %0)
ret i1 %2
}