xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test3u(unsigned int x) { return x - (unsigned int)INT_MIN; }


x86 assembly (clang, -O0):
<test3u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test3u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @INT_MIN
%5 = trunc i64 %4 to i32
%6 = sub i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test3u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = sub i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ callee2(int, char *);
void callee1(int intarg, char *strarg, double fltarg) {
  callee2(intarg, strarg);
}


x86 assembly (clang, -O0):
<callee1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <callee2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee1>:
jmp    1030 <callee2@plt>

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

LLVM IR (-O2):
define void @callee1(i32 %0, i8* %1, double %2) {
%4 = tail call i32 @callee2(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inverseArray(int *, int);
int /*<<< orphan*/ quickSort_Internal(int *, int /*<<< orphan*/, int);
void quickSort(int *array, int n, bool isOrderASC) {
  quickSort_Internal(array, 0, n - 1);
  if (!isOrderASC) {
    inverseArray(array, n);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <quickSort_Internal@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1159 <quickSort+0x39>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <inverseArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x1(%r14),%edx
xor    %esi,%esi
call   1040 <quickSort_Internal@plt>
test   %ebp,%ebp
je     1140 <quickSort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <inverseArray@plt>

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @quickSort_Internal(i32* %0, i32 0, i32 %4)
%6 = icmp eq i32 %2, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @inverseArray(i32* %0, i32 %1)
br label %9
9: ; preds = %7, %3
ret void
}
int test_imm_E3uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xE3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E3uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 227
%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_E3uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 227
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int b(int);
int a(int n) { return b(n + 1); }


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

x86 assembly (clang, -O2):
<a>:
add    $0x1,%edi
jmp    1030 <b@plt>

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

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @b(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_37() {
  Assert_real((isqrt(37) == 6),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              190, ("Integer square root of 37 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_37>:
push   %rbp
mov    %rsp,%rbp
mov    $0x25,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xbe,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_37>:
push   %rax
mov    $0x25,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xbe,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 37 should be 6\00"
define void @t_sqrt_37() {
%1 = call i32 @isqrt(i32 37)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 37 should be 6\00"
define void @t_sqrt_37() {
%1 = tail call i32 @isqrt(i32 37)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_metadata_array_count() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_metadata_array_count>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_count() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_count() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t swapHalfWord(uint64_t word64) {
  uint64_t temp64 = 0;
  temp64 = word64 & 0x00000000ffffffff;
  temp64 = temp64 << 32;
  word64 = word64 >> 32;
  word64 = word64 | temp64;
  return word64;
}


x86 assembly (clang, -O0):
<swapHalfWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swapHalfWord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, -1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = ashr i32 %8, 32
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = or i32 %10, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @swapHalfWord(i32 %0) {
ret i32 poison
}
char *hFillDigits(char *buf, int digits, int totdigs, int cnt) {
  if (digits > 0) {
    digits -= totdigs - cnt;
    while (digits > 0) {
      *buf++ = '0';
      --digits;
    }
  }
  return buf;
}


x86 assembly (clang, -O0):
<hFillDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1158 <hFillDigits+0x58>
mov    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1153 <hFillDigits+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x30,(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <hFillDigits+0x29>
jmp    1158 <hFillDigits+0x58>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hFillDigits>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1145 <hFillDigits+0x35>
mov    %edx,%ebx
mov    %esi,%eax
sub    %edx,%eax
add    %ecx,%eax
test   %eax,%eax
jle    1145 <hFillDigits+0x35>
add    %esi,%ecx
not    %ebx
add    %ecx,%ebx
lea    0x1(%rbx),%rdx
mov    %r14,%rdi
mov    $0x30,%esi
call   1030 <memset@plt>
add    %rbx,%r14
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @hFillDigits(i8* writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = sub i32 %1, %2
%8 = add i32 %7, %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = add i32 %3, %1
%12 = xor i32 %2, -1
%13 = add i32 %11, %12
%14 = zext i32 %13 to i64
%15 = add nuw nsw i64 %14, 1
%16 = getelementptr i8, i8* %0, i64 %15
br label %17
17: ; preds = %10, %6, %4
%18 = phi i8* [ %0, %4 ], [ %0, %6 ], [ %16, %10 ]
ret i8* %18
}
/* Variables and functions */
float factln(int);
float bicoln(int n, int k) { return factln(n) - factln(k) - factln(n - k); }


x86 assembly (clang, -O0):
<bicoln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factln@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factln@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factln@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bicoln>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factln@plt>
movss  %xmm0,0x4(%rsp)
mov    %ebx,%edi
call   1030 <factln@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factln@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @bicoln(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call float @factln(i32 %5)
%7 = load i32, i32* %4
%8 = call float @factln(i32 %7)
%9 = fsub float %6, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call float @factln(i32 %12)
%14 = fsub float %9, %13
ret float %14
}

LLVM IR (-O2):
define float @bicoln(i32 %0, i32 %1) {
%3 = tail call float @factln(i32 %0)
%4 = tail call float @factln(i32 %1)
%5 = fsub float %3, %4
%6 = sub nsw i32 %0, %1
%7 = tail call float @factln(i32 %6)
%8 = fsub float %5, %7
ret float %8
}
/* Type definitions */
struct shmid_ds {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, struct shmid_ds *);
int shmctl(int id, int cmd, struct shmid_ds *buf) {
  return syscall(308, id, cmd | 0x100, buf);
}


x86 assembly (clang, -O0):
<shmctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
or     $0x100,%edx
mov    -0x10(%rbp),%rcx
mov    $0x134,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmctl>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
or     $0x100,%edx
mov    $0x134,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.shmid_ds*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.shmid_ds* %2, %struct.shmid_ds** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = or i32 %8, 256
%10 = load %struct.shmid_ds*, %struct.shmid_ds** %6
%11 = call i32 @syscall(i32 308, i32 %7, i32 %9, %struct.shmid_ds* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = or i32 %1, 256
%5 = tail call i32 @syscall(i32 308, i32 %0, i32 %4, %struct.shmid_ds* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *strtok_r(char *, char *, char **);
void ureq_remove_parameters(char *b, const char *u) {
  char *bk;
  strcpy(b, u);
  b = strtok_r(b, "?", &bk);
}


x86 assembly (clang, -O0):
<ureq_remove_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <strtok_r@plt>
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ureq_remove_parameters>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xecc(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <strtok_r@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define void @ureq_remove_parameters(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i8* @strtok_r(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5)
store i8* %10, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define void @ureq_remove_parameters(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i32 @strcpy(i8* %0, i8* %1)
%6 = call i8* @strtok_r(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3)
ret void
}
char *to_func(char *s, int size, int (*func)(int)) {
  char *p = s;
  for (; size > 0; p++, size--)
    *p = func(*p);
  return s;
}


x86 assembly (clang, -O0):
<to_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1154 <to_func+0x54>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <to_func+0x1b>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1134 <to_func+0x34>
mov    %rdx,%r15
mov    %esi,%ebp
add    $0x1,%ebp
mov    %r14,%rbx
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   *%r15
mov    %al,(%rbx)
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <to_func+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @to_func(i8* returned %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %5
%6 = phi i8* [ %12, %5 ], [ %0, %3 ]
%7 = phi i32 [ %13, %5 ], [ %1, %3 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = tail call i32 %2(i32 %9)
%11 = trunc i32 %10 to i8
store i8 %11, i8* %6
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = add nsw i32 %7, -1
%14 = icmp ugt i32 %7, 1
br i1 %14, label %5, label %15
15: ; preds = %5, %3
ret i8* %0
}
int VbExTrustEC(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @VbExTrustEC() {
ret i32 1
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_end(int);
void write_one_meg_end(void) {
  ssize_t n;
  init_test();
  n = log_write_end(1048576);
  basic_test(n == 1048576);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_meg_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x100000,%edi
call   1030 <log_write_end@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x100000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_meg_end>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x100000,%edi
call   1030 <log_write_end@plt>
xor    %edi,%edi
cmp    $0x100000,%eax
sete   %dil
call   1040 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_meg_end() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_end(i32 1048576)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1048576
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_meg_end() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_end(i32 1048576)
%3 = icmp eq i32 %2, 1048576
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello World");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
indreg0adrx1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (((short *)11111111)[x1]); }


x86 assembly (clang, -O0):
<indreg0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,2),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrx1_set>:
movslq %ecx,%rax
movzwl 0xa98ac7(%rax,%rax,1),%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @indreg0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = load i16*, i16** %12
store i16 %19, i16* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @indreg0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %7
%9 = load i16, i16* %8
store i16 %9, i16* %4
ret i32 undef
}
int outside(int value, int lower_bound, int upper_bound) {
  return value < lower_bound || value > upper_bound;
}


x86 assembly (clang, -O0):
<outside>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <outside+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<outside>:
cmp    %esi,%edi
setl   %al
cmp    %edx,%edi
setg   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @outside(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __bitmap_or(unsigned long *, unsigned long const *,
                               unsigned long const *, int);
void bitmap_or(unsigned long *dst, const unsigned long *src1,
               const unsigned long *src2, int nbits) {
  if (nbits <= ((int)sizeof(unsigned long) * 8))
    *dst = *src1 | *src2;
  else
    __bitmap_or(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jg     114b <bitmap_or+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    115f <bitmap_or+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__bitmap_or@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_or>:
cmp    $0x40,%ecx
jg     111f <bitmap_or+0xf>
mov    (%rdx),%rax
or     (%rsi),%rax
mov    %rax,(%rdi)
ret
jmp    1030 <__bitmap_or@plt>

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

LLVM IR (-O2):
define void @bitmap_or(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = icmp slt i32 %3, 65
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = or i64 %8, %7
store i64 %9, i64* %0
br label %12
10: ; preds = %4
%11 = tail call i32 @__bitmap_or(i64* %0, i64* %1, i64* %2, i32 %3)
br label %12
12: ; preds = %10, %6
ret void
}
block_assemble(instructions, nr, first, last) char **instructions;
int nr, first, last;
{
  int i;
  for (i = 0; i < nr; i++)
    assemble(instructions[i]);
}


x86 assembly (clang, -O0):
<block_assemble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <block_assemble+0x49>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <assemble@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112c <block_assemble+0x1c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @block_assemble(i8** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assemble to i32 (i8*, ...)*)(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t return_uint32_1() { return 1073741824; }


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

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

LLVM IR (-O0):
define i32 @return_uint32_1() {
ret i32 1073741824
}

LLVM IR (-O2):
define i32 @return_uint32_1() {
ret i32 1073741824
}
void g_mem_chunk_reset() {}


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

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

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

LLVM IR (-O2):
define void @g_mem_chunk_reset() {
ret void
}
int rtw_netif_queue_stopped(void *pnetdev) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rtw_netif_queue_stopped(i8* nocapture readnone %0) {
ret i32 0
}
int lower(int c) { return ((c >= 'A' && c <= 'Z') ? (c = c + 'a' - 'A') : c); }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112f <lower+0x2f>
cmpl   $0x5a,-0x4(%rbp)
jg     112f <lower+0x2f>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1135 <lower+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 97
%11 = sub nsw i32 %10, 65
store i32 %11, i32* %2
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int f_work(long long int *sz_arg, long long int *sz_res, long long int *sz_iw,
           long long int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 1;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 3;
  return 0;
}


x86 assembly (clang, -O0):
<f_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112a <f_work+0x2a>
mov    -0x8(%rbp),%rax
movq   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     1140 <f_work+0x40>
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1156 <f_work+0x56>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     116c <f_work+0x6c>
mov    -0x20(%rbp),%rax
movq   $0x3,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_work>:
test   %rdi,%rdi
je     110c <f_work+0xc>
movq   $0x2,(%rdi)
test   %rsi,%rsi
je     1118 <f_work+0x18>
movq   $0x1,(%rsi)
test   %rdx,%rdx
je     1124 <f_work+0x24>
movq   $0x0,(%rdx)
test   %rcx,%rcx
je     1130 <f_work+0x30>
movq   $0x3,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f_work(i64* writeonly %0, i64* writeonly %1, i64* writeonly %2, i64* writeonly %3) {
%5 = icmp eq i64* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 2, i64* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i64* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i64 1, i64* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i64* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i64 0, i64* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i64* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i64 3, i64* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int O_NDELAY;
int O_NOCTTY;
int O_RDWR;
int open(char *, int);
int get_serial_link_fd() {
  return open("/dev/ttyAMA0", O_RDWR | O_NOCTTY | O_NDELAY);
}


x86 assembly (clang, -O0):
<get_serial_link_fd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    0x2ea3(%rip),%rax
or     (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_serial_link_fd>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
lea    0xece(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/ttyAMA0\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
define i32 @get_serial_link_fd() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %1, %2
%4 = load i32, i32* @O_NDELAY
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/ttyAMA0\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
define i32 @get_serial_link_fd() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %2, %1
%4 = load i32, i32* @O_NDELAY
%5 = or i32 %3, %4
%6 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_alloca();
int /*<<< orphan*/ test_cmovcc();
int /*<<< orphan*/ test_swap(int, int);
int main() {
  test_swap(16 * 1024, 16 * 1024);
  test_swap(32 * 1024, 24 * 1024);
  test_alloca();
  test_cmovcc();
  printf("all done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4000,%esi
mov    %esi,%edi
call   1030 <test_swap@plt>
mov    $0x8000,%edi
mov    $0x6000,%esi
call   1030 <test_swap@plt>
mov    $0x0,%al
call   1060 <test_alloca@plt>
mov    $0x0,%al
call   1050 <test_cmovcc@plt>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4000,%edi
mov    $0x4000,%esi
call   1040 <test_swap@plt>
mov    $0x8000,%edi
mov    $0x6000,%esi
call   1040 <test_swap@plt>
xor    %eax,%eax
call   1060 <test_alloca@plt>
xor    %eax,%eax
call   1050 <test_cmovcc@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"all done\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test_swap(i32 16384, i32 16384)
%3 = call i32 @test_swap(i32 32768, i32 24576)
%4 = call i32 (...) @test_alloca()
%5 = call i32 (...) @test_cmovcc()
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"all done\00"
define i32 @main() {
%1 = tail call i32 @test_swap(i32 16384, i32 16384)
%2 = tail call i32 @test_swap(i32 32768, i32 24576)
%3 = tail call i32 (...) @test_alloca()
%4 = tail call i32 (...) @test_cmovcc()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void c_pomp_critical_enter_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_critical_enter_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void mailto_html(char *g) { printf("<A HREF=\"mailto:%s\">%s</A>", g, g); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"<A HREF=\22mailto:%s\22>%s</A>\00"
define void @mailto_html(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"<A HREF=\22mailto:%s\22>%s</A>\00"
define void @mailto_html(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
int sanitize_input(const char *input, unsigned int input_len) {
  unsigned int i = 0;
  while (i < input_len && input[i] != ';' && input[i] != '=')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<sanitize_input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jae    1150 <sanitize_input+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x3b,%ecx
mov    %al,-0x11(%rbp)
je     1150 <sanitize_input+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1160 <sanitize_input+0x60>
jmp    116e <sanitize_input+0x6e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <sanitize_input+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_input>:
test   %esi,%esi
je     112a <sanitize_input+0x2a>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%edx
cmp    $0x3b,%dl
je     1129 <sanitize_input+0x29>
cmp    $0x3d,%dl
je     1129 <sanitize_input+0x29>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <sanitize_input+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sanitize_input(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %10
%7 = phi i64 [ 0, %4 ], [ %11, %10 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 59, label %13
i8 61, label %13
]
10: ; preds = %6
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %15, label %6
13: ; preds = %6, %6
%14 = trunc i64 %7 to i32
br label %15
15: ; preds = %10, %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ], [ %1, %10 ]
ret i32 %16
}
/* Type definitions */
struct msqid_ds {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ IPC_STAT;
int msgctl(int, int /*<<< orphan*/, struct msqid_ds *);
int remove_queue(int qid) {
  int ret = -1;
  struct msqid_ds ds;
  if (msgctl(qid, IPC_STAT, &ds) != -1) {
    ret = msgctl(qid, IPC_RMID, &ds);
  }
  return ret;
}


x86 assembly (clang, -O0):
<remove_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <msgctl@plt>
cmp    $0xffffffff,%eax
je     1158 <remove_queue+0x48>
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <msgctl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_queue>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <msgctl@plt>
cmp    $0xffffffff,%eax
je     1146 <remove_queue+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <msgctl@plt>
jmp    114b <remove_queue+0x3b>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.msqid_ds = type { i32 }
@IPC_STAT = global i32 0
@IPC_RMID = global i32 0
define i32 @remove_queue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.msqid_ds
store i32 %0, i32* %2
store i32 -1, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* @IPC_STAT
%7 = call i32 @msgctl(i32 %5, i32 %6, %struct.msqid_ds* %4)
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @IPC_RMID
%12 = call i32 @msgctl(i32 %10, i32 %11, %struct.msqid_ds* %4)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.msqid_ds = type { i32 }
@IPC_STAT = global i32 0
@IPC_RMID = global i32 0
define i32 @remove_queue(i32 %0) {
%2 = alloca %struct.msqid_ds
%3 = bitcast %struct.msqid_ds* %2 to i8*
%4 = load i32, i32* @IPC_STAT
%5 = call i32 @msgctl(i32 %0, i32 %4, %struct.msqid_ds* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @IPC_RMID
%9 = call i32 @msgctl(i32 %0, i32 %8, %struct.msqid_ds* %2)
br label %10
10: ; preds = %7, %1
%11 = phi i32 [ %9, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ICPrintOffset();
int main(int argc, const char *argv[]) {
  ICPrintOffset();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ICPrintOffset@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ICPrintOffset()
ret i32 0
}
int conn_commit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @conn_commit() {
ret i32 0
}