xunge/DecIR huggingface dataset:
int strncasecmp(char *p1, char *p2, long p3) { return 0; }


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

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

LLVM IR (-O0):
define i32 @strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @strncasecmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double rand();
double generate() { return (1.0 * rand()) / RAND_MAX; }


x86 assembly (clang, -O0):
<generate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2eb7(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @generate() {
%1 = call double (...) @rand()
%2 = fmul double 1.000000e+00, %1
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @generate() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fdiv double %1, %2
ret double %3
}
void ___sl_error(const char *msg) { (void)msg; }


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

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

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

LLVM IR (-O2):
define void @___sl_error(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fatal(char *);
double *dvector(int n) {
  double *v;
  v = (double *)calloc(n, sizeof(double));
  if (!v)
    fatal("allocation failure in dvector()\n");
  return v;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <dvector+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbx
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <dvector+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in dvector()\0A\00"
define double* @dvector(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %3
%7 = load double*, double** %3
%8 = icmp ne double* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load double*, double** %3
ret double* %12
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in dvector()\0A\00"
define double* @dvector(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 8)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to double*
ret double* %7
}
int *getit(void) {
  static int static_value = 22;
  return &static_value;
}


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

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

LLVM IR (-O0):
@getit.static_value = internal global i32 22
define i32* @getit() {
ret i32* @getit.static_value
}

LLVM IR (-O2):
@getit.static_value = internal global i32 22
define i32* @getit() {
ret i32* @getit.static_value
}
void encodeDmaMoveChCtrl(void) {}


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

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

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

LLVM IR (-O2):
define void @encodeDmaMoveChCtrl() {
ret void
}
/* Variables and functions */
int is_sorted(int *, int);
int /*<<< orphan*/ merge(int *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int test_B_empty() {
  int a[] = {1, 3, 5, 7, 9};
  merge(a, 5, 0, 0);
  return is_sorted(a, 5);
}


x86 assembly (clang, -O0):
<test_B_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <merge@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <is_sorted@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_B_empty>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <merge@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <is_sorted@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_B_empty.a = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
define i32 @test_B_empty() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge(i32* %3, i32 5, i32 0, i32 0)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @is_sorted(i32* %5, i32 5)
ret i32 %6
}

LLVM IR (-O2):
@__const.test_B_empty.a = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
define i32 @test_B_empty() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge(i32* %3, i32 5, i32 0, i32 0)
%5 = call i32 @is_sorted(i32* %3, i32 5)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x5e() {
  Assert_real((isspace(94) == 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_isspace.c",
              475, ("isspace should be 0 for ^"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x5e>:
push   %rax
mov    $0x5e,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1db,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ^\00"
define void @t_isspace_0x5e() {
%1 = call i64 @isspace(i32 94)
%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 475, i8* getelementptr inbounds ([26 x i8], [26 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ^\00"
define void @t_isspace_0x5e() {
%1 = tail call i64 @isspace(i32 94)
%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 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sum_upto(int /*<<< orphan*/);
int useit(int val) {
  static int usedval;
  usedval = val;
  return val + sum_upto(0);
}


x86 assembly (clang, -O0):
<useit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f08(%rip)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <sum_upto@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <sum_upto@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@useit.usedval = internal global i32 0
define i32 @useit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @useit.usedval
%4 = load i32, i32* %2
%5 = call i32 @sum_upto(i32 0)
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @useit(i32 %0) {
%2 = tail call i32 @sum_upto(i32 0)
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void printguess(int start, int mult, int add, int scaletotal, int scalecount) {
  printf("-s %04x -m %04x -a %04x\tscaletotal\t%d\t%d\n", start, mult, add,
         scaletotal, scaletotal / scalecount);
}


x86 assembly (clang, -O0):
<printguess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    %eax,%r9d
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printguess>:
mov    %ecx,%r9d
mov    %edx,%ecx
mov    %esi,%r10d
mov    %edi,%esi
mov    %r9d,%eax
cltd
idiv   %r8d
lea    0xed8(%rip),%rdi
mov    %r10d,%edx
mov    %r9d,%r8d
mov    %eax,%r9d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"-s %04x -m %04x -a %04x\09scaletotal\09%d\09%d\0A\00"
define void @printguess(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = sdiv i32 %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"-s %04x -m %04x -a %04x\09scaletotal\09%d\09%d\0A\00"
define void @printguess(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sdiv i32 %3, %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %6)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ cert;
};
typedef TYPE_1__ PKCS7_RECIP_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
int ASN1_OP_FREE_POST;
int /*<<< orphan*/ X509_free(int /*<<< orphan*/);
int ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) {
  if (operation == ASN1_OP_FREE_POST) {
    PKCS7_RECIP_INFO *ri = (PKCS7_RECIP_INFO *)*pval;
    X509_free(ri->cert);
  }
  return 1;
}


x86 assembly (clang, -O0):
<ri_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
jne    114f <ri_cb+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1030 <X509_free@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ri_cb>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
jne    1126 <ri_cb+0x16>
mov    (%rsi),%rax
mov    (%rax),%edi
call   1030 <X509_free@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
@ASN1_OP_FREE_POST = global i32 0
define i32 @ri_cb(i32 %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca %struct.TYPE_2__*
store i32 %0, i32* %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%10 = load i32, i32* %5
%11 = load i32, i32* @ASN1_OP_FREE_POST
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %4
%14 = load i32**, i32*** %6
%15 = load i32*, i32** %14
%16 = bitcast i32* %15 to %struct.TYPE_2__*
store %struct.TYPE_2__* %16, %struct.TYPE_2__** %9
%17 = load %struct.TYPE_2__*, %struct.TYPE_2__** %9
%18 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = call i32 @X509_free(i32 %19)
br label %21
21: ; preds = %13, %4
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
@ASN1_OP_FREE_POST = global i32 0
define i32 @ri_cb(i32 %0, i32** nocapture %1, i32* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = load i32, i32* @ASN1_OP_FREE_POST
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = bitcast i32** %1 to %struct.TYPE_2__**
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %8
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i64 0, i32 0
%11 = load i32, i32* %10
%12 = tail call i32 @X509_free(i32 %11)
br label %13
13: ; preds = %7, %4
ret i32 1
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef unsigned long uint32_t;

/* Variables and functions */
void spiPutByte(uint8_t inBuf) {
  uint8_t dummyReader;
  uint32_t to;
  to = 0;
  (*(volatile unsigned long *)((0xE0020008))) = (uint32_t)0x000000FF & inBuf;
  while (!((*(volatile unsigned long *)((0xE0020004))) & 0x00000080))
    ;
  dummyReader = (uint8_t)(*(volatile unsigned long *)((0xE0020008))) &
                (uint32_t)0x000000FF;
}


x86 assembly (clang, -O0):
<spiPutByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
and    $0xff,%rcx
mov    $0xe0020008,%eax
mov    %rcx,(%rax)
mov    $0xe0020004,%eax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1147 <spiPutByte+0x47>
jmp    114c <spiPutByte+0x4c>
jmp    1123 <spiPutByte+0x23>
mov    $0xe0020008,%eax
mov    (%rax),%rax
and    $0xff,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiPutByte>:
mov    $0xe0020008,%eax
movzbl %dil,%ecx
mov    %rcx,(%rax)
nopl   0x0(%rax)
testq  $0x80,-0x4(%rax)
je     1110 <spiPutByte+0x10>
mov    (%rax),%rax
ret

LLVM IR (-O0):
define void @spiPutByte(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %4
%5 = load i64, i64* %2
%6 = and i64 255, %5
store volatile i64 %6, i64* inttoptr (i64 3758227464 to i64*)
br label %7
7: ; preds = %12, %1
%8 = load volatile i64, i64* inttoptr (i64 3758227460 to i64*)
%9 = and i64 %8, 128
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
%14 = load volatile i64, i64* inttoptr (i64 3758227464 to i64*)
%15 = and i64 %14, 255
store i64 %15, i64* %3
ret void
}

LLVM IR (-O2):
define void @spiPutByte(i64 %0) {
%2 = and i64 %0, 255
store volatile i64 %2, i64* inttoptr (i64 3758227464 to i64*)
br label %3
3: ; preds = %3, %1
%4 = load volatile i64, i64* inttoptr (i64 3758227460 to i64*)
%5 = and i64 %4, 128
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load volatile i64, i64* inttoptr (i64 3758227464 to i64*)
ret void
}
void genmthi() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ check_size(int);
int /*<<< orphan*/ printf(char *, int);
void check_all(void) {
  uint8_t size;
  for (size = 1; size < 255; size++) {
    printf("size=%d\n", size);
    check_size(size);
  }
}


x86 assembly (clang, -O0):
<check_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jge    1161 <check_all+0x41>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <check_size@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <check_all+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_all>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <check_size@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1130 <check_all+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"size=%d\0A\00"
define void @check_all() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 255
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @check_size(i32 %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"size=%d\0A\00"
define void @check_all() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @check_size(i32 %2)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ reach_error();
int main() {
  int a, b, c;
  int *p1 = __VERIFIER_nondet_int() ? &a : &c;
  int *p2 = __VERIFIER_nondet_int() ? &b : 0;
  if (p1 == p2) {
    goto ERROR;
  }
  return 0;
ERROR : {
  reach_error();
  abort();
}
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     115d <main+0x2d>
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116a <main+0x3a>
lea    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116a <main+0x3a>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1190 <main+0x60>
lea    -0xc(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    119b <main+0x6b>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    119b <main+0x6b>
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    11b6 <main+0x86>
jmp    11be <main+0x8e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1050 <reach_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

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
%7 = call i64 (...) @__VERIFIER_nondet_int()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %9
%12 = phi i32* [ %2, %9 ], [ %4, %10 ]
store i32* %12, i32** %5
%13 = call i64 (...) @__VERIFIER_nondet_int()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
br label %17
16: ; preds = %11
br label %17
17: ; preds = %16, %15
%18 = phi i32* [ %3, %15 ], [ null, %16 ]
store i32* %18, i32** %6
%19 = load i32*, i32** %5
%20 = load i32*, i32** %6
%21 = icmp eq i32* %19, %20
br i1 %21, label %22, label %23
22: ; preds = %17
br label %24
23: ; preds = %17
ret i32 0
24: ; preds = %22
%25 = call i32 (...) @reach_error()
%26 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__VERIFIER_nondet_int()
%2 = tail call i64 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_47C00(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_47C00() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("usage: lock [-u]\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"usage: lock [-u]\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"usage: lock [-u]\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
const char *f1() { return "unset"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"unset\00"
define i8* @f1() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ TaskInfoHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void TaskInfoUpdated() { UAVObjUpdated(TaskInfoHandle()); }


x86 assembly (clang, -O0):
<TaskInfoUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TaskInfoHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TaskInfoUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <TaskInfoHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @TaskInfoUpdated() {
%1 = call i32 (...) @TaskInfoHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TaskInfoUpdated() {
%1 = tail call i32 (...) @TaskInfoHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void executeSTBAR() {}


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

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

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

LLVM IR (-O2):
define void @executeSTBAR() {
ret void
}
adrreg0adrx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = (((float *)11111111)[x1]); }


x86 assembly (clang, -O0):
<adrreg0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrx1_set>:
movslq %esi,%rax
movss  0xa98ac7(,%rax,4),%xmm0
movss  %xmm0,0x2625a00(%rdx)
02
ret

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

LLVM IR (-O2):
define i32 @adrreg0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %7
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %4, i64 10000000
store float %9, float* %10
ret i32 undef
}
unsigned char crand48(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @crand48() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @crand48() {
ret i8 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
void *calloc_or_die(size_t n, size_t sz) {
  void *mem;
  mem = calloc(n, sz);
  if (mem == NULL)
    exit(1);
  return mem;
}


x86 assembly (clang, -O0):
<calloc_or_die>:
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 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <calloc_or_die+0x36>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_or_die>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     112d <calloc_or_die+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @calloc_or_die(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @calloc_or_die(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i8* %3
}
int bang(int x) { return ~((x | (~x + 1)) >> 31) & 1; }


x86 assembly (clang, -O0):
<bang>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
or     %ecx,%eax
sar    $0x1f,%eax
xor    $0xffffffff,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bang>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bang(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %5, 1
%7 = or i32 %3, %6
%8 = ashr i32 %7, 31
%9 = xor i32 %8, -1
%10 = and i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @bang(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ cond;

/* Variables and functions */
__attribute__((unused)) uintptr_t fio_ct_true(uintptr_t cond) {
  return ((cond | (0 - cond)) >> ((sizeof(cond) << 3) - 1));
}


x86 assembly (clang, -O0):
<fio_ct_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
or     %rcx,%rax
shr    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_ct_true>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i64 @fio_ct_true(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = sub i64 0, %4
%6 = or i64 %3, %5
%7 = lshr i64 %6, 63
ret i64 %7
}

LLVM IR (-O2):
define i64 @fio_ct_true(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
char *strncpy(char *dest, const char *src, int count) {
  __asm__("cld\n"
          "1:\tdecl %2\n\t"
          "js 2f\n\t"
          "lodsb\n\t"
          "stosb\n\t"
          "testb %%al,%%al\n\t"
          "jne 1b\n\t"
          "rep\n\t"
          "stosb\n"
          "2:" ::"S"(src),
          "D"(dest), "c"(count));
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
cld
dec    %ecx
js     112f <strncpy+0x2f>
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    111b <strncpy+0x1b>
rep stos %al,%es:(%rdi)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %edx,%ecx
cld
dec    %ecx
js     110f <strncpy+0xf>
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1103 <strncpy+0x3>
rep stos %al,%es:(%rdi)
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned %0, i8* %1, i32 %2) {
tail call void asm sideeffect "cld\0A1:\09decl $2\0A\09js 2f\0A\09lodsb\0A\09stosb\0A\09testb %al,%al\0A\09jne 1b\0A\09rep\0A\09stosb\0A2:", "{si},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0, i32 %2)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strlen(char *);
void helper(char *name, char *str) {
  printf("helper: sizeof(%s) = %d\n", name, (int)sizeof(str));
  printf("helper: strlen(%s) = %d\n", name, (int)strlen(str));
  printf("\n");
}


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"helper: sizeof(%s) = %d\0A\00"
@.str.1 = [25 x i8] c"helper: strlen(%s) = %d\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @helper(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i32 8)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"helper: sizeof(%s) = %d\0A\00"
@.str.1 = [25 x i8] c"helper: strlen(%s) = %d\0A\00"
define void @helper(i8* %0, i8* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 8)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = trunc i64 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %5)
%7 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int);
int min(int /*<<< orphan*/, int);
int clamp(int val, int minval, int maxval) {
  return min(max(val, minval), maxval - 1);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <max@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
push   %rbx
mov    %edx,%ebx
call   1040 <max@plt>
add    $0xffffffff,%ebx
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @clamp(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 = call i32 @max(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i32 @min(i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @max(i32 %0, i32 %1)
%5 = add nsw i32 %2, -1
%6 = tail call i32 @min(i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gret() { ol("rts"); }


x86 assembly (clang, -O0):
<gret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"rts\00"
define i32 @gret() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"rts\00"
define i32 @gret() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_time(int, int);
int main(void) {
  print_time(23, 59);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
mov    $0x3b,%esi
call   1030 <print_time@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_time(i32 23, i32 59)
ret i32 0
}
/* Variables and functions */
unsigned char i2c_send_byte(unsigned char);
unsigned char i2c_address(unsigned char address, unsigned char rw) {
  if (rw == 1) {
    (address |= (1 << 0));
  } else {
    (address &= ~(1 << 0));
  }
  return i2c_send_byte(address);
}


x86 assembly (clang, -O0):
<i2c_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1140 <i2c_address+0x30>
movzbl -0x1(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    114a <i2c_address+0x3a>
movzbl -0x1(%rbp),%eax
and    $0xfffffffe,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <i2c_send_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_address>:
cmp    $0x1,%sil
sete   %al
and    $0xfe,%dil
or     %al,%dil
movzbl %dil,%edi
jmp    1030 <i2c_send_byte@plt>

LLVM IR (-O0):
define zeroext i8 @i2c_address(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = or i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
br label %18
13: ; preds = %2
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = and i32 %15, -2
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %18
18: ; preds = %13, %8
%19 = load i8, i8* %3
%20 = call zeroext i8 @i2c_send_byte(i8 zeroext %19)
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @i2c_address(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 1
%4 = and i8 %0, -2
%5 = zext i1 %3 to i8
%6 = or i8 %4, %5
%7 = tail call zeroext i8 @i2c_send_byte(i8 zeroext %6)
ret i8 %7
}
int foo(int x) {
  switch (x) {
  case 4:
  case 6:
  case 9:
  case 11:
    return 30;
  }
  return 31;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     114e <foo+0x4e>
jmp    111b <foo+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     114e <foo+0x4e>
jmp    112c <foo+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     114e <foo+0x4e>
jmp    113d <foo+0x3d>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
jne    115a <foo+0x5a>
jmp    114e <foo+0x4e>
movl   $0x1e,-0x4(%rbp)
jmp    1161 <foo+0x61>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0xfffffffc,%edi
mov    $0x1f,%eax
cmp    $0x7,%edi
ja     111a <foo+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 4, label %5
i32 6, label %5
i32 9, label %5
i32 11, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 30, i32* %2
br label %7
6: ; preds = %1
store i32 31, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.foo = [8 x i32] [i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30]
define i32 @foo(i32 %0) {
%2 = add i32 %0, -4
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.foo, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 31, %1 ]
ret i32 %9
}
int cmp_float(const void *_a, const void *_b) {
  float a;
  float b;
  a = *(const float *)_a;
  b = *(const float *)_b;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<cmp_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
%16 = zext i1 %15 to i32
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmp_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt float %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *filename) {
  printf("Usage:\n"
         "\t%s input-stream-type1 path1 input-stream-type2 path2\n"
         "Supported type:\n"
         "\tpty\n"
         "\tunix-spcket\n",
         filename);
  return;
}


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

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

LLVM IR (-O0):
@.str = [96 x i8] c"Usage:\0A\09%s input-stream-type1 path1 input-stream-type2 path2\0ASupported type:\0A\09pty\0A\09unix-spcket\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [96 x i8] c"Usage:\0A\09%s input-stream-type1 path1 input-stream-type2 path2\0ASupported type:\0A\09pty\0A\09unix-spcket\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rop3_11_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_11_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_11_0_0>:
mov    (%rdi),%al
not    %al
and    %sil,%al
or     %dl,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_11_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_11_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %1
%7 = or i8 %6, %2
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int compare_command(char *buf, char *command) {
  return memcmp(buf, command, strlen(command)) == 0;
}


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

x86 assembly (clang, -O2):
<compare_command>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @compare_command(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @memcmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_command(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo10();
int use10() { foo10(); }


x86 assembly (clang, -O0):
<use10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo10@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @use10() {
%1 = alloca i32
%2 = call i32 (...) @foo10()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @use10() {
%1 = tail call i32 (...) @foo10()
ret i32 undef
}
/* Type definitions */
struct kms_crtc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct kms_crtc *);
void kms_crtc_free(struct kms_crtc *crtc) { free(crtc); }


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

x86 assembly (clang, -O2):
<kms_crtc_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.kms_crtc = type { i32 }
define void @kms_crtc_free(%struct.kms_crtc* %0) {
%2 = alloca %struct.kms_crtc*
store %struct.kms_crtc* %0, %struct.kms_crtc** %2
%3 = load %struct.kms_crtc*, %struct.kms_crtc** %2
%4 = call i32 @free(%struct.kms_crtc* %3)
ret void
}

LLVM IR (-O2):
%struct.kms_crtc = type { i32 }
define void @kms_crtc_free(%struct.kms_crtc* nocapture %0) {
%2 = tail call i32 @free(%struct.kms_crtc* %0)
ret void
}