xunge/DecIR huggingface dataset:
void *bar(void *p, void *q, int r) { return __builtin_memcpy(p, q, r); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movslq %edx,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @bar(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** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
ret i8* %7
}

LLVM IR (-O2):
define i8* @bar(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret i8* %0
}
short mkshort(char high, char low) {
  short _low = low, _high = high;
  short res = _high + _low;
  return res;
}


x86 assembly (clang, -O0):
<mkshort>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %ax,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkshort>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define signext i16 @mkshort(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %4
%9 = sext i8 %8 to i16
store i16 %9, i16* %5
%10 = load i8, i8* %3
%11 = sext i8 %10 to i16
store i16 %11, i16* %6
%12 = load i16, i16* %6
%13 = sext i16 %12 to i32
%14 = load i16, i16* %5
%15 = sext i16 %14 to i32
%16 = add nsw i32 %13, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %7
%18 = load i16, i16* %7
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @mkshort(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = add nsw i16 %4, %3
ret i16 %5
}
void X509_STORE_CTX_init(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_CTX_init() {
ret void
}
int dstrlen(const char *s) {
  const char *p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<dstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <dstrlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <dstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <dstrlen+0x10>
ret

LLVM IR (-O0):
define i32 @dstrlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @dstrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *);
void test_sscanf() {
  int n = 0, m = 0;
  sscanf("10 20", "%d %d", &n, &m);
  assert(n == 0);
  assert(m == 0);
}


x86 assembly (clang, -O0):
<test_sscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec2(%rip),%rsi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <sscanf@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sscanf>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xec9(%rip),%rdi
lea    0xec8(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <sscanf@plt>
xor    %edi,%edi
cmpl   $0x0,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,(%rsp)
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"10 20\00"
@.str.1 = [6 x i8] c"%d %d\00"
define void @test_sscanf() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"10 20\00"
@.str.1 = [6 x i8] c"%d %d\00"
define void @test_sscanf() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @sscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}
int min(int a, int b) {
  if (b < a)
    return b;
  else
    return a;
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
unsigned rightrot(unsigned x, int n) {
  int wordlength(void);
  int rbit;
  while (n-- > 0) {
    rbit = (x & 1) << (wordlength() - 1);
    x = x >> 1;
    x = x | rbit;
  }
  return x;
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    1164 <rightrot+0x54>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
call   1030 <wordlength@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    111e <rightrot+0xe>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
jle    114d <rightrot+0x3d>
mov    %esi,%r14d
add    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ebp
and    $0x1,%ebp
call   1030 <wordlength@plt>
lea    -0x1(%rax),%ecx
shl    %cl,%ebp
shr    %ebx
or     %ebp,%ebx
add    $0xffffffff,%r14d
cmp    $0x1,%r14d
ja     1130 <rightrot+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i32 [ %13, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = and i32 %5, 1
%9 = tail call i32 @wordlength()
%10 = add nsw i32 %9, -1
%11 = shl nuw i32 %8, %10
%12 = lshr i32 %5, 1
%13 = or i32 %11, %12
%14 = icmp ugt i32 %6, 1
br i1 %14, label %4, label %15
15: ; preds = %4, %2
%16 = phi i32 [ %0, %2 ], [ %13, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x65() {
  Assert_real((iscntrl(101) == 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_iscntrl.c",
              510, ("iscntrl should be 0 for e"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x65>:
push   %rax
mov    $0x65,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1fe,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for e\00"
define void @t_iscntrl_0x65() {
%1 = call i64 @iscntrl(i32 101)
%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 510, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for e\00"
define void @t_iscntrl_0x65() {
%1 = tail call i64 @iscntrl(i32 101)
%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 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *get_system_type(void) { return "ZAO Networks Capcella"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"ZAO Networks Capcella\00"
define i8* @get_system_type() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"ZAO Networks Capcella\00"
define i8* @get_system_type() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *strdup(char const *);
char *cgdb_strdup(const char *s) {
  char *t = strdup(s);
  if (t)
    return t;
  exit(-1);
}


x86 assembly (clang, -O0):
<cgdb_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <cgdb_strdup+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0xffffffff,%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define noalias i8* @cgdb_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Cvar_InfoString(int);
int /*<<< orphan*/ Info_Print(int /*<<< orphan*/);
void SV_Systeminfo_f(void) {
  Com_Printf("System info settings:\n");
  Info_Print(Cvar_InfoString(0x0008));
}


x86 assembly (clang, -O0):
<SV_Systeminfo_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x8,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
call   1050 <Info_Print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_Systeminfo_f>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x8,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <Info_Print@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"System info settings:\0A\00"
define void @SV_Systeminfo_f() {
%1 = call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Cvar_InfoString(i32 8)
%3 = call i32 @Info_Print(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"System info settings:\0A\00"
define void @SV_Systeminfo_f() {
%1 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Cvar_InfoString(i32 8)
%3 = tail call i32 @Info_Print(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int read(int, int *, int);
int get_instance_count(char *countfile) {
  int fd;
  int proccount = 0;
  int br;
  fd = open(countfile, O_RDONLY);
  br = read(fd, &proccount, sizeof(int));
  if ((br == 0) || (br == -1))
    proccount = 0;
  close(fd);
  return proccount;
}


x86 assembly (clang, -O0):
<get_instance_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1180 <get_instance_count+0x50>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1187 <get_instance_count+0x57>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_instance_count>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0x4(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
add    $0x1,%eax
xor    %ebp,%ebp
cmp    $0x2,%eax
jb     116a <get_instance_count+0x3a>
mov    0x4(%rsp),%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @get_instance_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%6 = load i8*, i8** %2
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @read(i32 %9, i32* %4, i32 4)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %1
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %13, %1
store i32 0, i32* %4
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %3
%19 = call i32 @close(i32 %18)
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @get_instance_count(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = call i32 @read(i32 %5, i32* %2, i32 4)
%7 = add i32 %6, 1
%8 = icmp ult i32 %7, 2
%9 = load i32, i32* %2
%10 = select i1 %8, i32 0, i32 %9
%11 = tail call i32 @close(i32 %5)
ret i32 %10
}
int mIsMexicoState(int ccode) { return (ccode >= 233 && ccode <= 264); }


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

x86 assembly (clang, -O2):
<mIsMexicoState>:
add    $0xffffff17,%edi
xor    %eax,%eax
cmp    $0x20,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @mIsMexicoState(i32 %0) {
%2 = add i32 %0, -233
%3 = icmp ult i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double RAND_MAX;
int log(double);
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double distri(int m) {
  srand(time(NULL));
  double r = (double)rand() / RAND_MAX + 1;
  return (-m) * log(r);
}


x86 assembly (clang, -O0):
<distri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e7a(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe86(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distri>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e84(%rip),%rax
divsd  (%rax),%xmm0
addsd  0xe90(%rip),%xmm0
call   1050 <log@plt>
imul   %ebx,%eax
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @distri(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
%10 = fadd double %9, 1.000000e+00
store double %10, double* %3
%11 = load i32, i32* %2
%12 = sub nsw i32 0, %11
%13 = load double, double* %3
%14 = call i32 @log(double %13)
%15 = mul nsw i32 %12, %14
%16 = sitofp i32 %15 to double
ret double %16
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @distri(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load double, double* @RAND_MAX
%7 = fdiv double %5, %6
%8 = fadd double %7, 1.000000e+00
%9 = tail call i32 @log(double %8)
%10 = mul i32 %9, %0
%11 = sub i32 0, %10
%12 = sitofp i32 %11 to double
ret double %12
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __wbeu16(int *, scalar_t__);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_beuint16(int fd, int chip_addr, int reg, uint16_t value) {
  uint8_t data[1 + sizeof(uint16_t)];
  data[0] = reg;
  __wbeu16(&data[1], (uint16_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint16_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_beuint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <__wbeu16@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
mov    $0x9,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_beuint16>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rcx,%rsi
call   1030 <__wbeu16@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x9,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @i2c_write_beuint16(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [9 x i32]
%6 = bitcast [9 x i32]* %5 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 1
%9 = call i32 @__wbeu16(i32* %8, i64 %3)
%10 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 9, i32 0)
ret i32 %10
}
main() {
  int true = 1;
#pragma omp parallel
  {
#pragma omp for
    if (true) {
      true = 0;
    }
  }
  printf("err_for 004 : FAILED, can not compile this program.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1137 <main+0x27>
movl   $0x0,-0x8(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"err_for 004 : FAILED, can not compile this program.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %2
br label %6
6: ; preds = %5, %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [52 x i8] c"err_for 004 : FAILED, can not compile this program.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 1
}
double convert(long long in) {
  double f;
  __builtin_memcpy(&f, &in, sizeof(in));
  return f;
}


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

x86 assembly (clang, -O2):
<convert>:
movq   %rdi,%xmm0
ret

LLVM IR (-O0):
define double @convert(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = bitcast double* %3 to i8*
%5 = bitcast i64* %2 to i8*
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @convert(i64 %0) {
%2 = bitcast i64 %0 to double
ret double %2
}
void noopKeyFn(struct ScrollableList *l, int selected_index) {}


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

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

LLVM IR (-O0):
%struct.ScrollableList = type opaque
define void @noopKeyFn(%struct.ScrollableList* %0, i32 %1) {
%3 = alloca %struct.ScrollableList*
%4 = alloca i32
store %struct.ScrollableList* %0, %struct.ScrollableList** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ScrollableList = type opaque
define void @noopKeyFn(%struct.ScrollableList* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) {
  die("usage: cc1 [-Ewd] [-D def[=val]]... [-U def]... "
      "[-I dir]... [-o output] [input]");
}


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

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

LLVM IR (-O0):
@.str = [80 x i8] c"usage: cc1 [-Ewd] [-D def[=val]]... [-U def]... [-I dir]... [-o output] [input]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"usage: cc1 [-Ewd] [-D def[=val]]... [-U def]... [-I dir]... [-o output] [input]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}
void av_get_pix_fmt_name() {}


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

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

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

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

/* Variables and functions */
int cap_netlink_recv(struct sk_buff *);
int security_netlink_recv(struct sk_buff *skb) { return cap_netlink_recv(skb); }


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

x86 assembly (clang, -O2):
<security_netlink_recv>:
jmp    1030 <cap_netlink_recv@plt>

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

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define i32 @security_netlink_recv(%struct.sk_buff* %0) {
%2 = tail call i32 @cap_netlink_recv(%struct.sk_buff* %0)
ret i32 %2
}
int fun489() { return 489; }


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

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

LLVM IR (-O0):
define i32 @fun489() {
ret i32 489
}

LLVM IR (-O2):
define i32 @fun489() {
ret i32 489
}
/* Variables and functions */
int random();
int get_random_max(int max) { return ((random() % max) + 1); }


x86 assembly (clang, -O0):
<get_random_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_max>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_random_max(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ registers_write_word(int, int, int /*<<< orphan*/);
void timer_set(uint16_t value) { registers_write_word(0x06, 0x07, value); }


x86 assembly (clang, -O0):
<timer_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <registers_write_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_set>:
mov    %edi,%edx
mov    $0x6,%edi
mov    $0x7,%esi
jmp    1030 <registers_write_word@plt>

LLVM IR (-O0):
define void @timer_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @registers_write_word(i32 6, i32 7, i32 %3)
ret void
}

LLVM IR (-O2):
define void @timer_set(i32 %0) {
%2 = tail call i32 @registers_write_word(i32 6, i32 7, i32 %0)
ret void
}
void gen_acs(void) {}


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

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

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

LLVM IR (-O2):
define void @gen_acs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sincosf(float, float *, float *);
float sincosf_sinf(float x) {
  float s, c;
  sincosf(x, &s, &c);
  return s;
}


x86 assembly (clang, -O0):
<sincosf_sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <sincosf@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincosf_sinf>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <sincosf@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sincosf_sinf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = call i32 @sincosf(float %5, float* %3, float* %4)
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @sincosf_sinf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @sincosf(float %0, float* %2, float* %3)
%7 = load float, float* %2
ret float %7
}
int test_imm_B8uint8_reg(unsigned char val) {
  return ((val) & (0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xb8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -72
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_icon_source_set_state_wildcarded() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_set_state_wildcarded() {
ret void
}
void u_set_ctrl(char *buf, long *idx, unsigned int u) {
  long i = *idx;
  buf[i++] = '^';
  if (u == 0x7f)
    buf[i++] = '?';
  else
    buf[i++] = u | 0x40;
  *idx = i;
}


x86 assembly (clang, -O0):
<u_set_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movb   $0x5e,(%rax,%rcx,1)
cmpl   $0x7f,-0x14(%rbp)
jne    1157 <u_set_ctrl+0x57>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movb   $0x3f,(%rax,%rcx,1)
jmp    1175 <u_set_ctrl+0x75>
mov    -0x14(%rbp),%eax
or     $0x40,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x20(%rbp)
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_set_ctrl>:
mov    (%rsi),%rax
mov    %edx,%ecx
or     $0x40,%cl
cmp    $0x7f,%edx
movzbl %cl,%ecx
mov    $0x3f,%edx
cmovne %ecx,%edx
movb   $0x5e,(%rdi,%rax,1)
mov    %dl,0x1(%rdi,%rax,1)
add    $0x2,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @u_set_ctrl(i8* %0, i64* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %7
%12 = add nsw i64 %11, 1
store i64 %12, i64* %7
%13 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 94, i8* %13
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 127
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = load i64, i64* %7
%19 = add nsw i64 %18, 1
store i64 %19, i64* %7
%20 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 63, i8* %20
br label %29
21: ; preds = %3
%22 = load i32, i32* %6
%23 = or i32 %22, 64
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %4
%26 = load i64, i64* %7
%27 = add nsw i64 %26, 1
store i64 %27, i64* %7
%28 = getelementptr inbounds i8, i8* %25, i64 %26
store i8 %24, i8* %28
br label %29
29: ; preds = %21, %16
%30 = load i64, i64* %7
%31 = load i64*, i64** %5
store i64 %30, i64* %31
ret void
}

LLVM IR (-O2):
define void @u_set_ctrl(i8* nocapture writeonly %0, i64* nocapture %1, i32 %2) {
%4 = load i64, i64* %1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 94, i8* %5
%6 = icmp eq i32 %2, 127
%7 = trunc i32 %2 to i8
%8 = or i8 %7, 64
%9 = select i1 %6, i8 63, i8 %8
%10 = add nsw i64 %4, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %9, i8* %11
%12 = add nsw i64 %4, 2
store i64 %12, i64* %1
ret void
}
void f() {
  int a, b, c;
  a = 10;
  b = 10;
  c = 10;
  a = c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 10, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %3
store i32 %4, i32* %1
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 1;
  for (; i < 256; i++) {
    printf("\n %d %c ", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"\0A %d %c \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void session_in(struct servermsg *msg, struct _session *session) {}


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

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

LLVM IR (-O0):
%struct.servermsg = type opaque
%struct._session = type opaque
define void @session_in(%struct.servermsg* %0, %struct._session* %1) {
%3 = alloca %struct.servermsg*
%4 = alloca %struct._session*
store %struct.servermsg* %0, %struct.servermsg** %3
store %struct._session* %1, %struct._session** %4
ret void
}

LLVM IR (-O2):
%struct.servermsg = type opaque
%struct._session = type opaque
define void @session_in(%struct.servermsg* nocapture %0, %struct._session* nocapture %1) {
ret void
}
void populateCQ(int *CQ) {
  int i;
  for (i = 0; i < 5; i++)
    CQ[i] = -9999999;
}


x86 assembly (clang, -O0):
<populateCQ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1136 <populateCQ+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xff676981,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <populateCQ+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateCQ>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0xff676981,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @populateCQ(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 -9999999, i32 -9999999, i32 -9999999, i32 -9999999>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 -9999999, i32* %3
ret void
}
/* Variables and functions */
double glmDotProduct3d(double const *, double const *);
double glmComputeDistanceToPlane3d(const double planeOrigin[3],
                                   const double planeNormal[3],
                                   const double p[3]) {
  return glmDotProduct3d(planeNormal, p) -
         glmDotProduct3d(planeNormal, planeOrigin);
}


x86 assembly (clang, -O0):
<glmComputeDistanceToPlane3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <glmDotProduct3d@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <glmDotProduct3d@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeDistanceToPlane3d>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <glmDotProduct3d@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <glmDotProduct3d@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @glmComputeDistanceToPlane3d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double*, double** %6
%9 = call double @glmDotProduct3d(double* %7, double* %8)
%10 = load double*, double** %5
%11 = load double*, double** %4
%12 = call double @glmDotProduct3d(double* %10, double* %11)
%13 = fsub double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @glmComputeDistanceToPlane3d(double* %0, double* %1, double* %2) {
%4 = tail call double @glmDotProduct3d(double* %1, double* %2)
%5 = tail call double @glmDotProduct3d(double* %1, double* %0)
%6 = fsub double %4, %5
ret double %6
}
/* Variables and functions */
bool nrf91_errata_6(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_6() {
ret i32 0
}
char *strrchr(sp, c)
register char *sp, c;
{
  register char *r;
  r = (char *)0;
  do {
    if (*sp == c)
      r = sp;
  } while (*sp++);
  return (r);
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strrchr+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <strrchr+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1116 <strrchr+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ null, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i8* %4, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %8
}
/* Variables and functions */
double sqrt(double);
double C2(int n, int m) {
  return ((double)(2 * n - 1) / sqrt((double)(n * n - m * m)));
}


x86 assembly (clang, -O0):
<C2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C2>:
lea    (%rdi,%rdi,1),%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm2
imul   %edi,%edi
imul   %esi,%esi
sub    %esi,%edi
cvtsi2sd %edi,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1136 <C2+0x26>
sqrtsd %xmm0,%xmm0
jmp    114a <C2+0x3a>
push   %rax
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm2
add    $0x8,%rsp
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @C2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 2, %5
%7 = sub nsw i32 %6, 1
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %11, %14
%16 = sitofp i32 %15 to double
%17 = call double @sqrt(double %16)
%18 = fdiv double %8, %17
ret double %18
}

LLVM IR (-O2):
define double @C2(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, -1
%5 = sitofp i32 %4 to double
%6 = mul nsw i32 %0, %0
%7 = mul nsw i32 %1, %1
%8 = sub nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = tail call double @sqrt(double %9)
%11 = fdiv double %5, %10
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t fmt_bytes_hex_reverse(char *, int /*<<< orphan*/ *, int);
size_t fmt_u16_hex(char *out, uint16_t val) {
  return fmt_bytes_hex_reverse(out, (uint8_t *)&val, 2);
}


x86 assembly (clang, -O0):
<fmt_u16_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <fmt_bytes_hex_reverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_u16_hex>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <fmt_bytes_hex_reverse@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @fmt_u16_hex(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 i64 @fmt_bytes_hex_reverse(i8* %5, i32* %4, i32 2)
ret i64 %6
}

LLVM IR (-O2):
define i64 @fmt_u16_hex(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fmt_bytes_hex_reverse(i8* %0, i32* %3, i32 2)
ret i64 %4
}