xunge/DecIR huggingface dataset:
int fz_darken_byte(int bd, int s) { return ((bd) < (s) ? (bd) : (s)); }


x86 assembly (clang, -O0):
<fz_darken_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <fz_darken_byte+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <fz_darken_byte+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_darken_byte>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fz_darken_byte(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "Text to stdout.\n");
  fprintf(stderr, "Text to stderr.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"Text to stdout.\0A\00"
@stderr = global i32 0
@.str.1 = [17 x i8] c"Text to stderr.\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"Text to stdout.\0A\00"
@stderr = global i32 0
@.str.1 = [17 x i8] c"Text to stderr.\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int os_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_init() {
ret i32 0
}
void XListPixmapFormats() {}


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

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

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

LLVM IR (-O2):
define void @XListPixmapFormats() {
ret void
}
/* Variables and functions */
int ackermann(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int m = 3;
  int n = 4;
  printf("ackermann(%d, %d) = %d\n", m, n, ackermann(m, n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"ackermann(%d, %d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @ackermann(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32 4, i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
float **vectorAverageNewWindow() {
  return (float **)calloc(30, sizeof(float *));
}


x86 assembly (clang, -O0):
<vectorAverageNewWindow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorAverageNewWindow>:
mov    $0x1e,%edi
mov    $0x8,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define float** @vectorAverageNewWindow() {
%1 = call i64 @calloc(i32 30, i32 8)
%2 = inttoptr i64 %1 to float**
ret float** %2
}

LLVM IR (-O2):
define float** @vectorAverageNewWindow() {
%1 = tail call i64 @calloc(i32 30, i32 8)
%2 = inttoptr i64 %1 to float**
ret float** %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
Fcr() { putchar('\n'); }


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

x86 assembly (clang, -O2):
<Fcr>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @Fcr() {
%1 = alloca i32
%2 = call i32 @putchar(i8 signext 10)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Fcr() {
%1 = tail call i32 @putchar(i8 signext 10)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ print_ipaddr_len(int /*<<< orphan*/ const *, int);
void print_ipaddr(const uint8_t *addr) { print_ipaddr_len(addr, 16); }


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

x86 assembly (clang, -O2):
<print_ipaddr>:
mov    $0x10,%esi
jmp    1030 <print_ipaddr_len@plt>

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

LLVM IR (-O2):
define void @print_ipaddr(i32* %0) {
%2 = tail call i32 @print_ipaddr_len(i32* %0, i32 16)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int test_bit_u32(int nr, const uint32_t *addr) {
  return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
}


x86 assembly (clang, -O0):
<test_bit_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
sar    $0x5,%edx
movslq %edx,%rdx
and    (%rcx,%rdx,8),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit_u32>:
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%ecx
xor    %eax,%eax
bt     %edi,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @test_bit_u32(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 = and i32 %5, 31
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = and i64 %8, %14
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_bit_u32(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = and i64 %9, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int sscanf(char *, char *, long *, long *);
int scan_caia_version(char *attr_str, long *majorp, long *minorp) {
  return sscanf(attr_str, "%ld.%ld", majorp, minorp);
}


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

x86 assembly (clang, -O2):
<scan_caia_version>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%ld.%ld\00"
define i32 @scan_caia_version(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 i8*, i8** %4
%8 = load i64*, i64** %5
%9 = load i64*, i64** %6
%10 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %8, i64* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"%ld.%ld\00"
define i32 @scan_caia_version(i8* nocapture %0, i64* %1, i64* %2) {
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
ret i32 %4
}
/* Variables and functions */
int xbp_chmod(char const *, int);
int __wrap_chmod(const char *filename, int pmode) {
  return xbp_chmod(filename, pmode);
}


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

x86 assembly (clang, -O2):
<__wrap_chmod>:
jmp    1030 <xbp_chmod@plt>

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

LLVM IR (-O2):
define i32 @__wrap_chmod(i8* %0, i32 %1) {
%3 = tail call i32 @xbp_chmod(i8* %0, i32 %1)
ret i32 %3
}
int test_imm_36int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x36 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_36int64_highword_mem>:
testb  $0x36,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_36int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 54
%7 = icmp ne i64 %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_36int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 231928233984
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  double rate = 1.08;
  double value = 0.1;
  int i;
  for (i = 0; i < 128; ++i) {
    printf("%d, ", (int)value);
    value *= rate;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x80,-0x24(%rbp)
jge    1182 <main+0x72>
cvttsd2si -0x20(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1147 <main+0x37>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movsd  0xee5(%rip),%xmm0
mov    $0x80,%ebp
lea    0xee9(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
mulsd  0xeba(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d, \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.080000e+00, double* %6
store double 1.000000e-01, double* %7
store i32 0, i32* %8
br label %9
9: ; preds = %19, %2
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 128
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load double, double* %7
%14 = fptosi double %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fmul double %17, %16
store double %18, double* %7
br label %19
19: ; preds = %12
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %9
22: ; preds = %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %9, %3 ]
%5 = phi double [ 1.000000e-01, %2 ], [ %8, %3 ]
%6 = fptosi double %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = fmul double %5, 1.080000e+00
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 128
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}
void VP8DspInitSSE41(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8DspInitSSE41() {
ret void
}
char **cdio_get_devices_linux(void) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8** @cdio_get_devices_linux() {
ret i8** null
}

LLVM IR (-O2):
define noalias i8** @cdio_get_devices_linux() {
ret i8** null
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfflag_endflag();
void fgmvwrite_surfflag_endflag_() { gmvwrite_surfflag_endflag(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_surfflag_endflag_() {
%1 = tail call i32 (...) @gmvwrite_surfflag_endflag()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void vApplicationMallocFailedHook(void) {
  printf("failed malloc\n");
  assert(0);
}


x86 assembly (clang, -O0):
<vApplicationMallocFailedHook>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vApplicationMallocFailedHook>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"failed malloc\0A\00"
define void @vApplicationMallocFailedHook() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"failed malloc\00"
define void @vApplicationMallocFailedHook() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned disableFIQ(void) {
  unsigned _cpsr;
  _cpsr = __get_cpsr();
  __set_cpsr(_cpsr | 0x00000040);
  return _cpsr;
}


x86 assembly (clang, -O0):
<disableFIQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x40,%edi
call   1030 <__set_cpsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disableFIQ>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebx
mov    %eax,%edi
or     $0x40,%edi
call   1030 <__set_cpsr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @disableFIQ() {
%1 = alloca i32
%2 = call i32 (...) @__get_cpsr()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 64
%5 = call i32 @__set_cpsr(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @disableFIQ() {
%1 = tail call i32 (...) @__get_cpsr()
%2 = or i32 %1, 64
%3 = tail call i32 @__set_cpsr(i32 %2)
ret i32 %1
}
void dealloc2d_i(int **buf, int n) {
  int i;
  for (i = 0; i < n; i++) {
    free(buf[i]);
  }
  free(buf);
}


x86 assembly (clang, -O0):
<dealloc2d_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <dealloc2d_i+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dealloc2d_i+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealloc2d_i>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <dealloc2d_i+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dealloc2d_i+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dealloc2d_i(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_vw_printw(int, char **);
void cmd_vwprintw(int nargs, char **args) { cmd_vw_printw(nargs, args); }


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

x86 assembly (clang, -O2):
<cmd_vwprintw>:
jmp    1030 <cmd_vw_printw@plt>

LLVM IR (-O0):
define void @cmd_vwprintw(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 = call i32 @cmd_vw_printw(i32 %5, i8** %6)
ret void
}

LLVM IR (-O2):
define void @cmd_vwprintw(i32 %0, i8** %1) {
%3 = tail call i32 @cmd_vw_printw(i32 %0, i8** %1)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rrbp(void) {
  uint64_t val;
  __asm volatile("movq %%rbp,%0" : "=r"(val));
  return val;
}


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

x86 assembly (clang, -O2):
<rrbp>:
mov    %rbp,%rax
ret

LLVM IR (-O0):
define i8* @rrbp() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "movq %rbp,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rrbp() {
%1 = tail call i8* asm sideeffect "movq %rbp,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
int ehEquivalencia() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ehEquivalencia() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void uninitvar_assert(void) {
  int i;
  assert(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_assert>:
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @uninitvar_assert() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @assert(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_assert() {
%1 = tail call i32 @assert(i32 undef)
ret void
}
int test_imm_F4int8_mem(signed char *val) {
  return ((*val) & (0xF4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F4int8_mem>:
testb  $0xf4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F4int8_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, 244
%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_F4int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -12
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_77uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x77 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_77uint64_midword_mem>:
testb  $0x77,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_77uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 119
%7 = icmp ne i64 %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_77uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7798784
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arm_int(int, int);
void arm_bkpt() { arm_int(0x0c, 0b10111); }


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

x86 assembly (clang, -O2):
<arm_bkpt>:
mov    $0xc,%edi
mov    $0x17,%esi
jmp    1030 <arm_int@plt>

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

LLVM IR (-O2):
define void @arm_bkpt() {
%1 = tail call i32 @arm_int(i32 12, i32 23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2() { printf("hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_zi_numeric(long *, long *, double *, double *,
                                      void *, void **, double *, double *);
void umf4znum_(long Ap[], long Ai[], double Ax[], double Az[], void **Symbolic,
               void **Numeric, double Control[20], double Info[90]) {
  (void)umfpack_zi_numeric(Ap, Ai, Ax, Az, *Symbolic, Numeric, Control, Info);
}


x86 assembly (clang, -O0):
<umf4znum_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <umfpack_zi_numeric@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4znum_>:
mov    (%r8),%r8
jmp    1030 <umfpack_zi_numeric@plt>

LLVM IR (-O0):
define void @umf4znum_(i64* %0, i64* %1, double* %2, double* %3, i8** %4, i8** %5, double* %6, double* %7) {
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i8**
%14 = alloca i8**
%15 = alloca double*
%16 = alloca double*
store i64* %0, i64** %9
store i64* %1, i64** %10
store double* %2, double** %11
store double* %3, double** %12
store i8** %4, i8*** %13
store i8** %5, i8*** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load i64*, i64** %9
%18 = load i64*, i64** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load i8**, i8*** %13
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %14
%24 = load double*, double** %15
%25 = load double*, double** %16
%26 = call i32 @umfpack_zi_numeric(i64* %17, i64* %18, double* %19, double* %20, i8* %22, i8** %23, double* %24, double* %25)
ret void
}

LLVM IR (-O2):
define void @umf4znum_(i64* %0, i64* %1, double* %2, double* %3, i8** nocapture %4, i8** %5, double* %6, double* %7) {
%9 = load i8*, i8** %4
%10 = tail call i32 @umfpack_zi_numeric(i64* %0, i64* %1, double* %2, double* %3, i8* %9, i8** %5, double* %6, double* %7)
ret void
}
int test_imm_B8uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xB8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B8uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 184
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int status) {
  fprintf(stderr, "Usage:\n"
                  "  makerom [OPTIONS] romboot.img core.img output\n\n"
                  "Options:\n"
                  "  -v\t\t\tShow verbose information\n"
                  "  -m message\t\tBoot message\n"
                  "  -t timeout\t\tTimeout in seconds\n"
                  "  -k key\t\tHotkey\n"
                  "  -d edx\t\tValue of edx\n"
                  "  -s skip\t\tNumber of bytes to skip (default 512)\n"
                  "  -z\t\t\tUse lzma to compress input file\n"
                  "  -p parm\t\tExtra parameter for lzma\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [322 x i8] c"Usage:\0A makerom [OPTIONS] romboot.img core.img output\0A\0AOptions:\0A -v\09\09\09Show verbose information\0A -m message\09\09Boot message\0A -t timeout\09\09Timeout in seconds\0A -k key\09\09Hotkey\0A -d edx\09\09Value of edx\0A -s skip\09\09Number of bytes to skip (default 512)\0A -z\09\09\09Use lzma to compress input file\0A -p parm\09\09Extra parameter for lzma\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([322 x i8], [322 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [322 x i8] c"Usage:\0A makerom [OPTIONS] romboot.img core.img output\0A\0AOptions:\0A -v\09\09\09Show verbose information\0A -m message\09\09Boot message\0A -t timeout\09\09Timeout in seconds\0A -k key\09\09Hotkey\0A -d edx\09\09Value of edx\0A -s skip\09\09Number of bytes to skip (default 512)\0A -z\09\09\09Use lzma to compress input file\0A -p parm\09\09Extra parameter for lzma\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([322 x i8], [322 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_get_property_string(void *bus, const char *destination, const char *path,
                           const char *interface, const char *member,
                           void *ret_error, char **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_get_property_string>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
mov    0x2eb7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_get_property_string>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_get_property_string(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8** %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8**
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8** %6, i8*** %14
%15 = load i32, i32* @EINVAL
%16 = sub nsw i32 0, %15
ret i32 %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_property_string(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8** nocapture readnone %6) {
%8 = load i32, i32* @EINVAL
%9 = sub nsw i32 0, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ OSTimeTick();
int /*<<< orphan*/ intc_clearvectaddr();
void Timer0_ISR(void) {
  unsigned long *p;
  unsigned long addr;
  (*((volatile unsigned long *)((0xE2500000) + 0x44))) |= (1 << 5);
  intc_clearvectaddr();
  OSTimeTick();
}


x86 assembly (clang, -O0):
<Timer0_ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe2500044,%eax
mov    (%rax),%rcx
or     $0x20,%rcx
mov    $0xe2500044,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <intc_clearvectaddr@plt>
mov    $0x0,%al
call   1030 <OSTimeTick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer0_ISR>:
push   %rax
mov    $0xe2500044,%eax
orq    $0x20,(%rax)
xor    %eax,%eax
call   1040 <intc_clearvectaddr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <OSTimeTick@plt>

LLVM IR (-O0):
define void @Timer0_ISR() {
%1 = alloca i64*
%2 = alloca i64
%3 = load volatile i64, i64* inttoptr (i64 3796893764 to i64*)
%4 = or i64 %3, 32
store volatile i64 %4, i64* inttoptr (i64 3796893764 to i64*)
%5 = call i32 (...) @intc_clearvectaddr()
%6 = call i32 (...) @OSTimeTick()
ret void
}

LLVM IR (-O2):
define void @Timer0_ISR() {
%1 = load volatile i64, i64* inttoptr (i64 3796893764 to i64*)
%2 = or i64 %1, 32
store volatile i64 %2, i64* inttoptr (i64 3796893764 to i64*)
%3 = tail call i32 (...) @intc_clearvectaddr()
%4 = tail call i32 (...) @OSTimeTick()
ret void
}
/* Variables and functions */
int abs(int);
int gcd(int a, int b) {
  int c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return abs(a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1143 <gcd+0x33>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    111e <gcd+0xe>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
jmp    111f <gcd+0x1f>
mov    %eax,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
ret i32 %11
}
/* Type definitions */
struct gps_data_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  struct gps_data_t *gps_data = NULL;
  printf("starting test program\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gps_data_t = type { i32 }
@.str = [23 x i8] c"starting test program\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.gps_data_t*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.gps_data_t* null, %struct.gps_data_t** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.gps_data_t = type { i32 }
@str = [22 x i8] c"starting test program\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(void const *, void const *);
int str_eq(const void *s1, const void *s2) { return strcmp(s1, s2) == 0; }


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

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

LLVM IR (-O0):
define i32 @str_eq(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @str_eq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void helper6() {}


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

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

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

LLVM IR (-O2):
define void @helper6() {
ret void
}
/* Variables and functions */
int bit_turnoff_rightmost_bit(int);
int bit_clear_lsb(int n) { return bit_turnoff_rightmost_bit(n); }


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

x86 assembly (clang, -O2):
<bit_clear_lsb>:
jmp    1030 <bit_turnoff_rightmost_bit@plt>

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

LLVM IR (-O2):
define i32 @bit_clear_lsb(i32 %0) {
%2 = tail call i32 @bit_turnoff_rightmost_bit(i32 %0)
ret i32 %2
}
int xmlUCSIsMongolian(int code) {
  return (((code >= 0x1800) && (code <= 0x18AF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMongolian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMongolian+0x26>
cmpl   $0x18af,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsMongolian>:
add    $0xffffe800,%edi
xor    %eax,%eax
cmp    $0xb0,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsMongolian(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 6144
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 6319
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsMongolian(i32 %0) {
%2 = add i32 %0, -6144
%3 = icmp ult i32 %2, 176
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setuid(uid_t uid) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<setuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setuid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setuid(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or "
         "MBEDTLS_X509_CRL_PARSE_C and/or MBEDTLS_FS_IO not defined.\n");
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [105 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or MBEDTLS_X509_CRL_PARSE_C and/or MBEDTLS_FS_IO not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [104 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or MBEDTLS_X509_CRL_PARSE_C and/or MBEDTLS_FS_IO not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int createQueryURL(char const *, int, char const *, char *, int, char const **,
                   char const **, char **);
int createUrlForMKDIR(const char *host, int nnPort, const char *path,
                      const char *user, char **url) {
  const char *userPara = "user.name";
  return createQueryURL(host, nnPort, path, "MKDIRS", 1, &userPara, &user, url);
}


x86 assembly (clang, -O0):
<createUrlForMKDIR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
lea    0xebe(%rip),%rcx
mov    $0x1,%r8d
lea    -0x30(%rbp),%r9
lea    -0x20(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <createQueryURL@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createUrlForMKDIR>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %rcx,0x10(%rsp)
lea    0xedd(%rip),%rcx
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%r10
lea    0xed6(%rip),%rcx
lea    0x8(%rsp),%r9
mov    $0x1,%r8d
push   %rax
push   %r10
call   1030 <createQueryURL@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"user.name\00"
@.str.1 = [7 x i8] c"MKDIRS\00"
define i32 @createUrlForMKDIR(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8** %4, i8*** %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %11
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8**, i8*** %10
%16 = call i32 @createQueryURL(i8* %12, i32 %13, i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %11, i8** %9, i8** %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"user.name\00"
@.str.1 = [7 x i8] c"MKDIRS\00"
define i32 @createUrlForMKDIR(i8* %0, i32 %1, i8* %2, i8* %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i8*
store i8* %3, i8** %6
%8 = bitcast i8** %7 to i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = call i32 @createQueryURL(i8* %0, i32 %1, i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %7, i8** %6, i8** %4)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[1024];
  memset(str, 68, 10);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x44,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0x410(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x44,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 68, i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
void *ebbrt_newlib_calloc(size_t, size_t);
void *calloc(size_t num, size_t size) { return ebbrt_newlib_calloc(num, size); }


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

x86 assembly (clang, -O2):
<calloc>:
jmp    1030 <ebbrt_newlib_calloc@plt>

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = tail call i8* @ebbrt_newlib_calloc(i64 %0, i64 %1)
ret i8* %3
}