xunge/DecIR huggingface dataset:
int test_imm_8Fuint16_mem(unsigned short *val) {
  return ((*val) & (-0x8F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Fuint16_mem>:
movzwl (%rdi),%eax
test   $0xff71,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -143
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rol(int, int);
uint32_t f(uint32_t x) { return (rol(x, 1) & rol(x, 8)) ^ rol(x, 2); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <rol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <rol@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <rol@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1030 <rol@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <rol@plt>
mov    %eax,%ebp
and    %r14d,%ebp
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <rol@plt>
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rol(i32 %3, i32 1)
%5 = load i32, i32* %2
%6 = call i32 @rol(i32 %5, i32 8)
%7 = and i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @rol(i32 %8, i32 2)
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @rol(i32 %0, i32 1)
%3 = tail call i32 @rol(i32 %0, i32 8)
%4 = and i32 %3, %2
%5 = tail call i32 @rol(i32 %0, i32 2)
%6 = xor i32 %4, %5
ret i32 %6
}
const char *pathconN_nm2_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm2_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <pathconN_nm2_name_in+0x27>
jmp    1117 <pathconN_nm2_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <pathconN_nm2_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm2_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm2_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm2_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int main1(int);
int main(void) {
  check_vect();
  return main1(16);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x10,%edi
pop    %rax
jmp    1040 <main1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 16)
ret i32 %2
}
/* Variables and functions */
int not_annotated_inc_h_2(int);
int not_annotated_inc_h_1(int i) { return not_annotated_inc_h_2(i); }


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

x86 assembly (clang, -O2):
<not_annotated_inc_h_1>:
jmp    1030 <not_annotated_inc_h_2@plt>

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

LLVM IR (-O2):
define i32 @not_annotated_inc_h_1(i32 %0) {
%2 = tail call i32 @not_annotated_inc_h_2(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_MediaRenderer_RenderingControl_GetMute(void *,
                                                                       int);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UpnpMediaRenderer_RenderingControl_GetMute(void *upnptoken,
                                                unsigned int InstanceID,
                                                char *Channel) {
  printf("Invoke: UpnpMediaRenderer_RenderingControl_GetMute(%u,%s);\r\n",
         InstanceID, Channel);
  UpnpResponse_MediaRenderer_RenderingControl_GetMute(upnptoken, 1);
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_RenderingControl_GetMute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <UpnpResponse_MediaRenderer_RenderingControl_GetMute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_RenderingControl_GetMute>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_RenderingControl_GetMute@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Invoke: UpnpMediaRenderer_RenderingControl_GetMute(%u,%s);\0D\0A\00"
define void @UpnpMediaRenderer_RenderingControl_GetMute(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UpnpResponse_MediaRenderer_RenderingControl_GetMute(i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"Invoke: UpnpMediaRenderer_RenderingControl_GetMute(%u,%s);\0D\0A\00"
define void @UpnpMediaRenderer_RenderingControl_GetMute(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UpnpResponse_MediaRenderer_RenderingControl_GetMute(i8* %0, i32 1)
ret void
}
int isNotMax(int leftNeighbor, int pixel, int rightNeighbor) {
  if (leftNeighbor > pixel || rightNeighbor > pixel)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isNotMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1125 <isNotMax+0x25>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1131 <isNotMax+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <isNotMax+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isNotMax(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp sgt i32 %2, %1
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char const *);
FILE *dofopen(const char *fn, const char *themode) {
  FILE *f = fopen(fn, themode);
  if (f)
    return f;
  perror(fn);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<dofopen>:
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 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1166 <dofopen+0x36>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<dofopen>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1140 <dofopen+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32* @dofopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32*, i32** %5
ret i32* %12
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 @perror(i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i32* @dofopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i32* %3
6: ; preds = %2
%7 = tail call i32 @perror(i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
int foo_int(_Complex int x) { return __real__ x; }


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

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

LLVM IR (-O0):
define i32 @foo_int(i64 %0) {
%2 = alloca { i32, i32 }
%3 = bitcast { i32, i32 }* %2 to i64*
store i64 %0, i64* %3
%4 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %2, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo_int(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Type definitions */
struct itimerval {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct itimerval const *, struct itimerval *);
int setitimer(int which, const struct itimerval *new, struct itimerval *old) {
  return syscall(104, which, new, old);
}


x86 assembly (clang, -O0):
<setitimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x68,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setitimer>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x68,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.itimerval = type { i32 }
define i32 @setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = alloca i32
%5 = alloca %struct.itimerval*
%6 = alloca %struct.itimerval*
store i32 %0, i32* %4
store %struct.itimerval* %1, %struct.itimerval** %5
store %struct.itimerval* %2, %struct.itimerval** %6
%7 = load i32, i32* %4
%8 = load %struct.itimerval*, %struct.itimerval** %5
%9 = load %struct.itimerval*, %struct.itimerval** %6
%10 = call i32 @syscall(i32 104, i32 %7, %struct.itimerval* %8, %struct.itimerval* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
define i32 @setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = tail call i32 @syscall(i32 104, i32 %0, %struct.itimerval* %1, %struct.itimerval* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dotest(int, int, int, int, char *);
int main() {
  dotest(1, 2, 1, 3, "{{1, 7}{5, 5}}");
  dotest(2, 3, 4, 5, "{{2, 23}{7, 22}}");
  dotest(1, 2, 2, 3, "{{1, 8}{4, 7}}");
  dotest(1, 1, 3, 5, "{{2, 8}}");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    $0x2,%esi
mov    $0x3,%ecx
lea    0xed6(%rip),%r8
mov    %edx,%edi
call   1030 <dotest@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x5,%ecx
lea    0xec3(%rip),%r8
call   1030 <dotest@plt>
mov    $0x1,%edi
mov    $0x2,%edx
mov    $0x3,%ecx
lea    0xeb9(%rip),%r8
mov    %edx,%esi
call   1030 <dotest@plt>
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
lea    0xeab(%rip),%r8
mov    %esi,%edi
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%r8
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <dotest@plt>
lea    0xed7(%rip),%r8
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x5,%ecx
call   1030 <dotest@plt>
lea    0xec8(%rip),%r8
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <dotest@plt>
lea    0xeb7(%rip),%r8
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"{{1, 7}{5, 5}}\00"
@.str.1 = [17 x i8] c"{{2, 23}{7, 22}}\00"
@.str.2 = [15 x i8] c"{{1, 8}{4, 7}}\00"
@.str.3 = [9 x i8] c"{{2, 8}}\00"
define i32 @main() {
%1 = call i32 @dotest(i32 1, i32 2, i32 1, i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @dotest(i32 2, i32 3, i32 4, i32 5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @dotest(i32 1, i32 2, i32 2, i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @dotest(i32 1, i32 1, i32 3, i32 5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"{{1, 7}{5, 5}}\00"
@.str.1 = [17 x i8] c"{{2, 23}{7, 22}}\00"
@.str.2 = [15 x i8] c"{{1, 8}{4, 7}}\00"
@.str.3 = [9 x i8] c"{{2, 8}}\00"
define i32 @main() {
%1 = tail call i32 @dotest(i32 1, i32 2, i32 1, i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dotest(i32 2, i32 3, i32 4, i32 5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @dotest(i32 1, i32 2, i32 2, i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @dotest(i32 1, i32 1, i32 3, i32 5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int x(unsigned int);
unsigned int i(unsigned int a, unsigned int b) { return x(a) >> 24; }


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <x@plt>
sar    $0x18,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
push   %rax
call   1030 <x@plt>
sar    $0x18,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i(i32 %0, i32 %1) {
%3 = tail call i32 @x(i32 %0)
%4 = ashr i32 %3, 24
ret i32 %4
}
int voisinHautDroite(int *tab, int position, int colonne) {
  int count = 0;
  tab += position;
  count += *(tab - 1);
  count += *(tab - 1 + colonne);
  count += *(tab + colonne);
  return count;
}


x86 assembly (clang, -O0):
<voisinHautDroite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    -0x4(%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<voisinHautDroite>:
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rsi
movslq %edx,%rdx
mov    -0x4(%rsi,%rdx,4),%eax
add    -0x4(%rdi,%rcx,4),%eax
add    (%rsi,%rdx,4),%eax
ret

LLVM IR (-O0):
define i32 @voisinHautDroite(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i32, i32* %9, i64 %10
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 -1
%14 = load i32, i32* %13
%15 = load i32, i32* %7
%16 = add nsw i32 %15, %14
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 -1
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* %7
%24 = add nsw i32 %23, %22
store i32 %24, i32* %7
%25 = load i32*, i32** %4
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = load i32, i32* %7
%31 = add nsw i32 %30, %29
store i32 %31, i32* %7
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @voisinHautDroite(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %7
%12 = getelementptr inbounds i32, i32* %5, i64 %8
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
ret i32 %14
}
/* Variables and functions */
char tolower(char const);
int score_name(const char *name) {
  int alpha_value = 0;
  while (*name) {
    alpha_value += tolower(*name) - 'a' + 1;
    name++;
  }
  return alpha_value;
}


x86 assembly (clang, -O0):
<score_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <score_name+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <score_name+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<score_name>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114f <score_name+0x3f>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    %eax,%r14d
add    $0xffffffa0,%r14d
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <score_name+0x20>
jmp    1152 <score_name+0x42>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @score_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %5)
%9 = sext i8 %8 to i32
%10 = add i32 %6, -96
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int bs_get_info(int, char *, char **);
int /*<<< orphan*/ snprintf(char *, int, char *);
int bs_stats(int fd, char **yaml) {
  char command[64] = {0};
  snprintf(command, 64, "stats\r\n");
  return bs_get_info(fd, command, yaml);
}


x86 assembly (clang, -O0):
<bs_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
lea    0xea1(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bs_get_info@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_stats>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xeb6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1040 <snprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <bs_get_info@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"stats\0D\0A\00"
define i32 @bs_stats(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [64 x i8]* %5 to i8*
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = load i8**, i8*** %4
%12 = call i32 @bs_get_info(i32 %9, i8* %10, i8** %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"stats\0D\0A\00"
define i32 @bs_stats(i32 %0, i8** %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @bs_get_info(i32 %0, i8* %4, i8** %1)
ret i32 %6
}
long cread_alt(long *xp) { return (!xp ? 0 : *xp); }


x86 assembly (clang, -O0):
<cread_alt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <cread_alt+0x1e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1129 <cread_alt+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cread_alt>:
test   %rdi,%rdi
je     1109 <cread_alt+0x9>
mov    (%rdi),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @cread_alt(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = icmp ne i64* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i64*, i64** %2
%8 = load i64, i64* %7
br label %9
9: ; preds = %6, %5
%10 = phi i64 [ 0, %5 ], [ %8, %6 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @cread_alt(i64* %0) {
%2 = icmp eq i64* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i64, i64* %0
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_square(uintptr_t, uintptr_t);
void fiat_p384_square(uint64_t out1[6], const uint64_t arg1[6]) {
  internal_fiat_p384_square((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_square>:
jmp    1030 <internal_fiat_p384_square@plt>

LLVM IR (-O0):
define void @fiat_p384_square(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_square(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_square(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_square(i64 %3, i64 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA1_Init(int /*<<< orphan*/ *);
void ssl_sha1_clear(void *sha1_info) { SHA1_Init((SHA_CTX *)sha1_info); }


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

x86 assembly (clang, -O2):
<ssl_sha1_clear>:
jmp    1030 <SHA1_Init@plt>

LLVM IR (-O0):
define void @ssl_sha1_clear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @SHA1_Init(i32* %4)
ret void
}

LLVM IR (-O2):
define void @ssl_sha1_clear(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @SHA1_Init(i32* %2)
ret void
}
int streamer_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @streamer_init() {
ret i32 0
}
/* Variables and functions */
int start(int, char **);
int start_prolog_program(char *caller_name, char *program_name) {
  char *argv[4];
  argv[0] = caller_name;
  argv[1] = "-C";
  argv[2] = "-b";
  argv[3] = program_name;
  return start(4, argv);
}


x86 assembly (clang, -O0):
<start_prolog_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x4,%edi
call   1030 <start@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_prolog_program>:
sub    $0x28,%rsp
mov    %rdi,(%rsp)
lea    0xee1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xed8(%rip),%rax
mov    %rax,0x10(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <start@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-C\00"
@.str.1 = [3 x i8] c"-b\00"
define i32 @start_prolog_program(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [4 x i8*]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 0
store i8* %6, i8** %7
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 3
store i8* %10, i8** %11
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* %5, i64 0, i64 0
%13 = call i32 @start(i32 4, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"-C\00"
@.str.1 = [3 x i8] c"-b\00"
define i32 @start_prolog_program(i8* %0, i8* %1) {
%3 = alloca [4 x i8*]
%4 = bitcast [4 x i8*]* %3 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
store i8* %0, i8** %5
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 3
store i8* %1, i8** %8
%9 = call i32 @start(i32 4, i8** %5)
ret i32 %9
}
int test_imm_75uint8_reg(unsigned char val) {
  return ((val) & (0x75 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_75uint8_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, 117
%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_75uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 117
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int reuse_set_binary_stderr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @reuse_set_binary_stderr() {
ret i32 0
}
unsigned int div_const(unsigned int n) { return n / 2; }


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

x86 assembly (clang, -O2):
<div_const>:
mov    %edi,%eax
shr    %eax
ret

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

LLVM IR (-O2):
define i32 @div_const(i32 %0) {
%2 = lshr i32 %0, 1
ret i32 %2
}
int __attribute__((interrupt_handler)) test00(int a, int b, int c, int d) {
  return a + b;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test00(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @test00(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("else\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"else\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mutter();
int set_loop(const char *device, const char *file, int offset,
             const char *encryption, int *loopro) {
  mutter();
  return 1;
}


x86 assembly (clang, -O0):
<set_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0x0,%al
call   1030 <mutter@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_loop>:
push   %rax
xor    %eax,%eax
call   1030 <mutter@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_loop(i8* %0, i8* %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = call i32 (...) @mutter()
ret i32 1
}

LLVM IR (-O2):
define i32 @set_loop(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32* nocapture readnone %4) {
%6 = tail call i32 (...) @mutter()
ret i32 1
}
void remove_all_chars(char *str, char c) {
  char *pr = str, *pw = str;
  while (*pr) {
    *pw = *pr++;
    pw = pw + (*pw != c);
  }
  *pw = '\0';
}


x86 assembly (clang, -O0):
<remove_all_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <remove_all_chars+0x6b>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
movsbl -0x9(%rbp),%edx
cmp    %edx,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <remove_all_chars+0x1e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_all_chars>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <remove_all_chars+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    %sil,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <remove_all_chars+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_all_chars(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %7
%10 = icmp ne i8 %6, %1
%11 = zext i1 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ %0, %2 ], [ %12, %5 ]
store i8 0, i8* %16
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ByteSwap64(int /*<<< orphan*/);
uint64_t FromBE64(uint64_t value) { return ByteSwap64(value); }


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

x86 assembly (clang, -O2):
<FromBE64>:
jmp    1030 <ByteSwap64@plt>

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

LLVM IR (-O2):
define i32 @FromBE64(i32 %0) {
%2 = tail call i32 @ByteSwap64(i32 %0)
ret i32 %2
}
void rop3_132_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_132_1_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
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_132_1_0>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_132_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_monitor(int, char **);
int /*<<< orphan*/ reg_test();
int /*<<< orphan*/ restart();
int /*<<< orphan*/ ui_mainloop();
int main(int argc, char *argv[]) {
  init_monitor(argc, argv);
  reg_test();
  restart();
  ui_mainloop();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <init_monitor@plt>
xor    %eax,%eax
call   1060 <reg_test@plt>
xor    %eax,%eax
call   1030 <restart@plt>
xor    %eax,%eax
call   1040 <ui_mainloop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @init_monitor(i32 %6, i8** %7)
%9 = call i32 (...) @reg_test()
%10 = call i32 (...) @restart()
%11 = call i32 (...) @ui_mainloop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_monitor(i32 %0, i8** %1)
%4 = tail call i32 (...) @reg_test()
%5 = tail call i32 (...) @restart()
%6 = tail call i32 (...) @ui_mainloop()
ret i32 0
}
/* Variables and functions */
int bar();
int xyzzy(void) { return 10 + bar(); }


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

x86 assembly (clang, -O2):
<xyzzy>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xyzzy() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 10, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @xyzzy() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 10
ret i32 %2
}
/* Variables and functions */
bool nrf52_errata_166(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_166() {
ret i32 0
}
/* Variables and functions */
size_t utf8nsize_lazy(const void *str, size_t n) {
  const char *s = (const char *)str;
  size_t size = 0;
  while (size < n && '\0' != s[size]) {
    size++;
  }
  return size;
}


x86 assembly (clang, -O0):
<utf8nsize_lazy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x21(%rbp)
jae    1145 <utf8nsize_lazy+0x45>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1155 <utf8nsize_lazy+0x55>
jmp    1166 <utf8nsize_lazy+0x66>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <utf8nsize_lazy+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8nsize_lazy>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <utf8nsize_lazy+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <utf8nsize_lazy+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <utf8nsize_lazy+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @utf8nsize_lazy(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52e_get_fscod(const uint8_t *p_a52) { return (p_a52[4] & 0xc0) >> 6; }


x86 assembly (clang, -O0):
<a52e_get_fscod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xc0,%eax
sar    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_get_fscod>:
mov    0x10(%rdi),%eax
shr    $0x6,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @a52e_get_fscod(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = ashr i32 %6, 6
ret i32 %7
}

LLVM IR (-O2):
define i32 @a52e_get_fscod(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int var1;
  printf("Hello world\n");
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}