xunge/DecIR huggingface dataset:
void gtk_widget_reparent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_reparent() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *sysfile_open(char const *, char **, char *);
int sysfile_locate(const char *name, char **complete_path_return) {
  FILE *f = sysfile_open(name, complete_path_return, "r");
  if (f != NULL) {
    fclose(f);
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<sysfile_locate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdx
call   1030 <sysfile_open@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1168 <sysfile_locate+0x48>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <sysfile_locate+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfile_locate>:
push   %rax
lea    0xed8(%rip),%rdx
call   1030 <sysfile_open@plt>
test   %rax,%rax
je     113e <sysfile_locate+0x1e>
mov    %rax,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @sysfile_locate(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = call i32* @sysfile_open(i8* %7, i8** %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %6
%10 = load i32*, i32** %6
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32*, i32** %6
%14 = call i32 @fclose(i32* %13)
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @sysfile_locate(i8* %0, i8** %1) {
%3 = tail call i32* @sysfile_open(i8* %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fclose(i32* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_data_present(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x40)) == cpu_to_le16(0x0008);
}


x86 assembly (clang, -O0):
<ieee80211_is_data_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x4c,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_data_present>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x4c,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x8,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_data_present(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 76)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 8)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_data_present(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 76)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 8)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quit(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ ui_notify_line_set(char *);
int /*<<< orphan*/ ui_refresh();
void event_disconnect_server(struct msg *m) {
  ui_notify_line_set("Server has been halted. Disconnecting...");
  ui_refresh();
  sleep(3);
  quit(1);
}


x86 assembly (clang, -O0):
<event_disconnect_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1050 <ui_notify_line_set@plt>
mov    $0x0,%al
call   1040 <ui_refresh@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1030 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_disconnect_server>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <ui_notify_line_set@plt>
xor    %eax,%eax
call   1040 <ui_refresh@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <quit@plt>

LLVM IR (-O0):
%struct.msg = type { i32 }
@.str = [41 x i8] c"Server has been halted. Disconnecting...\00"
define void @event_disconnect_server(%struct.msg* %0) {
%2 = alloca %struct.msg*
store %struct.msg* %0, %struct.msg** %2
%3 = call i32 @ui_notify_line_set(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @ui_refresh()
%5 = call i32 @sleep(i32 3)
%6 = call i32 @quit(i32 1)
ret void
}

LLVM IR (-O2):
%struct.msg = type { i32 }
@.str = [41 x i8] c"Server has been halted. Disconnecting...\00"
define void @event_disconnect_server(%struct.msg* nocapture readnone %0) {
%2 = tail call i32 @ui_notify_line_set(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @ui_refresh()
%4 = tail call i32 @sleep(i32 3)
%5 = tail call i32 @quit(i32 1)
ret void
}
int get_cpu() {
  int cpu = -1;
  return cpu;
}


x86 assembly (clang, -O0):
<get_cpu>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_cpu() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_cpu() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void notimpl(char s[]) {
  fflush(stdout);
  fprintf(stderr, "\nAbnormal Termination  %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<notimpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<notimpl>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"\0AAbnormal Termination %s\0A\00"
define void @notimpl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"\0AAbnormal Termination %s\0A\00"
define void @notimpl(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ serPutch(char);
void klog(char *_str) {
  int index = 0;
  while (_str[index] != 0) {
    serPutch(_str[index]);
    index++;
  }
}


x86 assembly (clang, -O0):
<klog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <klog+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <serPutch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <klog+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @klog(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @serPutch(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xed() {
  Assert_real((isascii(237) == 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_isascii.c",
              1190, ("isascii should be 0 for 0xed"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xed>:
push   %rax
mov    $0xed,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a6,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xed\00"
define void @t_isascii_0xed() {
%1 = call i64 @isascii(i32 237)
%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 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xed\00"
define void @t_isascii_0xed() {
%1 = tail call i64 @isascii(i32 237)
%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 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_RDLCK;
int /*<<< orphan*/ F_SETLK;
int _fd_get_lock(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fd_get_read_lock(int fd) { return (_fd_get_lock(fd, F_SETLK, F_RDLCK)); }


x86 assembly (clang, -O0):
<fd_get_read_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
call   1030 <_fd_get_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_get_read_lock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <_fd_get_lock@plt>

LLVM IR (-O0):
@F_SETLK = global i32 0
@F_RDLCK = global i32 0
define i32 @fd_get_read_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETLK
%5 = load i32, i32* @F_RDLCK
%6 = call i32 @_fd_get_lock(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@F_SETLK = global i32 0
@F_RDLCK = global i32 0
define i32 @fd_get_read_lock(i32 %0) {
%2 = load i32, i32* @F_SETLK
%3 = load i32, i32* @F_RDLCK
%4 = tail call i32 @_fd_get_lock(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_buffers(char **buffers, int num_bufs) {
  for (int index = 0; index < num_bufs; ++index) {
    printf("%s\n", buffers[index]);
  }
}


x86 assembly (clang, -O0):
<print_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_buffers+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_buffers+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffers>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_buffers+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_buffers+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_buffers(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_buffers(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, char, int);
void verifychar(char c, char c_cmp, int n, int n_cmp) {
  if (n != n_cmp || c != c_cmp) {
    printf("Verify failed. Expected: %c Size: %d Got: %c Size: %d\n", c_cmp,
           n_cmp, c, n);
  }
}


x86 assembly (clang, -O0):
<verifychar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1147 <verifychar+0x37>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
je     1166 <verifychar+0x56>
mov    -0x2(%rbp),%cl
mov    -0xc(%rbp),%edx
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%r8d
lea    0xea5(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifychar>:
mov    %edx,%r8d
cmp    %sil,%dil
jne    111e <verifychar+0xe>
cmp    %ecx,%r8d
jne    111e <verifychar+0xe>
ret
movsbl %sil,%esi
movsbl %dil,%eax
lea    0xed3(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Verify failed. Expected: %c Size: %d Got: %c Size: %d\0A\00"
define void @verifychar(i8 signext %0, i8 signext %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = icmp ne i32 %9, %10
br i1 %11, label %18, label %12
12: ; preds = %4
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %14, %16
br i1 %17, label %18, label %24
18: ; preds = %12, %4
%19 = load i8, i8* %6
%20 = load i32, i32* %8
%21 = load i8, i8* %5
%22 = load i32, i32* %7
%23 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8 signext %19, i32 %20, i8 signext %21, i32 %22)
br label %24
24: ; preds = %18, %12
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Verify failed. Expected: %c Size: %d Got: %c Size: %d\0A\00"
define void @verifychar(i8 signext %0, i8 signext %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
%6 = icmp eq i8 %0, %1
%7 = and i1 %6, %5
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8 signext %1, i32 %3, i8 signext %0, i32 %2)
br label %10
10: ; preds = %4, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void main(int argc, char *argv[]) {
  int i = 0;
  for (i = 0; i < argc; i++) {
    printf("Argurment #%d: %s\n", i, argv[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Argurment #%d: %s\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void vazio_arquivo(FILE *farq) {
  char frase[5];
  if (fgets(frase, 4, farq) == NULL) {
    printf("VAZIO");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<vazio_arquivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x4,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    116e <vazio_arquivo+0x3e>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vazio_arquivo>:
push   %rax
mov    %rdi,%rdx
lea    0x3(%rsp),%rdi
mov    $0x4,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     114a <vazio_arquivo+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"VAZIO\00"
define void @vazio_arquivo(i32* %0) {
%2 = alloca i32*
%3 = alloca [5 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32* @fgets(i8* %4, i32 4, i32* %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"VAZIO\00"
define void @vazio_arquivo(i32* nocapture %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32* @fgets(i8* %3, i32 4, i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
__typeof__(strncmp(1, 1, 1)) test_strncmp_186(void) { return strncmp(1, 1, 1); }


x86 assembly (clang, -O0):
<test_strncmp_186>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <strncmp@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_strncmp_186() {
%1 = call i32 @strncmp(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_strncmp_186() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ pc();
int /*<<< orphan*/ store(int /*<<< orphan*/, int /*<<< orphan*/);
void storei(uint16_t value) { store(pc(), value); }


x86 assembly (clang, -O0):
<storei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pc@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <store@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<storei>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pc@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <store@plt>

LLVM IR (-O0):
define void @storei(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pc()
%4 = load i32, i32* %2
%5 = call i32 @store(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @storei(i32 %0) {
%2 = tail call i32 (...) @pc()
%3 = tail call i32 @store(i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ q_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int *arr, int size) { q_sort(arr, 0, size - 1); }


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <q_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <q_sort@plt>

LLVM IR (-O0):
define void @quick_sort(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 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @q_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @q_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
float Window(float, float, float);
float sin(double);
float Pulse60Hz(float t, float duration) {
  return sin(2.0 * 3.14159265358979324 * 60.0 * t) *
         Window(duration, 0.005f, t);
}


x86 assembly (clang, -O0):
<Pulse60Hz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xe9d(%rip),%xmm1
call   1030 <Window@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pulse60Hz>:
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xec4(%rip),%xmm0
call   1040 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0xeb9(%rip),%xmm1
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm2
call   1030 <Window@plt>
mulss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @Pulse60Hz(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fmul double 0x40778FDB9EFFEA46, %6
%8 = call float @sin(double %7)
%9 = load float, float* %4
%10 = load float, float* %3
%11 = call float @Window(float %9, float 0x3F747AE140000000, float %10)
%12 = fmul float %8, %11
ret float %12
}

LLVM IR (-O2):
define float @Pulse60Hz(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x40778FDB9EFFEA46
%5 = tail call float @sin(double %4)
%6 = tail call float @Window(float %1, float 0x3F747AE140000000, float %0)
%7 = fmul float %5, %6
ret float %7
}
int test_imm_30uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x30 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_30uint64_midword_reg>:
test   $0x300000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_30uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3145728
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_ABint16_mem(short *val) {
  return ((*val) & (-0xAB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ABint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -171
%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_ABint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -171
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) { printf("Usage: %s <ESSID>\n", prog); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Usage: %s <ESSID>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eliminate();
scalar_t__ f(int);
void g() {
  if (f(2) == 0)
    eliminate();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
jne    113f <g+0x1f>
mov    $0x0,%al
call   1030 <eliminate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    $0x2,%edi
call   1040 <f@plt>
test   %rax,%rax
je     1132 <g+0x12>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <eliminate@plt>

LLVM IR (-O0):
define void @g() {
%1 = call i64 @f(i32 2)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @eliminate()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i64 @f(i32 2)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @eliminate()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
unsigned short GET_UAA16BE(unsigned short *, int /*<<< orphan*/);
unsigned short BE16(unsigned short x) { return GET_UAA16BE(&x, 0); }


x86 assembly (clang, -O0):
<BE16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA16BE@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BE16>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA16BE@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @BE16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call zeroext i16 @GET_UAA16BE(i16* %2, i32 0)
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @BE16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call zeroext i16 @GET_UAA16BE(i16* %2, i32 0)
ret i16 %3
}
/* Variables and functions */
int u8iscyrilici(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8iscyrilicc(char *c) { return u8iscyrilici(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8iscyrilicc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8iscyrilici@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8iscyrilicc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8iscyrilici@plt>

LLVM IR (-O0):
define i32 @u8iscyrilicc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointc(i8* %3)
%5 = call i32 @u8iscyrilici(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8iscyrilicc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8iscyrilici(i32 %2)
ret i32 %3
}
int is_valid_w800_code(long code) { return 0x7d; }


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

x86 assembly (clang, -O2):
mov    $0x7d,%eax
ret

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

LLVM IR (-O2):
define i32 @is_valid_w800_code(i64 %0) {
ret i32 125
}
int traitement(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<traitement>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @traitement(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int bufbsdsock_write(int, char *, void *);
int bufbsdsock_putch(char ch, void *data) {
  return bufbsdsock_write(1, &ch, data);
}


x86 assembly (clang, -O0):
<bufbsdsock_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    -0x1(%rbp),%rsi
call   1030 <bufbsdsock_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufbsdsock_putch>:
push   %rax
mov    %rsi,%rdx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
call   1030 <bufbsdsock_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bufbsdsock_putch(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @bufbsdsock_write(i32 1, i8* %3, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @bufbsdsock_putch(i8 signext %0, i8* %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @bufbsdsock_write(i32 1, i8* %3, i8* %1)
ret i32 %4
}
int imin(x, y)
int x, y;
{
  if (x < y)
    return (x);
  return (y);
}


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

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

LLVM IR (-O0):
define i32 @imin(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* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
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 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int foo(int);
__attribute__((no)) int bar(int n) {
  while (--n)
    n = n * 2;
  return foo(n);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     113b <bar+0x2b>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <bar+0xb>
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %edi,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 2
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = call i32 @foo(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int open(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int Open(const char *path, int flags, mode_t mode) {
  int ret = open(path, flags, mode);
  if (ret == -1) {
    do {
      int e = errno;
      perror(path);
      exit(e);
    } while (0);
  }
  return ret;
}


x86 assembly (clang, -O0):
<Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1180 <Open+0x50>
jmp    1163 <Open+0x33>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     1147 <Open+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @Open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @open(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %23
15: ; preds = %3
br label %16
16: ; preds = %15
%17 = load i32, i32* @errno
store i32 %17, i32* %8
%18 = load i8*, i8** %4
%19 = call i32 @perror(i8* %18)
%20 = load i32, i32* %8
%21 = call i32 @exit(i32 %20)
unreachable
22: ; No predecessors!
br label %23
23: ; preds = %22, %3
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @Open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @perror(i8* %0)
%9 = tail call i32 @exit(i32 %7)
unreachable
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track_regex(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rstrip(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char search_for[80];
  printf("Search for: ");
  fgets(search_for, 80, stdin);
  rstrip(search_for);
  find_track_regex(search_for);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <rstrip@plt>
lea    -0x60(%rbp),%rdi
call   1060 <find_track_regex@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <rstrip@plt>
mov    %rbx,%rdi
call   1060 <find_track_regex@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 80, i32 %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = call i32 @rstrip(i8* %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%14 = call i32 @find_track_regex(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 80, i32 %6)
%8 = call i32 @rstrip(i8* %4)
%9 = call i32 @find_track_regex(i8* %4)
ret i32 0
}
char int_to_leds_m$leds$red_off(void) {
  char result;
  result = leds$leds$red_off();
  return result;
}


x86 assembly (clang, -O0):
<int_to_leds_m$leds$red_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <leds$leds$red_off@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$leds$red_off>:
push   %rax
xor    %eax,%eax
call   1030 <leds$leds$red_off@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"int_to_leds_m$leds$red_off"() {
%1 = alloca i8
%2 = call i32 (...) @"leds$leds$red_off"()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @"int_to_leds_m$leds$red_off"() {
%1 = tail call i32 (...) @"leds$leds$red_off"()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int const, void *const, size_t const);
ssize_t our_read(const int fd, void *const buf, const size_t size) {
  do {
    const ssize_t num = read(fd, buf, size);
    if (num != -1) {
      return num;
    }
  } while (errno == EINTR);
  return -1;
}


x86 assembly (clang, -O0):
<our_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     114b <our_read+0x3b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <our_read+0x61>
jmp    1150 <our_read+0x40>
mov    0x2e89(%rip),%rax
mov    (%rax),%rax
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%rax
je     1123 <our_read+0x13>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<our_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
jne    114b <our_read+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <our_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @our_read(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i32 %5
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
__attribute__((const)) int16_t av_clip_int16(int a) {
  if ((a + 32768) & ~65535)
    return (a >> 31) ^ 32767;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clip_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8000,%eax
and    $0xffff0000,%eax
cmp    $0x0,%eax
je     1130 <av_clip_int16+0x30>
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
xor    $0x7fff,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <av_clip_int16+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clip_int16>:
cmp    $0xffff8001,%edi
mov    $0xffff8000,%ecx
cmovge %edi,%ecx
cmp    $0x7fff,%ecx
mov    $0x7fff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @av_clip_int16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 32768
%6 = and i32 %5, -65536
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 31
%11 = xor i32 %10, 32767
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @av_clip_int16(i32 %0) {
%2 = icmp sgt i32 %0, -32768
%3 = select i1 %2, i32 %0, i32 -32768
%4 = icmp slt i32 %3, 32767
%5 = select i1 %4, i32 %3, i32 32767
ret i32 %5
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashrom_flashctx *, int, int,
                                     int /*<<< orphan*/, int);
int spi_disable_blockprotect_at25fs040(struct flashrom_flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x7C, 1 << 7, 0, 0xFF);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_at25fs040>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_at25fs040>:
mov    $0x7c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25fs040(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %3, i32 124, i32 128, i32 0, i32 255)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25fs040(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %0, i32 124, i32 128, i32 0, i32 255)
ret i32 %2
}