xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strrev(char *);
int main() {
  char *s = malloc(10000000);
  scanf("%s", s);
  printf("%s", s);
  strrev(s);
  printf("%s", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x989680,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <strrev@plt>
mov    -0x8(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x989680,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xea8(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1060 <strrev@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10000000)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @strrev(i8* %7)
%9 = load i8*, i8** %1
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(10000000) i8* @malloc(i32 10000000)
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @strrev(i8* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
void verify_and_zero(int *int_field, long len) {
  ulong total = 0L;
  for (long i = 0; i < len; i++) {
    total += int_field[i];
    int_field[i] = 0;
  }
}


x86 assembly (clang, -O0):
<verify_and_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    115a <verify_and_zero+0x5a>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111b <verify_and_zero+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_and_zero>:
test   %rsi,%rsi
jle    1128 <verify_and_zero+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @verify_and_zero(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = shl nuw i64 %1, 2
br label %7
7: ; preds = %4, %2
ret void
}
void DBGFR3AddrAdd(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *realloc(int /*<<< orphan*/ *, size_t);
void a(uint8_t **po, size_t t) { *po = realloc(*po, t); }


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

x86 assembly (clang, -O2):
<a>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @a(i32** nocapture %0, i64 %1) {
%3 = load i32*, i32** %0
%4 = tail call i32* @realloc(i32* %3, i64 %1)
store i32* %4, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_clock();
void arch_init() {
  init_clock();
  return;
}


x86 assembly (clang, -O0):
<arch_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_clock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_init>:
xor    %eax,%eax
jmp    1030 <init_clock@plt>

LLVM IR (-O0):
define void @arch_init() {
%1 = call i32 (...) @init_clock()
ret void
}

LLVM IR (-O2):
define void @arch_init() {
%1 = tail call i32 (...) @init_clock()
ret void
}
void fun1(int fd) {
  int i = 1;
  printf("sup: %s, local var at %p\n", __func__, &i);
  fun2(fd);
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xec7(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <fun2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
lea    0xeca(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <fun2@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"sup: %s, local var at %p\0A\00"
@__func__.fun1 = [5 x i8] c"fun1\00"
define void @fun1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.fun1, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"sup: %s, local var at %p\0A\00"
@__func__.fun1 = [5 x i8] c"fun1\00"
define void @fun1(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.fun1, i64 0, i64 0), i32* %2)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32, ...)*)(i32 %0)
ret void
}
void tosMemory_pokeShort(int base, int offs, short value) {
  *((short *)(base + offs)) = value;
}


x86 assembly (clang, -O0):
<tosMemory_pokeShort>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMemory_pokeShort>:
movslq %esi,%rax
movslq %edi,%rcx
mov    %dx,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @tosMemory_pokeShort(i32 %0, i32 %1, i16 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i16*
store i16 %7, i16* %12
ret void
}

LLVM IR (-O2):
define void @tosMemory_pokeShort(i32 %0, i32 %1, i16 signext %2) {
%4 = add nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
store i16 %2, i16* %6
ret void
}
int test_imm_11int64_highword_reg(long long val) {
  return ((val >> 32) & (0x11 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_11int64_highword_reg(i64 %0) {
%2 = and i64 %0, 73014444032
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
int get_XGravityEvent_x(void *_p) { return (int)((XGravityEvent *)_p)->x; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGravityEvent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGravityEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct zint_symbol {
  int dummy;
};

/* Variables and functions */
int upce_cc(struct zint_symbol *, unsigned char *, int, char *,
            int /*<<< orphan*/);
int upce(struct zint_symbol *symbol, unsigned char source[], int length,
         char dest[]) {
  return upce_cc(symbol, source, length, dest, 0);
}


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

x86 assembly (clang, -O2):
<upce>:
xor    %r8d,%r8d
jmp    1030 <upce_cc@plt>

LLVM IR (-O0):
%struct.zint_symbol = type { i32 }
define i32 @upce(%struct.zint_symbol* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca %struct.zint_symbol*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store %struct.zint_symbol* %0, %struct.zint_symbol** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @upce_cc(%struct.zint_symbol* %9, i8* %10, i32 %11, i8* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.zint_symbol = type { i32 }
define i32 @upce(%struct.zint_symbol* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @upce_cc(%struct.zint_symbol* %0, i8* %1, i32 %2, i8* %3, i32 0)
ret i32 %5
}
unsigned hashatom(const void *key) { return (unsigned long)key >> 2; }


x86 assembly (clang, -O0):
<hashatom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashatom>:
mov    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @hashatom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = lshr i64 %4, 2
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hashatom(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct Datastruct {
  int dummy;
};
struct Comstruct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ retcont(struct Datastruct *, struct Comstruct *,
                           int /*<<< orphan*/);
void retloop(struct Datastruct *ds, struct Comstruct *cs) {
  retcont(ds, cs, 0);
  return;
}


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

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

LLVM IR (-O0):
%struct.Datastruct = type { i32 }
%struct.Comstruct = type { i32 }
define void @retloop(%struct.Datastruct* %0, %struct.Comstruct* %1) {
%3 = alloca %struct.Datastruct*
%4 = alloca %struct.Comstruct*
store %struct.Datastruct* %0, %struct.Datastruct** %3
store %struct.Comstruct* %1, %struct.Comstruct** %4
%5 = load %struct.Datastruct*, %struct.Datastruct** %3
%6 = load %struct.Comstruct*, %struct.Comstruct** %4
%7 = call i32 @retcont(%struct.Datastruct* %5, %struct.Comstruct* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.Datastruct = type { i32 }
%struct.Comstruct = type { i32 }
define void @retloop(%struct.Datastruct* %0, %struct.Comstruct* %1) {
%3 = tail call i32 @retcont(%struct.Datastruct* %0, %struct.Comstruct* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error_mess(const char *str) { fprintf(stderr, "%s\n", str); }


x86 assembly (clang, -O0):
<error_mess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_mess>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error_mess(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ xbob(int);
void basXBob() {
  int n;
  n = popNumber();
  pushNumber(xbob(n));
}


x86 assembly (clang, -O0):
<basXBob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xbob@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basXBob>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <xbob@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basXBob() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @xbob(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basXBob() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @xbob(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error_cds(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char msg[512];
  char in[512];
  strcpy(msg, argv[1]);
  strcpy(in, argv[2]);
  print_error_cds(msg, in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1040 <print_error_cds@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0x200(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <print_error_cds@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %8, i8* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %13, i8* %16)
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%20 = call i32 @print_error_cds(i8* %18, i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %5, i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %6, i8* %11)
%13 = call i32 @print_error_cds(i8* %5, i8* %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ cbrtf(float);
int /*<<< orphan*/ link_failure_cbrtf();
void test_cbrtf(float f) {
  if (cbrtf(f) != cbrtf(f))
    link_failure_cbrtf();
}


x86 assembly (clang, -O0):
<test_cbrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cbrtf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cbrtf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_cbrtf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_cbrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cbrtf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <cbrtf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <cbrtf@plt>
cmp    %rax,%rbx
jne    1149 <test_cbrtf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_cbrtf@plt>

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

LLVM IR (-O2):
define void @test_cbrtf(float %0) {
%2 = tail call i64 @cbrtf(float %0)
%3 = tail call i64 @cbrtf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cbrtf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t __strlen(const char *s) {
  if ((NULL == (s))) {
    return 0;
  }
  uint32_t result = 0;
  while (*s++ != '\0') {
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<__strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1121 <__strlen+0x21>
movq   $0x0,-0x8(%rbp)
jmp    115d <__strlen+0x5d>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <__strlen+0x55>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1129 <__strlen+0x29>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strlen>:
test   %rdi,%rdi
je     111f <__strlen+0x1f>
cmpb   $0x0,(%rdi)
je     111f <__strlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <__strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @__strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add nuw nsw i64 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i64 %14
}
void adler32(void) {}


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

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

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

LLVM IR (-O2):
define void @adler32() {
ret void
}
/* Variables and functions */
bool is_palindrome(unsigned long long num) {
  int digit;
  unsigned long long n = num;
  unsigned long long reverse = 0;
  while (n > 0) {
    digit = (int)(n % 10);
    reverse = reverse * 10 + digit;
    n /= 10;
  }
  return num == reverse;
}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    115d <is_palindrome+0x5d>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
jmp    1118 <is_palindrome+0x18>
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1149 <is_palindrome+0x49>
movabs $0xcccccccccccccccd,%r8
cc cc cc
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rcx,%rcx,4),%r9
mov    %rsi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rsi,%rcx
sub    %rax,%rcx
lea    (%rcx,%r9,2),%rcx
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1120 <is_palindrome+0x20>
xor    %eax,%eax
cmp    %rdi,%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_palindrome(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = urem i64 %5, 10
%7 = mul i64 %4, 10
%8 = add i64 %7, %6
%9 = udiv i64 %5, 10
%10 = icmp ult i64 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %8, %3 ]
%13 = icmp eq i64 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
void testTortureExecute(void) {
  short i;
  for (i = 6; i >= 0; i--)
    foo((void *)(long)i);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x6,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     1146 <testTortureExecute+0x36>
movswq -0x2(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
jmp    111e <testTortureExecute+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
push   %rax
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i16
store i16 6, i16* %1
br label %2
2: ; preds = %11, %0
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i16, i16* %1
%8 = sext i16 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = call i32 @foo(i8* %9)
br label %11
11: ; preds = %6
%12 = load i16, i16* %1
%13 = add i16 %12, -1
store i16 %13, i16* %1
br label %2
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @foo(i8* inttoptr (i64 6 to i8*))
%2 = tail call i32 @foo(i8* inttoptr (i64 5 to i8*))
%3 = tail call i32 @foo(i8* inttoptr (i64 4 to i8*))
%4 = tail call i32 @foo(i8* inttoptr (i64 3 to i8*))
%5 = tail call i32 @foo(i8* inttoptr (i64 2 to i8*))
%6 = tail call i32 @foo(i8* inttoptr (i64 1 to i8*))
%7 = tail call i32 @foo(i8* null)
ret void
}
/* Variables and functions */
scalar_t__ coco_allocate_memory(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *coco_strdup(const char *string) {
  size_t len;
  char *duplicate;
  if (string == NULL)
    return NULL;
  len = strlen(string);
  duplicate = (char *)coco_allocate_memory(len + 1);
  memcpy(duplicate, string, len + 1);
  return duplicate;
}


x86 assembly (clang, -O0):
<coco_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <coco_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118f <coco_strdup+0x5f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <coco_allocate_memory@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coco_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1161 <coco_strdup+0x31>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1040 <coco_allocate_memory@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
jmp    1164 <coco_strdup+0x34>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @coco_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %22
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i64 @coco_allocate_memory(i64 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = add i64 %18, 1
%20 = call i32 @memcpy(i8* %16, i8* %17, i64 %19)
%21 = load i8*, i8** %5
store i8* %21, i8** %2
br label %22
22: ; preds = %9, %8
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @coco_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i64 @coco_allocate_memory(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %5)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ stdout;
void WriteDec_Real(unsigned int x) {
  printf("%u", x);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<WriteDec_Real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDec_Real>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@stdout = global i32 0
define void @WriteDec_Real(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
void PushUndefinedArgumentSyntaxMapping(void) {}


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

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

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

LLVM IR (-O2):
define void @PushUndefinedArgumentSyntaxMapping() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_001();
int /*<<< orphan*/ test_002();
int /*<<< orphan*/ test_003();
int /*<<< orphan*/ test_004();
void test_main(void) {
  test_001();
  test_002();
  test_003();
  test_004();
}


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_001@plt>
mov    $0x0,%al
call   1050 <test_002@plt>
mov    $0x0,%al
call   1040 <test_003@plt>
mov    $0x0,%al
call   1060 <test_004@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
push   %rax
xor    %eax,%eax
call   1030 <test_001@plt>
xor    %eax,%eax
call   1050 <test_002@plt>
xor    %eax,%eax
call   1040 <test_003@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_004@plt>

LLVM IR (-O0):
define void @test_main() {
%1 = call i32 (...) @test_001()
%2 = call i32 (...) @test_002()
%3 = call i32 (...) @test_003()
%4 = call i32 (...) @test_004()
ret void
}

LLVM IR (-O2):
define void @test_main() {
%1 = tail call i32 (...) @test_001()
%2 = tail call i32 (...) @test_002()
%3 = tail call i32 (...) @test_003()
%4 = tail call i32 (...) @test_004()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int phLineSetBusy(int vlid, int busyFlag) {
  char reqbuf[64];
  snprintf(reqbuf, sizeof(reqbuf), "SETBUSY VLID=%d F=%d", vlid, busyFlag);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phLineSetBusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x40,%esi
lea    0xebb(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phLineSetBusy>:
push   %rbx
sub    $0x40,%rsp
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"SETBUSY VLID=%d F=%d\00"
define i32 @phLineSetBusy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"SETBUSY VLID=%d F=%d\00"
define i32 @phLineSetBusy(i32 %0, i32 %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
int test_and_change_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("btc %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit), "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_change_bit>:
btc    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btc $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_and_change_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btc $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcstol(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                          int);
int /*<<< orphan*/ wcstoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                           int);
int /*<<< orphan*/ wcstoul(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                           int);
int /*<<< orphan*/ wcstoull(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                            int);
void uninivar_wcstol(void) {
  const wchar_t *s;
  wchar_t **endp;
  int base;
  (void)wcstol(s, endp, base);
  (void)wcstoll(s, endp, base);
  (void)wcstoul(s, endp, base);
  (void)wcstoull(s, endp, base);
}


x86 assembly (clang, -O0):
<uninivar_wcstol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <wcstol@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <wcstoll@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <wcstoul@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1060 <wcstoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_wcstol>:
push   %rax
call   1030 <wcstol@plt>
call   1040 <wcstoll@plt>
call   1050 <wcstoul@plt>
pop    %rax
jmp    1060 <wcstoull@plt>

LLVM IR (-O0):
define void @uninivar_wcstol() {
%1 = alloca i32*
%2 = alloca i32**
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i32**, i32*** %2
%6 = load i32, i32* %3
%7 = call i32 @wcstol(i32* %4, i32** %5, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32**, i32*** %2
%10 = load i32, i32* %3
%11 = call i32 @wcstoll(i32* %8, i32** %9, i32 %10)
%12 = load i32*, i32** %1
%13 = load i32**, i32*** %2
%14 = load i32, i32* %3
%15 = call i32 @wcstoul(i32* %12, i32** %13, i32 %14)
%16 = load i32*, i32** %1
%17 = load i32**, i32*** %2
%18 = load i32, i32* %3
%19 = call i32 @wcstoull(i32* %16, i32** %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcstol() {
%1 = tail call i32 @wcstol(i32* undef, i32** undef, i32 undef)
%2 = tail call i32 @wcstoll(i32* undef, i32** undef, i32 undef)
%3 = tail call i32 @wcstoul(i32* undef, i32** undef, i32 undef)
%4 = tail call i32 @wcstoull(i32* undef, i32** undef, i32 undef)
ret void
}
void foo145(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo145(i32 %0) {
ret void
}
void LowerStr(char *str) {
  while (str) {
    if (*str >= 'A' && *str <= 'Z')
      *str += 'a' - 'A';
    str++;
  }
}


x86 assembly (clang, -O0):
<LowerStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <LowerStr+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     113f <LowerStr+0x3f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     113f <LowerStr+0x3f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <LowerStr+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowerStr>:
test   %rdi,%rdi
jne    1114 <LowerStr+0x14>
ret
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rdi
movzbl (%rdi),%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <LowerStr+0x10>
add    $0x20,%al
mov    %al,(%rdi)
jmp    1110 <LowerStr+0x10>

LLVM IR (-O0):
define void @LowerStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %22, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %25
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add nsw i32 %19, 32
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
br label %22
22: ; preds = %16, %11, %6
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %2
br label %3
25: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @LowerStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %10
%4 = phi i8* [ %11, %10 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 26
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = add nuw nsw i8 %5, 32
store i8 %9, i8* %4
br label %10
10: ; preds = %8, %3
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %1
ret void
}
void close_shared(ptr) struct so_lib_list *ptr;
{}


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

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

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

LLVM IR (-O2):
%struct.so_lib_list = type opaque
define void @close_shared(%struct.so_lib_list* nocapture %0) {
ret void
}
/* Variables and functions */
int anetUnixGenericConnect(char *, char *, int /*<<< orphan*/);
int anetUnixConnect(char *err, char *path) {
  return anetUnixGenericConnect(err, path, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @anetUnixConnect(i8* %0, i8* %1) {
%3 = tail call i32 @anetUnixGenericConnect(i8* %0, i8* %1, i32 0)
ret i32 %3
}
int comlen(char *p, char *q) {
  int len = 0;
  for (; *p && *p == *q; p++, q++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<comlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     113e <comlen+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114e <comlen+0x4e>
jmp    1174 <comlen+0x74>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <comlen+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comlen>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <comlen+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1122 <comlen+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <comlen+0x10>
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @dup(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ osThreadYield();
void Thread(void *argument) {
  while (1) {
    ;
    osThreadYield();
  }
}


x86 assembly (clang, -O0):
<Thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <osThreadYield@plt>
jmp    111c <Thread+0xc>

x86 assembly (clang, -O2):
<Thread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <osThreadYield@plt>
jmp    1120 <Thread+0x10>

LLVM IR (-O0):
define void @Thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @osThreadYield()
br label %3
}

LLVM IR (-O2):
define void @Thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @osThreadYield()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
void term_clrtoeol(void) { clrtoeol(); }


x86 assembly (clang, -O0):
<term_clrtoeol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clrtoeol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_clrtoeol>:
xor    %eax,%eax
jmp    1030 <clrtoeol@plt>

LLVM IR (-O0):
define void @term_clrtoeol() {
%1 = call i32 (...) @clrtoeol()
ret void
}

LLVM IR (-O2):
define void @term_clrtoeol() {
%1 = tail call i32 (...) @clrtoeol()
ret void
}
unsigned int RTP_get_extension_type(unsigned char *p) {
  return (((unsigned int)p[12]) << 8) + (unsigned int)p[13];
}


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

x86 assembly (clang, -O2):
<RTP_get_extension_type>:
movzwl 0xc(%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @RTP_get_extension_type(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 13
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}