xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ CheckMask(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ exit(int);
void HandleUSR2(int sig) {
  if (!CheckMask(SIGUSR1, SIGUSR2, 0))
    exit(1);
}


x86 assembly (clang, -O0):
<HandleUSR2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <CheckMask@plt>
cmp    $0x0,%eax
jne    1157 <HandleUSR2+0x37>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleUSR2>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <CheckMask@plt>
test   %eax,%eax
je     1140 <HandleUSR2+0x20>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
define void @HandleUSR2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGUSR1
%4 = load i32, i32* @SIGUSR2
%5 = call i32 @CheckMask(i32 %3, i32 %4, i32 0)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
define void @HandleUSR2(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = load i32, i32* @SIGUSR2
%4 = tail call i32 @CheckMask(i32 %2, i32 %3, i32 0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *syscfg_get_EXTICR3() {
  return mem_get_reg32(0x40010000 + 0x10);
}


x86 assembly (clang, -O0):
<syscfg_get_EXTICR3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010010,%edi
call   1030 <mem_get_reg32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscfg_get_EXTICR3>:
mov    $0x40010010,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @syscfg_get_EXTICR3() {
%1 = call i32* @mem_get_reg32(i32 1073807376)
ret i32* %1
}

LLVM IR (-O2):
define i32* @syscfg_get_EXTICR3() {
%1 = tail call i32* @mem_get_reg32(i32 1073807376)
ret i32* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ insert_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int a[] = {1, 9, 0, 2, 8, 3, 7, 3, 5, 6, 4};
  int n = sizeof(a) / sizeof(int);
  print(a, n);
  insert_sort(a, n);
  print(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movl   $0xb,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <insert_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xef0(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <print@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <insert_sort@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [11 x i32] [i32 1, i32 9, i32 0, i32 2, i32 8, i32 3, i32 7, i32 3, i32 5, i32 6, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [11 x i32]* %2 to i8*
store i32 11, i32* %3
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @print(i32* %5, i32 %6)
%8 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @insert_sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @print(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [11 x i32] [i32 1, i32 9, i32 0, i32 2, i32 8, i32 3, i32 7, i32 3, i32 5, i32 6, i32 4]
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @print(i32* %3, i32 11)
%5 = call i32 @insert_sort(i32* %3, i32 11)
%6 = call i32 @print(i32* %3, i32 11)
ret i32 0
}
/* Type definitions */
struct mntent {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct mntent *getmntent(FILE *fp) {
  ;
  errno = ENOSYS;
  return NULL;
  ;
}


x86 assembly (clang, -O0):
<getmntent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mntent = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.mntent* @getmntent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.mntent* null
}

LLVM IR (-O2):
%struct.mntent = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.mntent* @getmntent(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.mntent* null
}
/* Variables and functions */
int f(int);
main() {
  0 ?: f(1);
  return f(3);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1)
%3 = call i32 @f(i32 3)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xfa() {
  Assert_real((islower(250) == 0),
              "/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/ctype/test_islower.c",
              1255, ("islower should be 0 for 0xfa"));
}


x86 assembly (clang, -O0):
<t_islower_0xfa>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfa,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4e7,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xfa>:
push   %rax
mov    $0xfa,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4e7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xfa\00"
define void @t_islower_0xfa() {
%1 = call i64 @islower(i32 250)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1255, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xfa\00"
define void @t_islower_0xfa() {
%1 = tail call i64 @islower(i32 250)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1255, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ find(void const *, void const *);
int contains(const void *_set, const void *_element) {
  return find(_set, _element) != 0;
}


x86 assembly (clang, -O0):
<contains>:
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 <find@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @contains(i8* %0, i8* %1) {
%3 = tail call i64 @find(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
scalar_t__ drm_alloc_resource(struct drm_device *, unsigned int);
unsigned long drm_get_resource_start(struct drm_device *dev,
                                     unsigned int resource) {
  if (drm_alloc_resource(dev, resource) != 0)
    return 0;
}


x86 assembly (clang, -O0):
<drm_get_resource_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <drm_alloc_resource@plt>
cmp    $0x0,%rax
je     113d <drm_get_resource_start+0x2d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define i64 @drm_get_resource_start(%struct.drm_device* %0, i32 %1) {
%3 = alloca i64
%4 = alloca %struct.drm_device*
%5 = alloca i32
store %struct.drm_device* %0, %struct.drm_device** %4
store i32 %1, i32* %5
%6 = load %struct.drm_device*, %struct.drm_device** %4
%7 = load i32, i32* %5
%8 = call i64 @drm_alloc_resource(%struct.drm_device* %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i64 0, i64* %3
br label %11
11: ; preds = %10, %2
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define i64 @drm_get_resource_start(%struct.drm_device* %0, i32 %1) {
%3 = tail call i64 @drm_alloc_resource(%struct.drm_device* %0, i32 %1)
ret i64 0
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int mi_get_size_1_svc(int, void *, struct svc_req *);
int _mi_get_size_1(int *argp, void *result, struct svc_req *rqstp) {
  return (mi_get_size_1_svc(*argp, result, rqstp));
}


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

x86 assembly (clang, -O2):
<_mi_get_size_1>:
mov    (%rdi),%edi
jmp    1030 <mi_get_size_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_mi_get_size_1(i32* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i32* %0, i32** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = load %struct.svc_req*, %struct.svc_req** %6
%11 = call i32 @mi_get_size_1_svc(i32 %8, i8* %9, %struct.svc_req* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_mi_get_size_1(i32* nocapture %0, i8* %1, %struct.svc_req* %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @mi_get_size_1_svc(i32 %4, i8* %1, %struct.svc_req* %2)
ret i32 %5
}
/* Variables and functions */
int gcd(int, unsigned int);
int phi(unsigned int n) {
  unsigned int result = 1;
  for (int i = 2; i < n; i++)
    if (gcd(i, n) == 1)
      result++;
  return result;
}


x86 assembly (clang, -O0):
<phi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1165 <phi+0x55>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <gcd@plt>
cmp    $0x1,%eax
jne    1152 <phi+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <phi+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <phi+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
cmp    $0x3,%edi
jb     114c <phi+0x3c>
mov    %edi,%r14d
mov    $0x1,%ebp
mov    $0x2,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <gcd@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1130 <phi+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @phi(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi i32 [ 1, %1 ], [ %11, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ 2, %1 ]
%7 = phi i32 [ %11, %5 ], [ 1, %1 ]
%8 = tail call i32 @gcd(i32 %6, i32 %0)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = add i32 %7, %10
%12 = add nuw i32 %6, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %3, label %5
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ padding(int);
void vt52ed(void) {
  esc("J");
  padding(5);
}


x86 assembly (clang, -O0):
<vt52ed>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52ed>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"J\00"
define void @vt52ed() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @padding(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"J\00"
define void @vt52ed() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @padding(i32 5)
ret void
}
void ScaleARGBFilterCols_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBFilterCols_C() {
ret void
}
short smin(short a, short b) { return (short)(((a) < (b)) ? (a) : (b)); }


x86 assembly (clang, -O0):
<smin>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    112e <smin+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <smin+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @smin(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
void fd198(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    p025A:
      goto p025A;
      goto a;
    a:
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd198>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd198+0x7>

x86 assembly (clang, -O2):
<fd198>:
jmp    1100 <fd198>

LLVM IR (-O0):
define void @fd198(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; No predecessors!
br label %37
37: ; preds = %37, %36
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd198(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ generate_mix();
int /*<<< orphan*/ generate_tables();
int /*<<< orphan*/ print_tables();
int main() {
  generate_mix();
  generate_tables();
  print_tables();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <generate_mix@plt>
mov    $0x0,%al
call   1050 <generate_tables@plt>
mov    $0x0,%al
call   1040 <print_tables@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @generate_mix()
%3 = call i32 (...) @generate_tables()
%4 = call i32 (...) @print_tables()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @generate_mix()
%2 = tail call i32 (...) @generate_tables()
%3 = tail call i32 (...) @print_tables()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *safe_malloc(size_t size) {
  void *p;
  if ((p = malloc(size)) == NULL) {
    fprintf(stderr, "Out of memory, failed to allocate %zd bytes\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1176 <safe_malloc+0x46>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <safe_malloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Out of memory, failed to allocate %zd bytes\0A\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i64, i64* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Out of memory, failed to allocate %zd bytes\0A\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int main() {
  int n;
  int p = 0, q = 1, r = n, h;
  while (q <= n)
    q *= 4;
  while (q != 1) {
    n = n;
    q = q / 4;
    h = p + q;
    p = p / 2;
    if (r >= h) {
      p = p + q;
      r = r - h;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1139 <main+0x39>
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    111f <main+0x1f>
jmp    113e <main+0x3e>
cmpl   $0x1,-0x10(%rbp)
je     1196 <main+0x96>
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     1191 <main+0x91>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x3e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %4
%7 = load i32, i32* %2
store i32 %7, i32* %5
br label %8
8: ; preds = %12, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 4
store i32 %14, i32* %4
br label %8
15: ; preds = %8
br label %16
16: ; preds = %38, %15
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 1
br i1 %18, label %19, label %39
19: ; preds = %16
%20 = load i32, i32* %2
store i32 %20, i32* %2
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 4
store i32 %22, i32* %4
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
store i32 %25, i32* %6
%26 = load i32, i32* %3
%27 = sdiv i32 %26, 2
store i32 %27, i32* %3
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = icmp sge i32 %28, %29
br i1 %30, label %31, label %38
31: ; preds = %19
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = add nsw i32 %32, %33
store i32 %34, i32* %3
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = sub nsw i32 %35, %36
store i32 %37, i32* %5
br label %38
38: ; preds = %31, %19
br label %16
39: ; preds = %16
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
int test_imm_59uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x59 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_59uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 89
%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_59uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 89
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void myFree(void **p) {
  free(*p);
  *p = NULL;
}


x86 assembly (clang, -O0):
<myFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @myFree(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @myFree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
int fun1258() { return 1258; }


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

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

LLVM IR (-O0):
define i32 @fun1258() {
ret i32 1258
}

LLVM IR (-O2):
define i32 @fun1258() {
ret i32 1258
}
/* Type definitions */
struct _reent {
  int dummy;
};
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t _sbrk_r(struct _reent *r, int incr) {
  (void)r;
  (void)incr;
  return 0;
}


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

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

LLVM IR (-O0):
%struct._reent = type { i32 }
define i32 @_sbrk_r(%struct._reent* %0, i32 %1) {
%3 = alloca %struct._reent*
%4 = alloca i32
store %struct._reent* %0, %struct._reent** %3
store i32 %1, i32* %4
%5 = load %struct._reent*, %struct._reent** %3
%6 = load i32, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_sbrk_r(%struct._reent* nocapture readnone %0, i32 %1) {
ret i32 0
}
void g_array_set_size() {}


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

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

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

LLVM IR (-O2):
define void @g_array_set_size() {
ret void
}
void EC_GROUP_get_pentanomial_basis(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_pentanomial_basis() {
ret void
}
/* Type definitions */
struct slist {
  int dummy;
};

/* Variables and functions */
struct slist *slist_remove_custom(struct slist *, void *, int /*<<< orphan*/ *);
__attribute__((visibility("default"))) struct slist *
slist_remove(struct slist *list, void *data) {
  return slist_remove_custom(list, data, NULL);
}


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

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

LLVM IR (-O0):
%struct.slist = type { i32 }
define %struct.slist* @slist_remove(%struct.slist* %0, i8* %1) {
%3 = alloca %struct.slist*
%4 = alloca i8*
store %struct.slist* %0, %struct.slist** %3
store i8* %1, i8** %4
%5 = load %struct.slist*, %struct.slist** %3
%6 = load i8*, i8** %4
%7 = call %struct.slist* @slist_remove_custom(%struct.slist* %5, i8* %6, i32* null)
ret %struct.slist* %7
}

LLVM IR (-O2):
%struct.slist = type { i32 }
define %struct.slist* @slist_remove(%struct.slist* %0, i8* %1) {
%3 = tail call %struct.slist* @slist_remove_custom(%struct.slist* %0, i8* %1, i32* null)
ret %struct.slist* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t dps_reg(uint32_t address) { return (address & 0xffff) >> 2; }


x86 assembly (clang, -O0):
<dps_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dps_reg>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x3fff,%eax
ret

LLVM IR (-O0):
define i32 @dps_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @dps_reg(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 16383
ret i32 %3
}
int test_imm_2Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x2D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -45
%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_2Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -45
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void init_global_cfg() {}


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

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

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

LLVM IR (-O2):
define void @init_global_cfg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_usage(int);
int /*<<< orphan*/ printf(char *, char const *);
void exit_msg_usage(const char *msg, int exit_code) {
  printf("\n%s\n\n", msg);
  print_usage(exit_code);
}


x86 assembly (clang, -O0):
<exit_msg_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <print_usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_msg_usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <print_usage@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\0A%s\0A\0A\00"
define void @exit_msg_usage(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 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @print_usage(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s\0A\0A\00"
define void @exit_msg_usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @print_usage(i32 %1)
ret void
}
char *bd_version() { return "1.0.0"; }


x86 assembly (clang, -O0):
<bd_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bd_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.0.0\00"
define i8* @bd_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.0.0\00"
define i8* @bd_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t ffi_reinterpret_int64_t(void *result) { return (int64_t)result; }


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

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

LLVM IR (-O0):
define i32 @ffi_reinterpret_int64_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @ffi_reinterpret_int64_t(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printBinaryRepresentations(int);
int main() {
  printBinaryRepresentations(10);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <printBinaryRepresentations@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <printBinaryRepresentations@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printBinaryRepresentations(i32 10)
%2 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printBinaryRepresentations(i32 10)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void *strip(char *string) {
  char *lstring = lstrip(string);
  char *finalString = rstrip(lstring);
  return finalString;
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <lstrip@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <rstrip@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
push   %rax
xor    %eax,%eax
call   1040 <lstrip@plt>
movslq %eax,%rdi
xor    %eax,%eax
call   1030 <rstrip@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @strip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @lstrip to i32 (i8*, ...)*)(i8* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @rstrip to i32 (i8*, ...)*)(i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @strip(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @lstrip to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @rstrip to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pi;
typedef int /*<<< orphan*/ pd;
typedef int /*<<< orphan*/ pc;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *pi = 0;
  char *pc = 0;
  double *pd = 0;
  printf("sizeof(pi) = %lu\n", sizeof(pi));
  printf("sizeof(pc) = %lu\n", sizeof(pc));
  printf("sizeof(pd) = %lu\n", sizeof(pd));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"sizeof(pi) = %lu\0A\00"
@.str.1 = [18 x i8] c"sizeof(pc) = %lu\0A\00"
@.str.2 = [18 x i8] c"sizeof(pd) = %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca double*
store i32 0, i32* %1
store i32* null, i32** %2
store i8* null, i8** %3
store double* null, double** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 8)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"sizeof(pi) = %lu\0A\00"
@.str.1 = [18 x i8] c"sizeof(pc) = %lu\0A\00"
@.str.2 = [18 x i8] c"sizeof(pd) = %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
int ff_get_fourcc(char *s) {
  assert(strlen(s) == 4);
  return (s[0]) + (s[1] << 8) + (s[2] << 16) + (s[3] << 24);
}


x86 assembly (clang, -O0):
<ff_get_fourcc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_get_fourcc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x4,%rax
sete   %dil
xor    %eax,%eax
call   1040 <assert@plt>
movsbl (%rbx),%eax
movsbl 0x1(%rbx),%ecx
shl    $0x8,%ecx
add    %eax,%ecx
movsbl 0x2(%rbx),%edx
shl    $0x10,%edx
add    %ecx,%edx
movzbl 0x3(%rbx),%eax
shl    $0x18,%eax
add    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ff_get_fourcc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = icmp eq i64 %4, 4
%6 = zext i1 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %6)
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = add nsw i32 %11, %16
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = shl i32 %21, 16
%23 = add nsw i32 %17, %22
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = shl i32 %27, 24
%29 = add nsw i32 %23, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @ff_get_fourcc(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 4
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %4)
%6 = load i8, i8* %0
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl nsw i32 %10, 8
%12 = add nsw i32 %11, %7
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = shl nsw i32 %15, 16
%17 = add nsw i32 %12, %16
%18 = getelementptr inbounds i8, i8* %0, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl nuw i32 %20, 24
%22 = add nsw i32 %17, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ serial_put_char(char);
void serial_put_str(char *str) {
  while (*str) {
    serial_put_char(*str);
    str++;
  }
  serial_put_char('\r');
  serial_put_char('\n');
}


x86 assembly (clang, -O0):
<serial_put_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <serial_put_str+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <serial_put_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <serial_put_str+0xc>
mov    $0xd,%edi
call   1030 <serial_put_char@plt>
mov    $0xa,%edi
call   1030 <serial_put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_put_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <serial_put_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <serial_put_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <serial_put_str+0x10>
mov    $0xd,%edi
call   1030 <serial_put_char@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <serial_put_char@plt>

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

LLVM IR (-O2):
define void @serial_put_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @serial_put_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @serial_put_char(i8 signext 13)
%13 = tail call i32 @serial_put_char(i8 signext 10)
ret void
}
__attribute__((always_)) int __attribute__((pure)) long_log2(unsigned long x) {
  int r = 0;
  for (x >>= 1; x > 0; x >>= 1)
    r++;
  return r;
}


x86 assembly (clang, -O0):
<long_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1140 <long_log2+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <long_log2+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_log2>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     111f <long_log2+0x1f>
xor    %eax,%eax
mov    %rdi,%rcx
nopl   (%rax)
shr    %rcx
add    $0x1,%eax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <long_log2+0x10>
ret

LLVM IR (-O0):
define i32 @long_log2(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
%4 = load i64, i64* %2
%5 = lshr i64 %4, 1
store i64 %5, i64* %2
br label %6
6: ; preds = %12, %1
%7 = load i64, i64* %2
%8 = icmp ugt i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %12
12: ; preds = %9
%13 = load i64, i64* %2
%14 = lshr i64 %13, 1
store i64 %14, i64* %2
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @long_log2(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}